|
From: DavidH56 <dlh...@co...> - 2011-08-28 22:43:05
|
Thomas, Thank you, your code worked great, it's exactly what I needed. I've been struggling with this problem for a while. I changed the timefmt in my script to "%m-%d-%Y" to match my data and I used set nokey to turn off the legend. The only minor problem I have is with the x axis. The x axis values run from 0 to 80 in increments of 10 units. The first plot, which is all of the January values, is flush left with an x value of zero, and the x values get out of kilter with December falling at approximately 70. Any thoughts? Thanks again, David Thomas Sefzick wrote: > > assuming that your data have the following format > > ... > 2014-01-01 169 > 2014-02-01 170 > 2014-03-01 171 > 2014-04-01 172 > ... > > and that there are no gaps in the data and that there is one value > per month in every year, the following script may serve as an example > how such a cycle plot may be produced: > > reset > > # number of entries per month (i.e. number of years) > n=0 > # number of months > m=12 > > # although x-data are dates, we do the conversion into > # 'seconds since the beginning of the epoch' by our own, > # so we *don't* set xdata > #set xdata time > # but 'timefmt' we need for using 'timecolumn()' > set timefmt "%Y-%m-%d" > > # dummy plot to determine the value of 'n' > set table > plot for [i=0:m-1] "datafilename" \ > using ($0>n?n=$0:0 , $0):2 every 12::i > unset table > print n > > plot for [i=0:m-1] "datafilename" \ > using (tm_mon(timecolumn(1))+$0+i*n):2 \ > every m::i \ > with linespoints > > > > DavidH56 wrote: >> >> Cycle plots are useful in my work, and I'd like to know if it possible to >> create cycle plots in gnuplot. >> >> Naomi Robbins discusses cycle plots in her book Creating More Effective >> Graphs as well as in this article: >> >> http://www.perceptualedge.com/articles/guests/intro_to_cycle_plots.pdf >> >> Cycle plots can be generated in R using the "monthplot" command. If cycle >> plots can't be created in gnuplot, is there a way to make a feature >> request? >> >> Thanks, >> >> David >> >> > > -- View this message in context: http://old.nabble.com/Can-gnuplot-create-cycle-plots-%28also-called-month-plots%29--tp32276901p32323781.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |