|
From: Petr M. <mi...@ph...> - 2009-05-27 18:46:05
|
There are wrong tics on the y2 axis if the following is set: set autoscale fix; set logscale y2 The problem was discovered in one of graphs produced by Octave. The problem is in gnuplot since version 4.0. reset set ytics set logscale y set yrange [1:100] set y2tics set logscale y2 set y2range [1:100] plot 1+x*x pause -1 set autoscale fix replot I don't see any reason why AUTOSCALE_FIXMIN causes double-exponentiation of the y2 axis. Any idea? *** Observation by John W. Eaton: When I execute the following commands in gnuplot, the y2 tick marks appear to be linearly spaced and the y2 tick labels do not appear: set logscale y2 plot sin (x) axes x1y1, exp (x) axes x1y2 but after executing set logscale y replot they do appear, but then the y1 axis is also log scaled. Is is possible to set them independently? --- PM |
|
From: Ethan M. <merritt@u.washington.edu> - 2009-05-27 19:35:01
|
I don't see any bug here.
The resulting plots look correct to me, but I may misunderstand what you are
expecting to see.
Starting with the original query:
John W. Eaton >
> When I execute the following commands in gnuplot, the y2 tick marks appear
> to be linearly spaced and the y2 tick labels do not appear:
>
> set logscale y2
> plot sin (x) axes x1y1, exp (x) axes x1y2
The y2 tick labels do not appear simply because you never turned them on.
Try:
set y2tics
replot
> but after executing
>
> set logscale y
> replot
> they do appear, but then the y1 axis is also log scaled.
I don't see any y2 labels here. The tick marks on the right side that result
from this sequence of commands are the mirrored y1 ticks, not the y2 ticks.
> Is is possible to set them independently?
Certainly.
set ytics nomirror
set y2tics nomirror
unset log y
set log y2
On Wednesday 27 May 2009 11:45:56 Petr Mikulik wrote:
> There are wrong tics on the y2 axis if the following is set:
> set autoscale fix; set logscale y2
They look correct to me.
But to see them you have to first do
set ytics nomirror
set y2tics nomirror
> The problem was discovered in one of graphs produced by Octave.
> The problem is in gnuplot since version 4.0.
>
>
> reset
> set ytics
> set logscale y
> set yrange [1:100]
>
> set y2tics
> set logscale y2
> set y2range [1:100]
>
> plot 1+x*x
>
> pause -1
>
> set autoscale fix
> replot
>
>
> I don't see any reason why AUTOSCALE_FIXMIN causes double-exponentiation of
> the y2 axis.
It doesn't. If you change 'set autoscale fix' to 'set autoscale fixkeep'
then maybe that does what you want. But I'm not entirely sure what you
were expecting, so perhaps not.
In any case, I think there is some confusion about whether you are
really looking at y2tics, or whether you are looking at mirrored y1tics.
Ethan
|
|
From: Petr M. <mi...@ph...> - 2009-05-27 20:43:57
|
> I don't see any bug here. > The resulting plots look correct to me, but I may misunderstand what you are > expecting to see. I've forgotten to copy "set y2tics". So here it is: reset set ytics nomirror set logscale y set yrange [1:100] set y2tics nomirror set logscale y2 set y2range [1:100] plot 1+x*x pause -1 set autoscale fix replot Amazingly, replacing set autoscale fix by set autoscale keepfix solves the problem. But why "autoscale fix" double-exponentiates the y2-tics? *** reset set tics out set ytics nomirro set y2tics nomirror set autoscale keep set logscale y2 # set y2range ... plot 1+x*x show log show y2range pause -1 set y2range [1:10] replot show y2range *** Solution for Octave: replace "set autoscale fix" and add the required y2 range: set autoscale keepfix set y2range [1:180] --- PM |
|
From: Thomas S. <t.s...@fz...> - 2009-05-28 09:29:25
|
IMHO gnuplot reacts as it should: > reset > set ytics nomirror > set logscale y > set yrange [1:100] > > set y2tics nomirror > set logscale y2 > set y2range [1:100] > > plot 1+x*x everything looks right, the y*ranges are defined, so it doesn't matter that the y2axis isn't used. > pause -1 > > set autoscale fix > replot here, the defined y*ranges are forgotten, yrange is calculated from the function values and then - because y2tics is set - copied to the (not used!) y2axis, where, in order to prevent errors (logscale y2 !), the 1 to 100 yrange is converted into the 1e1 to 1e100 y2range. (if yrange would be [0:100] it wouldn't be possible to convert it into a log-range for y2axis, i think that's the idea behind this conversion) keep in mind, that y2axis is plotted but not used. using both yaxes plot 1+x*x, 1+x*x axes x1y2 solves the problem. -- View this message in context: http://www.nabble.com/set-autoscale-fix--set-logscale-y2-tp23748542p23758331.html Sent from the Gnuplot - Dev mailing list archive at Nabble.com. |
|
From: Petr M. <mi...@ph...> - 2009-05-28 10:34:57
|
> IMHO gnuplot reacts as it should: > > > reset > > set ytics nomirror > > set logscale y > > set yrange [1:100] > > > > set y2tics nomirror > > set logscale y2 > > set y2range [1:100] > > > > plot 1+x*x > > everything looks right, the y*ranges are defined, > so it doesn't matter that the y2axis isn't used. > > > pause -1 > > > > set autoscale fix > > replot > > here, the defined y*ranges are forgotten, yrange is > calculated from the function values and then - because > y2tics is set - copied to the (not used!) y2axis, > where, in order to prevent errors (logscale y2 !), the 1 to > 100 yrange is converted into the 1e1 to 1e100 y2range. > (if yrange would be [0:100] it wouldn't be possible to > convert it into a log-range for y2axis, i think that's the > idea behind this conversion) > > keep in mind, that y2axis is plotted but not used. > > using both yaxes > > plot 1+x*x, 1+x*x axes x1y2 > > solves the problem. Those y2 tics were explicitly set, so "plot ... axes x1y2" should not be required. I use this for x+x2 axes in order to have axes with wavelength and energy, for example. The bug appears even if "set autoscale fix" appears *before* explicit y2range: reset set autoscale fix set ytics nomirror set logscale y set yrange [1:100] set y2tics nomirror set logscale y2 set y2range [1:100] plot 1+x*x --- PM |
|
From: Thomas S. <t.s...@fz...> - 2009-05-28 10:56:25
|
> Those y2 tics were explicitly set, so "plot ... axes x1y2" should not be > required. I use this for x+x2 axes in order to have axes with wavelength > and > energy, for example. right, as long as you don't use autoscaling, it works. > The bug appears even if "set autoscale fix" appears *before* explicit > y2range: it doesn't matter where you specify "set autoscale fix" because it is respected 'at the end', i.e. when the 'plot' command is executed, and then the fixed ranges are forgotten and determined by the function values. and if there are no values - like in 'plot 1+x*x' - then y2axis gets its range from yaxis, with the precaution that yrange is transfered into the exponent if 'logscale y2' is on. -- View this message in context: http://www.nabble.com/set-autoscale-fix--set-logscale-y2-tp23748542p23759523.html Sent from the Gnuplot - Dev mailing list archive at Nabble.com. |
|
From: Ethan M. <merritt@u.washington.edu> - 2009-05-28 16:36:19
|
On Thursday 28 May 2009, Petr Mikulik wrote: > Those y2 tics were explicitly set, so "plot ... axes x1y2" should not be > required. I use this for x+x2 axes in order to have axes with wavelength and > energy, for example. This is a good example of why we need general axis transforms, not just log scale. For what it's worth, I handle the energy/wavelength case by leaving both x and x2 in energy space, but mapping the x2tic labels through a transform: set xtics nomirror set xlabel "eV" set xrange [2000:20000] set autoscale fix set for [wavelength in "1 2 3 5 10"] x2tics (wavelength." Å" 12398./wavelength) plot log(x) |