Change Y-Variable to Ln Y in Gnuplot: How-To Guide for Linear Graphing

  • Thread starter Thread starter VenaCava
  • Start date Start date
  • Tags Tags
    Gnuplot Ln
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 10K views
VenaCava
Messages
20
Reaction score
0
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
 
Physics news on Phys.org
Hi VenaCava,

VenaCava said:
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

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:
plot 'data.txt' u 1:(log($2))