I have a set of CSV data where it is a range of data from 2000 – 2000000 bytes, say, and I want to plot every single one of these points. I however don’t want it to say 2e6 for my data but rather just 2, so I can set my x-axis title to “megabytes”.
That is, how do automatically override the visible text on the x axis bar (via some sort of formula relating to the underlying data?) using gnuplot?
You can arithmetically manipulate data in the using directive. If you have a data file
Data.csv:you can plot this with this script:
Note the
($1/1e6)using directive. The$1references the first column of the data file. The brackets are mandatory!You end up with a plot like this:
If you have data ranging though many orders of magnitude, maybe using a logarithmic scaling would be interesting to think about.