I would like to create a plot with labels on the data points using the second y-axis. Now it seems that the labels are not plotted when I don't use the initial automatically determend yrange and change it so that the data points of the plot based on the y2axis are not within the range of the yrange.
I know this sound not that clear so I'll try to clarify with an example and below I add an example script.
So suppose I want to plot the following values and relate them to the y2 axis and I would like to see labels on the datapoints:
10
11
12
in test.dat, I use :
plot 'test.dat' w lp ls 6 axis x1y2 notitle, \
'' using 0:1:1 w labels offset 0,1 tc ls 6 axis x1y2 notitle
A graph as expected will show up. Now when I change the range of the y1axis , I expect nothing to happen as the plot command only uses the y2axis. Wrong, when choosing a range in which the datapoints do not fit (ie set yrange [0:5] ), the linepoints plot is drawn correctly, but the labels do not show up. Changing y2range again to [9:14] will again show the labels as before.
try it yourself with the supplied script. put your data in 'test.dat'
set yrange [15:18]
set y2range [0:30]
set y2tics
plot 'test.dat' w lp ls 6 axis x1y2 title "Avg. packet loss", \
'' using 0:1:1 w labels offset 0,1 tc ls 6 axis x1y2 notitle
Logged In: YES
user_id=235620
Originator: NO
Sorry. I cannot figure out what you are trying to say.
For me the y2 labels work correctly in all cases, as best as I can follow your description of the test procedure.
The y1 labels plotted in your example are meaningless, because the data points are not being plotted against the y1 axis at all. If you actually plotted some y1 points on the same plot then they would be correctly positioned with respect to the y1 labels.
If you think you have found a real bug (I'm not using OSX, so for all I know it could behave differently) then please attach one of the output plots for which you think the labels are wrong and also attach the script that generated it.
testplots and scripts
Logged In: YES
user_id=1904753
Originator: YES
I'm sorry if I was not so clear in what I was trying to say. I hope I can clarify some more.
To start with, I tried this with osx and linux, so I don't think it is a platform issue, furthermore I tried it with 4.2.0 and the current CVS version.
Attached is an archive containing 5 files:
test.dat: a file containing 3 datapoints
test1.gpl and test1.jpeg: script and result of plotting sin(x) against the y1 axis and the 3 data points, with labels on the plot at the datapoints, on the y2 axis, no ranges defined
test2.gpl and test2.jpeg: script and result of the same scenario as above, but defining a y-range of [0:14]
Now what should be noticed (IMHO) that in the first test (test1) no labels are visible at the plotted datapoints . By default when plotting sin(x) the y-range runs from 0 to 1. Now changing the y-range in test2 to [0:14], which contains the datapoints (10,11,12) the labels suddenly are plotted, altough the datapoints and labels are defined against the y2-axis. I would expect a change in the y-axis not to affect anything which has been defined against the y2-axis. To compare, although I change the y-range in both scenario's, nothing changes to the plot with linespoints defined against x1y2, only with labes seems to wronly respond to the y-axis. The plot using 'with labels' however is defined the same way using 'axis x1y2'.
I hope this makes it more clear to you. In case I'm made a mistake in syntax, I would be happy to learn from you otherwise I do think this is a bug.
File Added: labels.tgz
Logged In: YES
user_id=235620
Originator: NO
Ah! Finally I understand.
I thought you were talking about the y2 axis tic labels.
But no, you mean the labels created by "plot ... with labels".
There does indeed seem to be something odd going on there. Got it.
Possible fix for CVS version
Logged In: YES
user_id=235620
Originator: NO
Please try the attached patch against current CVS.
File Added: labelbug.patch
Logged In: YES
user_id=1904753
Originator: YES
I just tried the patch and now the labels show up as expected!
Nice job, thank you for the quick responses. This keeps gnuplot what it should be, a hell of a good piece of software making plots the way you want them to be!
keep up the good work!
Peter