help-octave
[Top][All Lists]
Advanced

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

Multiple plots to the same figure with legend


From: Matthew Reich
Subject: Multiple plots to the same figure with legend
Date: Thu, 11 Jul 2013 17:37:00 -0400 (GMT-04:00)

Hello,

The plot entry in Manual section 15.2.1 states:
“The optional return value h is a graphics handle to the created plot.”
Currently, plot returns a handle to a line objects, conforming to Matlab. Should the manual specify this?

Successive plots into the same figure, that is, successive calls to ‘plot’ with ‘hold(“on”)’, always add items to the same axis object as the first call. Is this behavior reliable?

The ‘legend’ entry in manual section 15.2.3 does not mention that the function returns a handle to the legend axis, also conforming to Matlab. Should the manual specify this?

‘legend’ also conforms to a problematic Matlab behavior; it does not provide a mechanism for adding items to a legend for descendants later added to the plot axis. Calls to ‘legend’ overwrite any existing legend, so to extend a legend the caller must either track the existing legend strings, or reconstruct them. One way to track the strings is to store them as graphics object data, eg setappdata or axis property ‘userdata’. Another way is to read then from the ‘string’ property of the existing legend axis object. This raises two questions:
1. Is ‘string’ property of legend axis objects a reliable and advisable source of previously written legend text?
2. Would an additional standard function that adds new items to an existing legend be a good addition to the ‘plot’ package?


Thanks,
M.Reich

reply via email to

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