how to make data exponential using gnu plot - plot

so, I need to make y axis be exponential and also my observation should be exponential too. Here is code
set yrange[2.8:4.2]
# forecasts with 95 pc conf. interval
plot \
'-' using 1:2 title "log_m" w lines lw 0.5, \
'-' using 1:2 title "forecast" w lines, \
'-' using 1:2:3 title "95-interval" w errorbars
2019.333333 3.496507561
2019.416667 3.433987204
2019.5 3.465735903

Related

Gnuplot Plotting

Can we plot both points with smooth csplines in one legend? If we plot them separately two legends generates with separate point and line.
I expect both point and smooth line in one legend as in case of linepoints
If you have a current gnuplot (version 5.4), use keyentry to generate a custom entry for the plot legend.
plot FOO with points lt 2 notitle, \
FOO smooth csplines with lines lt 2 notitle, \
keyentry with linespoints lt 2 title "points + lines"

how to improve the following gnu plot?

I have the following gnu plot:
# automobile_input.txt
#
set term png
set output "automobile.png"
#
# Fields in each record are separated by commas.
#
set datafile separator ","
set title "Price versus Curb weight"
set xlabel "Price in dollars"
set ylabel "Curb weight in pounds"
set grid
plot 'x' using 1:2
quit
x is a file containing numbers such as
1,2
0.5,4
etc.
I would like to make a few changes to this plot.
At the top of the plot there is "x using 1:2" and I would like to remove that.
Finally, the most important thing: I would like to add another file, y, in the same format, which will be also plotted on the same plot, only with a different sign and color (instead of pluses in red), for example, blue triangles. I would rather also the pluses be circles.
Omit the data series title by using notitle in your plot line. Adding another curve would be done like this:
plot 'x' using 1:2 notitle, \
'y' using 1:2 notitle
The data series points will adjust automagically. To manually specify the format, you might plot with something like this:
plot 'x' using 1:2 with points pointtype 6 linecolor rgb 'red' title "Data X", \
'y' using 1:2 with points pointtype 8 linecolor rgb 'blue' title "Data Y"
You'll usually see scripts online that abbreviate these command to look like:
plot 'x' w p pt 6 lc rgb 'red' title "Data X", \
'y' w p pt 8 lc rgb 'blue' title "Data Y"

Make error bar to a converted value

Im trying to make errorbars to a already converted value. I have value in the dat file as uk gallons per minute and have now converted it into m^3/min.
My problem is that i cannot get my error bars when i also convert the value. Initially i just bracket the converting and then the accuracy on 0.0025(0.25%) but no error bars appear..
set yrange [34:37.5]
set xlabel "Time [min]"
set ylabel "Flow [m^3/min]"
plot '2015 08 30 0000 Pelletizer Feed (Wide).dat' every ::2372::2459 using 4:($17*0.161) w l lc rgb 'green' title "Run 1", \
'' every ::2372::2459 using 4:17:(($17*0.161)*0.0025) w errorbar lc rgb 'green' notitle, \
'2015 08 30 0000 Pelletizer Feed (Wide).dat' every ::2498::2565 using 4:($17*0.161) w l lc rgb 'blue' title "Run 2", \
'' every ::2498::2565 using 4:17:(($17*0.161)*0.0025) w errorbar lc rgb 'blue' notitle, \
35.42 title "SP" with lines linestyle 2
When plotting with lines and with errorbars you are using different y-values. You have using 4:($17*0.161) for the lines, but using 4:17:(($17*0.161)*0.0025) for the errorbars, so that the errorbars are out of your yrange. Try:
set yrange [34:37.5]
set xlabel "Time (min)"
set ylabel "Flow (m^3/min)"
file = '2015 08 30 0000 Pelletizer Feed (Wide).dat'
set linetype 1 lc rgb 'green'
plot file every ::2372::2459 using 4:($17*0.161) w l lt 1 title "Run 1", \
'' every ::2372::2459 using 4:($17*0.161):(($17*0.161)*0.0025) w errorbar lt 1 notitle

filling under step functions in gnuplot

I am using Gnuplot to draw step functions from an input file:
plot 'myFile' using 1:2 with steps
I want to fill underneath the plot. something like
plot 'myFile' using 1:2 with filledcurves
But Gnuplot fill underneath the diagram by drawing a line between consecutive points.
How can I fill in underneath the step function?
Use the fillsteps plotting style, which is the same as steps, but the area between the curve and y=0 is filled:
set samples 11
set xrange [0:10]
plot '+' with fillsteps fs solid 0.3 noborder lt 1,\
'+' with steps lt 1 lw 4

Scaling of multiplot while using variables to define the column

I am getting data from a script stuff.pl and want to plot dynamically into one graph. So I am going to use a loop in Gnuplot (v4.6 patchlevel 3) which leads me to following problem:
Using the file TEST.gp:
xCol=2; yCol=3
set term x11 1
plot '< stuff.pl' u xCol:yCol
xCol=4; yCol=5
set term x11 1
set autoscale y
replot '< stuff.pl' u xCol:yCol
pause 1
and run it via gnuplot TEST.gp my graph isn't scaled proper. The plot is just showing the second graph (scales to its values).
If I use
plot '< stuff.pl' u 2:3
replot '< stuff.pl' u 4:5
, which should behave the same imo, the scaling works.
I am not understanding this behaviour.
The replot calls the previous plot command and then adds another plot. In the previous plot command the variables haven't been replaced. When the replot calls the previous plot command, the last values of xCol and yCol are used for both plots!
You can either use two different variables:
xCol1 = 2; yCol1 = 3
plot '< stuff.pl' u xCol1:yCol1
xCol2 = 4; yCol2 = 5
replot '< stuff.pl' u xCol2:yCol2
or you can use macros, which are replaced
set macros
cols='2:3'
plot '< stuff.pl' u #cols
cols='4:5'
replot '< stuff.pl' u #cols

Resources