|
From: BBands <bb...@gm...> - 2011-06-03 23:33:15
|
First you probably want
set format x "%d-%m-%Y"
instead of
set format x "%d-%m-$Y"
and for rotation try
set xtics rotate
>From 'help set xtics': "rotate asks gnuplot to rotate the text through
90 degrees, which will be done if the terminal driver in use supports
text rotation. norotate cancels this. rotate by <ang> asks for
rotation by <ang> degrees, supported by some terminal types."
Best,
jab
On Fri, Jun 3, 2011 at 3:30 PM, Rich Shepard <rsh...@ap...> wrote:
> I'm essentially new to gnuplot although I used it lightly a dozen or so years
> ago. I think it's the only tool that will allow me to plot a time series
> with dates as the labels on the x-axis tics.
>
> While my script will be tuned to make it more presentable, the immediate
> need is to learn how to turn a date (such as 2009-05-13) 90 degrees
> counterclockwise and limit the number of labels on the x-axis range.
>
> The plot is daily precipitation at a monitoring station over three years.
> The code is:
>
> set datafile missing "NA"
> set xdata time
> set timefmt "%Y-%m-%d"
> set format x "%d-%m-$Y"
> set nokey
> set xlabel "Date" rotate by 270
> set ylabel "Precipitation (in)"
> set title "Daily Precipitation 2008-2010: CC-OR-8"
> set size ratio -2
>
> plot "cocorahs.dat" u 1:($2) w boxes
>
> The first few lines of the data file are:
>
> 2008-01-01 NA
> 2008-01-02 0.06
> 2008-01-03 0.60
> 2008-01-04 0.27
> 2008-01-05 0.56
> 2008-01-06 0.20
> 2008-01-07 0.44
>
> I can provide the entire data file (all 920 lines, 15K) if desired. Please
> point me in the right direction for adjusting the x-axis labels so they are
> both readable and complete (rather than the current "05-13-%Y".
>
> Rich
>
>
> ------------------------------------------------------------------------------
> Simplify data backup and recovery for your virtual environment with vRanger.
> Installation's a snap, and flexible recovery options mean your data is safe,
> secure and there when you need it. Discover what all the cheering's about.
> Get your free trial download today.
> http://p.sf.net/sfu/quest-dev2dev2
> _______________________________________________
> gnuplot-info mailing list
> gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
--
John Bollinger, CFA, CMT
www.BollingerBands.com
If you advance far enough, you arrive at the beginning.
|