Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set axis units in gnuplot

I'm trying to generate some schematic figures using gnuplot. My x scale is of angstrom and the y scale if of mV. Currently, I have the x scale goes like:

0 1e-9 2e-9 3e-9 etc.

And my y scale goes like

-0.07 -0.06 -0.05 etc.

And I want them to be

0 10 20 30 etc.
-70.0 -60.0 -50.0 etc.

respectively. Is there a way to do this from within the gnuplot (apart from setting the xrange an yrange parameters and multiplying the values by the appropriate amounts)?

like image 826
Yotam Avatar asked Jun 27 '11 09:06

Yotam


1 Answers

There are two ways that I can think of:

  1. You could make use of set xtics (see documentation here)
    Then you can explicitly specify what value on your axis will receive which label. So something like this:

    set xtics ("0" 0, "10" 1e-9, "20" 2e-9, ...)
    

    should work. Proceed accordingly with the y axis (set ytics)

  2. You could multiply your values accordingly. (Like what you have mentioned in your question)

    plot "Data.dat" u ($1*1e9):($2*1e2)
    
like image 182
Woltan Avatar answered Sep 24 '22 17:09

Woltan