Zhihar
Zhihar

Reputation: 1428

gnuplot: The format of the values on the axis with a constant power

There are values on the y scale

0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 ...

How to set the format set format x ""

so that the data can be output in the form

0 
2 * 10^-2 
4 * 10^-2 
6 * 10^-2 
8 * 10^-2 
10 * 10^-2 
12 * 10^-2 
14 * 10^-2 
16 * 10^-2 
18 * 10^-2
20 * 10^-2

i.e. the initial base is selected automatically and the power does not change.

Upvotes: 0

Views: 643

Answers (1)

Dan Sp.
Dan Sp.

Reputation: 1447

Your question is a little unclear. Here is a guess at what you want.

when you plot the data, multiply it by 10**2. Then in the label, show that the data is *10^-2.

Example: if that line of data is 1 item per line, you would have:

plot 'dataFile.txt' using 1

Instead, try:

set ylabel 'DataName *10_{-2}'
plot 'dataFile.txt using ($1*10**2)

The above set ylabel assumes you have enhanced formatting turned on.

This is a rudimentary example. We can do better if you show us an actual piece of the data file and you include your plot statement so we can see what you are actually trying to do.

Upvotes: 1

Related Questions