lovelace63
2014-06-30
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,
Christoph Bersch
2014-06-30
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'
I found a solution :
http://stackoverflow.com/questions/18919064/gnuplot-how-to-set-custom-non-linear-scalesBut, I don't understand how to adapt it in my case.
I'm not sure, if a custom nonlinear scale is the best choice. That can make interpretation of the data very cumbersome.
Another question: can I have only 0.01, 0.05 and 0.10 on the y-axis?
set xtics (0.1, 0.05, 0.01)
Hans-Bernhard Broeker
2014-06-30
How can I get a correct scale?
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
lovelace63
2014-07-01
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?
lovelace63
2014-07-02
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'