plot - How to control xtics in gnuplot -


as title says, want control range , amount of xtics. use gnuplot plotting data files in horizontal axes time (t) taking values in interval [0, t_max]. ok, let's suppose following scenario:

the maximum value of time 4086 , particular value not known beforehand. however, can found using

stats "data.out" u 1 set xrange [0:stats_max] 

my question how can round maximum value of t closest hundred (4100 in case)? also, there way tell gnuplot print 5 ticks @ horizontal axes regardless of range (rounding maximum value closest hundred, or decade divided 5)?

many in advance!

to round closest hundred, use ceil function:

set xrange[0: 100*ceil(stats_max/100.0)] 

regarding xtics, can set start, increment, end, , explicit tic position of tics, not number of ticks. since set xrange manually, can use information calculate tic frequency:

x_lim = 100*ceil(stats_max/100.0) set xrange[0: x_lim] set xtics x_lim/4.0 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -