Re: question about multiple plotting
- From: helper <spam@xxxxxxxxxx>
- Date: Sat, 6 May 2006 14:45:09 -0400
Paul Mennen wrote:
I have a 18 dim structure called mole.fraction
and a vector called y.
now I just want to plot all 18 curves in one graph.
Sven
Something like this:
x=[1 2 3]'
a(1).b=[1 2 3]'
a(2).b=[0 3 3]'
a(3).b=[5 2 5]'
plot(x,[a(:).b])
The solution above is good, however when cramming 18 curves into
one
graph, a quick way to enable and disable one or more of these
curves
is important (so you can see the trees thru the forest :)
This is one of the reasons I wrote plt. (Just search for "plt" on
the
file exchange). Then just remove the "o" from the plot command
above.
That is:
plt(x,[a(:).b]);
The results will be similar to plot, except that an automatic
legend
will appear. The default legend (in your case) will just be "Line
1",
"Line 2", ... "Line 18" but of course you can use an optional plt
argument to set the legend to more meaningful words.
Now the best part though is that you can just click on any of these
legend items, and that particular trace will toggle. (i.e. off to
on,
or visa versa). There are also shortcut ways to turn all the traces
on, or to turn a single trace on with all the rest off.
If you do try plt, please let me know how it works out - since I
often enhance it based on user feedback.
~Paul
You can get similar functionality in MATLAB by using PLOT then
clicking the "Show Plot Tools" button on the figure toolbar.
.
- References:
- question about multiple plotting
- From: Jerzembeck
- Re: question about multiple plotting
- From: PB
- Re: question about multiple plotting
- From: Paul Mennen
- question about multiple plotting
- Prev by Date: Re: feature request: foreground coloring in 'disp'
- Next by Date: RS coding and M-FSK in simulink
- Previous by thread: Re: question about multiple plotting
- Next by thread: help on plot "waterfall effect"
- Index(es):