octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: plotyy


From: David Bateman
Subject: Re: plotyy
Date: Tue, 27 Nov 2007 00:16:06 +0100
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

John W. Eaton wrote:
> On 26-Nov-2007, David Bateman wrote:
> 
> | David Bateman wrote:
> | > Here is an how plotyy might be implemented in a matlab compatible
> | > manner.. To get the two plot axes aligned in gnuplot it forces the
> | > margins in __go_draw_axes__ with the "set lmargin" and "set rmargin"
> | > commands to gnuplot.
> | > 
> | > There is one issue with this that appears to be a gnuplot bug.. If I try
> | > the example
> | > 
> | > 
> | >           x = 0:0.1:2*pi;
> | >           y1 = sin (x);
> | >           y2 = exp(x - 1);
> | >           ax = plotyy(x, y1, x - 1, y2, @plot, @semilogy);
> | >           ylabel (ax(1), "Axis 1");
> | >           ylabel (ax(2), "Axis 2");
> | > 
> | > then the text "Axis 1" appears twice, even though the xlabel command is
> | > only sent to gnuplot once.. This might limit the usefulness of this for
> | > publication plots until the issue is fixed in gnuplot, but plotyy is
> | > still useful in any case.
> | > 
> | > D.
> | 
> | 
> | Here is an updated version that addresses the doubled labels issue.
> | Basically the problem was that gnuplot labels are persistent, and so are
> | kept between plots. I therefore had to unset xlabel when I set x2label.
> | There was also a bug in the {x|y|z}label changes I made.
> | 
> | Note that the manner in which this works is that if the axis property
> | "position" is set, it is assumed we are dealing with a plotyy plot.
> | Matlab sets a property which is called something like
> | "ActivePositionType", though I haven't got matlab here at the moment and
> | can't check. We can get the same effect just checking if "position" is
> | empty and so I don't see the use of this matla specific flag.
> 
> I still think it would be better if we could somehow recognize that
> there are multiple axes and use a single plot command, but as this
> works and is a less invasive change, I applied it.
> 
> Thanks,
> 
> jwe
> 

You forgot to do a cvs add on plotyy.m.. Done

D.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]