|
From: Paolo P. <pao...@to...> - 2007-12-19 15:00:09
|
Hi,
as the subjects says i've a plot with a lot x tics, and the output is
garbled, is there a way to skip some of them?
Here is my gnuplot script:
set title "Email Processing Status"
set term png size 1024 768
set xlabel "Time" offset 0,-2
set ylabel "Volume"
set key invert reverse Left outside
set style data histogram
set style histogram rowstacked
set style fill solid border -1
#set xdata time
#set timefmt "%H:%M"
#set format x "%01H %02M"
#set xrange ["00:00":"23:59"]
#set xtics "00:00", 600, "23:59"
set xtic rotate by 90
plot '$DATAFILE' using 2:xtic(1) title "Done", \
'' u 3:xtic(1) title "Running", \
'' u 4:xtic(1) title "Ready", \
'' u 5:xtic(1) title "Queued"
and here is the data file:
13:00 1965942 142846 0 618324
13:20 2086281 168174 0 528615
13:40 2236936 159883 0 422962
14:00 2378720 151422 4958 468820
14:20 2509835 154974 0 708086
14:40 2657699 146929 4988 565078
15:00 2805058 143064 4989 421594
15:20 2883667 169049 0 321989
15:40 2992881 168951 0 317069
16:00 3127238 120896 4634 294658
16:20 3269671 150755 4951 330317
16:40 3390164 160732 0 394797
17:00 3536742 123940 3452 345381
17:20 3633127 131688 4950 268028
17:40 3777765 158817 0 254588
18:00 3840300 156367 0 252872
18:20 3854284 166587 0 397645
18:40 3945939 167211 0 444801
19:00 4128396 122230 4993 302734
19:20 4212272 159910 0 186171
19:40 4352849 156593 4479 150646
20:00 4514529 98026 4930 123554
20:20 4576299 159961 0 136804
20:40 4678907 76802 0 602926
21:00 4755709 83130 0 519796
21:20 4829059 83941 0 445635
21:40 4908008 84857 0 365770
22:00 4987874 89838 0 280923
22:20 5072721 89313 0 196601
22:40 5152202 78643 0 127790
23:00 5186610 78640 0 93385
23:20 5235760 83555 0 39320
23:40 5314400 44235 0 0
[snip]
and here is the resulting plot: http://people.tomato.it/piso/foo.png.
As you can see, on the x axis i've time samples and i would like to have
1 tic printed every 6 hours or so and (if possible) the name of the day
printed below the x axis
every time it wraps 24hours.
I've already tried to play around with 'xdata time', but i couldn't get
anything usable...
bye,
P.
ps please cc: me as i'm not subscribed to the mailing list...
|
|
From: Thomas S. <t.s...@fz...> - 2007-12-19 16:25:52
|
# needed for deleting explicitly defined xtics
set xtics auto
# plot 0.0 at each 3rd position, plot nothing = 'undefined' = 0/0 elsewhere
plot '$DATAFILE' using ((int($0)%3)==0?0.:0/0):xtic(1) notitle, \
'' u 2 title "Done", \
'' u 3 title "Running", \
'' u 4 title "Ready", \
'' u 5 title "Queued"
Paolo Pisati-3 wrote:
>
> Hi,
>
> as the subjects says i've a plot with a lot x tics, and the output is
> garbled, is there a way to skip some of them?
>
> Here is my gnuplot script:
>
> set title "Email Processing Status"
> set term png size 1024 768
> set xlabel "Time" offset 0,-2
> set ylabel "Volume"
> set key invert reverse Left outside
> set style data histogram
> set style histogram rowstacked
> set style fill solid border -1
> #set xdata time
> #set timefmt "%H:%M"
> #set format x "%01H %02M"
> #set xrange ["00:00":"23:59"]
> #set xtics "00:00", 600, "23:59"
> set xtic rotate by 90
> plot '$DATAFILE' using 2:xtic(1) title "Done", \
> '' u 3:xtic(1) title "Running", \
> '' u 4:xtic(1) title "Ready", \
> '' u 5:xtic(1) title "Queued"
>
> and here is the data file:
>
> 13:00 1965942 142846 0 618324
> 13:20 2086281 168174 0 528615
> 13:40 2236936 159883 0 422962
> 14:00 2378720 151422 4958 468820
> 14:20 2509835 154974 0 708086
> 14:40 2657699 146929 4988 565078
> 15:00 2805058 143064 4989 421594
> 15:20 2883667 169049 0 321989
> 15:40 2992881 168951 0 317069
> 16:00 3127238 120896 4634 294658
> 16:20 3269671 150755 4951 330317
> 16:40 3390164 160732 0 394797
> 17:00 3536742 123940 3452 345381
> 17:20 3633127 131688 4950 268028
> 17:40 3777765 158817 0 254588
> 18:00 3840300 156367 0 252872
> 18:20 3854284 166587 0 397645
> 18:40 3945939 167211 0 444801
> 19:00 4128396 122230 4993 302734
> 19:20 4212272 159910 0 186171
> 19:40 4352849 156593 4479 150646
> 20:00 4514529 98026 4930 123554
> 20:20 4576299 159961 0 136804
> 20:40 4678907 76802 0 602926
> 21:00 4755709 83130 0 519796
> 21:20 4829059 83941 0 445635
> 21:40 4908008 84857 0 365770
> 22:00 4987874 89838 0 280923
> 22:20 5072721 89313 0 196601
> 22:40 5152202 78643 0 127790
> 23:00 5186610 78640 0 93385
> 23:20 5235760 83555 0 39320
> 23:40 5314400 44235 0 0
> [snip]
>
> and here is the resulting plot: http://people.tomato.it/piso/foo.png.
>
> As you can see, on the x axis i've time samples and i would like to have
> 1 tic printed every 6 hours or so and (if possible) the name of the day
> printed below the x axis
> every time it wraps 24hours.
>
> I've already tried to play around with 'xdata time', but i couldn't get
> anything usable...
>
> bye,
> P.
>
> ps please cc: me as i'm not subscribed to the mailing list...
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services
> for just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> Gnuplot-info mailing list
> Gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
>
--
View this message in context: http://www.nabble.com/Plot-with-many-x-tics%3A-how-to-skip-some--tp14418600p14420284.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|
|
From: Paolo P. <pi...@to...> - 2007-12-19 17:42:52
|
Thomas Sefzick wrote: > > # needed for deleting explicitly defined xtics > set xtics auto > # plot 0.0 at each 3rd position, plot nothing = 'undefined' = 0/0 > elsewhere > plot '$DATAFILE' using ((int($0)%3)==0?0.:0/0):xtic(1) notitle, \ > '' u 2 title "Done", \ > '' u 3 title "Running", \ > '' u 4 title "Ready", \ > '' u 5 title "Queued" > > Thank you so much, that was exactly what i was looking for! While here, i've one last question: isn't it possible to change the value on the y axis from the scientific notation (e.g. 1e+06) to a more human readable form (e.g. 1M)? Thanks. -- View this message in context: http://www.nabble.com/Plot-with-many-x-tics%3A-how-to-skip-some--tp14418600p14421757.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Thomas S. <t.s...@fz...> - 2007-12-19 20:35:54
|
there is some code in 'util.c', subroutine 'gprintf', which calculates the mantissa for base 1000 and some code which generates iso decimal prefix letters, you may use it like this: set format y "%3.0s%c" i'm not sure, but it seems to be undocumented, so have a look at the source code to see which additional format options are available. Paolo Pisati wrote: > > Thank you so much, that was exactly what i was looking for! > While here, i've one last question: isn't it possible to change the value > on the y axis from the scientific notation (e.g. 1e+06) to a more human > readable form > (e.g. 1M)? > > Thanks. > -- View this message in context: http://www.nabble.com/Plot-with-many-x-tics%3A-how-to-skip-some--tp14418600p14424669.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: <HBB...@t-...> - 2007-12-19 22:40:55
|
Thomas Sefzick wrote: > set format y "%3.0s%c" > > i'm not sure, but it seems to be undocumented, so have a look at the source > code to see which additional format options are available. You missed "help format specifiers" I wonder how that could happen, given that this node is listed right there in the links section of the "help set format" page. How much easier to find could it be? |
|
From: <HBB...@t-...> - 2007-12-19 22:46:33
|
Paolo Pisati wrote: > as the subjects says i've a plot with a lot x tics, and the output is > garbled, is there a way to skip some of them? Well, you got what you asked for. So maybe you shouldn't have asked for what you got. Your command > plot '$DATAFILE' using 2:xtic(1) title "Done", \ > '' u 3:xtic(1) title "Running", \ > '' u 4:xtic(1) title "Ready", \ > '' u 5:xtic(1) title "Queued" explicitly requests a tic label for each and every single data point. I.e. you turned your graph into an unholy mixture of a table and plot. The default behaviour of time/date axes may not always be perfect, but it's guaranteed to be vastly superior to a solid black rectangle below the plot generated by massively overprinted tick labels. |