LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 02-10-2010, 06:36 AM   #1
talla
LQ Newbie
 
Registered: Jan 2010
Location: Berlin
Posts: 16

Rep: Reputation: 1
gnuplot custom x-axis


Hey guys,


I need to do some plotting with gnuplot. I have a bunch of data in a file in this format:

Code:
Updates     graph1     graph2
0     10215      1452
1     172840     184608
2     199870     198374
....
...
total 300000     300000
whereas the left column is the x-axis (0, 1, .., 30, total) and the other two columns represent the "y-values" of the plots.

I use the following gnuplot code to plot this:
Code:
set terminal postscript enhanced color
set output 'updatecount.ps'
set bar 1.000000
set style rectangle back fc lt -3 fillstyle  solid 1.00 border -1
set key outside right top vertical Right noreverse enhanced autotitles columnhead nobox
set datafile missing '-'
set style data lines
set yrange [0:305000]

set xtics border in scale 1,0.5 nomirror rotate by -45  offset character 1, 0, 0
set xtics  norangelimit

offset character 0, 0, 0 font "" textcolor lt -1 rotate by 90
set y2label  offset character 0, 0, 0 font "" textcolor lt -1 rotate by 90
set cblabel  offset character 0, 0, 0 font "" textcolor lt -1 rotate by 90
set locale "C"
plot 'updatecount.dat' using 2:xtic(1), '' u 3, '' u 4, '' u 5, '' u 6, '' u 7, '' u 8, '' u 9, '' u 10, '' u 11, '' u 12, '' u 13, '' u 14, '' u 15, '' u 16, '' u 17, '' u 18, '' u 19, '' u 20, '' u 21, '' u 22
this works fine so far.. I get some warnings because I don't have as many columns as defined but that doesn't matter.
(to be honest, I took the gnuplot code from a different example. I'm not really into gnuplot...)

It plots the data the way it should and places the x- values: 0, 1 , 2 etc. correctly. (as in the first column)

Now I want a different scaling of the x-axis. Is there a simple way to just override the values on the x-axis and position my own values? (I was thinking about: 0, 1, 5, 10, 20, total) or so..

Thank you VERY much in advance!

Cheers,
talla

Last edited by talla; 02-10-2010 at 06:39 AM.
 
Old 02-10-2010, 07:17 AM   #2
talla
LQ Newbie
 
Registered: Jan 2010
Location: Berlin
Posts: 16

Original Poster
Rep: Reputation: 1
ok, issue is solved. Problem was the "plot" command (last line)

If i use
Code:
      plot    "updatecount.dat" using 1:2 title 'Column' with linespoints , \
            "updatecount.dat" using 1:3 title 'Beam' with points
instead, i can set the xticks regularly using
Code:
set xtics (0,1,5,10,20)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
gnuplot - plot horizontal line over shorter range than the axis Meson Linux - Software 5 10-18-2008 08:41 AM
Axis and Xerces traene Programming 2 09-14-2007 11:48 AM
gnuplot: how to label x-axis with strings from data file? hedpe Linux - Software 2 07-11-2006 10:21 AM
Axis Of Feeble Dragineez General 15 05-23-2006 03:20 PM
Mouse is off axis aliensub Linux - Hardware 6 09-29-2004 04:35 PM


All times are GMT -5. The time now is 08:15 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration