Linestyle with plot3

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Linestyle with plot3

Mma Kenya


Hi everyone,

how to change linestyle when using plot3. I am trying to plot a dashed dot line (-----) between two points, it is not working. When I used:

plot3([x1,x2],[y1,y2],[z1,z2],'linewidth',3,'k--'),

only the linewidth and the color change but the linestyle is still solid. Please, would someone explain me how to set changes. I am using GNU octave version 4.0.2. Thanks a lot for advance. All the best !!!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Linestyle with plot3

Pantxo
Mma Kenya wrote
Hi everyone,

how to change linestyle when using plot3. I am trying to plot a dashed dot line (-----) between two points, it is not working. When I used:

plot3([x1,x2],[y1,y2],[z1,z2],'linewidth',3,'k--'),

only the linewidth and the color change but the linestyle is still solid. Please, would someone explain me how to set changes. I am using GNU octave version 4.0.2. Thanks a lot for advance. All the best !!!
Hi,

Like with the "plot" function, the format argument (here "k--") must appear prior to property/value pairs (here "'linewidth', 3"):

 -- plot (X, Y, FMT)
 -- plot (..., PROPERTY, VALUE, ...)  

so

plot3([x1,x2],[y1,y2],[z1,z2],'k--','linewidth',3)

should do the trick.

Pantxo
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Linestyle with plot3

Mma Kenya
Thanks Pantxo !!!
Loading...