The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: LineStyleOrder for plot3 function
Replies: 2   Last Post: Aug 13, 2013 11:47 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 18,038
Registered: 12/7/04
Re: LineStyleOrder for plot3 function
Posted: Aug 6, 2013 12:25 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"OoM " <> wrote in message
> Hi,
> I have a question about how to use LineStyleOrder for plot3
> I have C1 = cell (3,100); C2 = cell (2,100:);
> Then I used
> figure ('Color',[1 1 1]);
> markers = { '+', 'o', '*', '.', 'x', 's', 'd', '^', 'v', '>', '<', 'p',
> 'h'};
> set ( gca(), 'LineStyleOrder', markers, 'NextPlot', 'replacechildren')
> plot3 (C1{:})

I'm assuming you add data into C1 before this line.

> grid on
> box on
> figure ('Color',[1 1 1]);
> markers = { '+', 'o', '*', '.', 'x', 's', 'd', '^', 'v', '>', '<', 'p',
> 'h'};
> set ( gca(), 'LineStyleOrder', markers, 'NextPlot', 'replacechildren')
> plot (C2{:})
> grid on
> I got 2 graphs in 2D. I am doubt why I cannot plot C1 in 3D with
> LineStyleOrder.
> If I only use plot3 (C1{:}), the graph came out fine in 3D.
> Please help. Thank you very much.

The problem has nothing to do with LineStyleOrder. The problem does have to
do with this line of code, though.

> set ( gca(), 'LineStyleOrder', markers, 'NextPlot', 'replacechildren')

"replacechildren ? Remove all child objects, but do not reset axes
properties (equivalent to cla)."

In particular, the properties of the axes that control how the axes is
viewed will not be reset by PLOT3. Since GCA creates an axes in the default
2-D view if one does not already exist, and you've forbidden PLOT3 to
automatically reset that view, your plot "appears" 2-D. But you can change


ax = axes;
set(ax, 'LineStyleOrder', ...


set(gca, 'LineStyleOrder', ...

should work. With NextPlot set to 'replacechildren', plot functions will not
automatically reset properties. But you can still explicitly change those
properties and VIEW is the recommended way to change the properties related
to the axes view.

Steve Lord
To contact Technical Support use the Contact Us link on

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.