Hello,
I try to plot 8 curves on the same graph. Unfortunately, the last point of a curve is located to far from te others on the y-axis and the scale is bad.
set terminal svg
set output 'test.svg'
set key below
set datafile separator ","
set xrange [] reverse
plot "regle_sup.dat" using 1:2 title 'A' with linespoints lc rgb 'red', \
"regle_sup.dat" using 1:3 title 'B' with linespoints lc rgb 'blue', \
"regle_sup.dat" using 1:4 title 'C' with linespoints lc rgb 'green', \
"regle_sup.dat" using 1:5 title 'D' with linespoints lc rgb 'magenta', \
"regle_sup.dat" using 1:6 title 'E' with linespoints lc rgb 'orange', \
"regle_sup.dat" using 1:7 title 'F' with linespoints lc rgb '#006400', \
"regle_sup.dat" using 1:8 title 'G' with linespoints lc rgb '#2F4F4F', \
"regle_sup.dat" using 1:9 title 'H' with linespoints lc rgb '#A0522D'
I try to plot 8 curves on the same graph. Unfortunately, the last point
of a curve is located to far from te others on the y-axis and the scale
is bad.
How can I get a correct scale?
That depends a bit on the meaning of your curves. You could plot this one curve against the second y axis with
set ytics nomirror
set y2tics
plot 'regle_sup.dat' using 1:8 axes x1y2 title 'G'
No need to --- you already got a correct scale. It's just unreadable; but then again, what did you expect from a plot spanning more than 4 magnitudes of y values? A typical way of handling this would be a logarithmic y axis:
set log y
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For the scale, I use the logarithmic axis which is easier to understand. Now I have another problem: the H curve starts from 0.05 since for 0.1 the value is 0.
How can I plot the H curve from 0.1 to 0.05?
Last edit: lovelace63 2014-07-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I try to plot 8 curves on the same graph. Unfortunately, the last point of a curve is located to far from te others on the y-axis and the scale is bad.
My file test.dat:
0.10,4764,493,397,375,48,3573,7676,0
0.05,9801,1720,935,543,174,8219,36002,28
0.01,14861,11431,3090,890,2617,18823,568607,4714
And my code:
set terminal svg
set output 'test.svg'
set key below
set datafile separator ","
set xrange [] reverse
plot "regle_sup.dat" using 1:2 title 'A' with linespoints lc rgb 'red', \ "regle_sup.dat" using 1:3 title 'B' with linespoints lc rgb 'blue', \ "regle_sup.dat" using 1:4 title 'C' with linespoints lc rgb 'green', \ "regle_sup.dat" using 1:5 title 'D' with linespoints lc rgb 'magenta', \ "regle_sup.dat" using 1:6 title 'E' with linespoints lc rgb 'orange', \ "regle_sup.dat" using 1:7 title 'F' with linespoints lc rgb '#006400', \ "regle_sup.dat" using 1:8 title 'G' with linespoints lc rgb '#2F4F4F', \ "regle_sup.dat" using 1:9 title 'H' with linespoints lc rgb '#A0522D'
How can I get a correct scale? I found a solution :
http://stackoverflow.com/questions/18919064/gnuplot-how-to-set-custom-non-linear-scales
But, I don't understand how to adapt it in my case.
Another question: can I have only 0.01, 0.05 and 0.10 on the y-axis?
Thank you in advance,
That depends a bit on the meaning of your curves. You could plot this one curve against the second y axis with
I'm not sure, if a custom nonlinear scale is the best choice. That can make interpretation of the data very cumbersome.
No need to --- you already got a correct scale. It's just unreadable; but then again, what did you expect from a plot spanning more than 4 magnitudes of y values? A typical way of handling this would be a logarithmic y axis:
Thanks to both of you for your answers.
xtics works very well.
For the scale, I use the logarithmic axis which is easier to understand. Now I have another problem: the H curve starts from 0.05 since for 0.1 the value is 0.
How can I plot the H curve from 0.1 to 0.05?
Last edit: lovelace63 2014-07-01
The problem comes from the logarithmic axis.
To solve it, I used:
"data.dat" using 1:($9+1) title 'H' with linespoints lc rgb '#A0522D'