octave-maintainers
[Top][All Lists]
Advanced

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

Re: Stem update, rough guess.


From: Daniel J Sebald
Subject: Re: Stem update, rough guess.
Date: Mon, 09 Apr 2007 18:33:05 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020

John W. Eaton wrote:
On  9-Apr-2007, Daniel J Sebald wrote:

| John W. Eaton wrote:
| | > | How does one get the axis line now? The | > | | > | set (gca, "?axisline?", "on"); | > | | > | sort of thing? E.g., | > | | > | stem([-10:10]); | > | > I think stem should just draw another black line. | | Like what it was doing?

Yes.

| I guess, but what that did was look to the limits of the plot, x_min
| and x_max, and draw a line at the origin between them.  But what
| then if someone changes the limits using set() to make them slightly
| bigger?  Then that line will not run from one end of the plot to the
| other.

I'm willing to live with that bug for now.

|  Using the gnuplot command
| | | + fputs (plot_stream, "set xzeroaxis linetype -1 linewidth 0.5;\nreplot;\n"); | | will automatically adjust the length of the axis line.

Yes, but if we do that, then the properties don't look much like what
Matlab is doing for stem, so this will be a point of incompatibility
that someone will no doubt complain about.

The Matlab docs say that stem returns a "stemseries" object.  The data
appears to be transformed so that a single x-y pair represents all the
stem lines and NaNs are used to indicate where the data skips.  The
data for the lines are stored as children of the stemseries object.
The baseline and basevalue properties of the stemseries object are
used to handle the baseline, with basevalue normally set to 0.  The
baseline property is a handle pointing to the line object for the
baseline.  If the axes are resized after drawning a stem plot,
baseline is magically modified.  I guess this happens when the
stemseries object is drawn.

There seems to be some other magic going on here, as in addition to
the baseline handle, there is another line object representing the
baseline that is a child of the axis object that the stem plot is
drawn in.  Deleting the stemseries baseline handle also appears to
invalidate this handle.

Also, a stemseries object appears to be just an hggroup object.  I
don't know how one tells that it is actually a "stemseries".

Whew!  :-)

The baseline that is a child of the axis seems like what I had in mind, i.e., zero axis line, i.e., something very general that applies to not only stem plots. Does stem allow a baseline other than at y=0? If so, that would explain the extra baseline handle. I'd say, leave out the one that is passed back as a handle and implement the one that is a child of the axis using the gnuplot command. That way, you'd get something that works for both

stem([-10:10])

and

plot([-10:10])

which can be turned on or off.

Dan


reply via email to

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