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

  • Thread starter VenaCava
  • Start date
  • Tags
    Gnuplot Ln
In summary, the conversation is about how to change the y-variable in Gnuplot to ln y without changing the source data file. The person has already tried using "set log y" but it only changed the y-axis scale. They want to plot an exponential decay as a linear graph (lny vs time) and are given a command to do so using a data file.
  • #1
VenaCava
20
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
  • #2
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))
 

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

Why do I need to change the Y-variable to ln Y in Gnuplot?

Changing the Y-variable to ln Y in Gnuplot is often necessary when graphing data that follows a logarithmic trend. This allows for a more accurate representation of the data on a linear scale graph.

How do I change the Y-variable to ln Y in Gnuplot?

To change the Y-variable to ln Y in Gnuplot, you will need to use the "set logscale" command and specify the base of the logarithm as the Y-axis. For example, if the base is 10, the command would be "set logscale y 10".

Can I change the Y-variable to ln Y in Gnuplot for any type of data?

No, changing the Y-variable to ln Y in Gnuplot is only useful for data that follows a logarithmic trend. If the data does not follow this trend, it is not necessary to change the Y-variable to ln Y.

Will changing the Y-variable to ln Y in Gnuplot change the actual data?

No, changing the Y-variable to ln Y in Gnuplot will only affect how the data is represented on the graph. It does not alter the original data in any way.

Are there any limitations to using ln Y in Gnuplot for linear graphing?

While changing the Y-variable to ln Y in Gnuplot can be useful for certain types of data, it may not accurately represent the data if it does not follow a logarithmic trend. It is important to consider the nature of the data before making this change.

Similar threads

Replies
5
Views
2K
Replies
2
Views
4K
Replies
1
Views
4K
Replies
5
Views
6K
Replies
11
Views
2K
Back
Top