Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Gnuplot: setting y as ln y

  1. Sep 26, 2010 #1
    Is there an easy way to change your y-variable in Gnuplot to ln y without changing the source data file?
    I already tried "set log y" but that only changed the y-axis scale, not the actual y-values.
    Right now I'm plotting an exponential decay and I wanted to make it a linear graph (lny vs time).

    Thanks
     
  2. jcsd
  3. Sep 28, 2010 #2

    alphysicist

    User Avatar
    Homework Helper

    Hi VenaCava,

    I'm not sure if this is what you want, but if you are using a data file "data.txt" with x and y columns, you can plot the natural log of the y columns with the command:

    Code (Text):

    plot 'data.txt' u 1:(log($2))
     
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook