Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am trying to generate a parametric plot in Mathematica 8 using the following:

pp1=ParametricPlot[{Evaluate[Qin[t]]*10^3,Evaluate[PhiOut[t]]},{t,0,1/f0},AspectRatio->1/1,PlotRange->All,AxesOrigin->{0,0},PlotStyle->Directive[Thickness[Medium],colour]];

This works fine but I was wondering if it is possible to switch the styling of the line from solid to dashed for a certain range of the plotting parameter t e.g. for t>0.5*1/f0. I know that this can be done by generating separate plots and then combining them. This is not very convenient in my case. Is it possible to do this in a single ParametricPlot command?

share|improve this question

migrated from stackoverflow.com Nov 10 '12 at 21:09

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers 2

up vote 7 down vote accepted
 ParametricPlot[{ Cos[t], Sin[t]}, {t, 0, 2 Pi}, 
    PlotStyle -> Directive[Thick, Black], 
     Mesh -> {Range[0, 2 Pi, Pi]}, 
     MeshShading -> {Dashed, {}}]

enter image description here

share|improve this answer
    
Thank you. This is what I was looking for. –  Zots Nov 12 '12 at 1:02
add comment

Use PlotStyle. Here's an example:

ParametricPlot[{{2 Cos[t], 2 Sin[t]}, {2 Cos[t], Sin[t]}, {Cos[t], 2 Sin[t]}, {Cos[t],    Sin[t]}}, {t, 0, 2 Pi}, 
PlotStyle -> {Dashed, Directive[Dashed, Orange],  Directive[Thick, Green],Black}]

enter image description here

share|improve this answer
    
Hi and thanks for your reply. This is not exactly what I am trying to do. Here is a simple example to demonstrate my question: What I am trying to do is the equivalent of this sequence of 3 commands: pp1=ParametricPlot[{Cos[t],Sin[t]},{t,0, Pi},PlotStyle->{Black}]; pp2=ParametricPlot[{Cos[t],Sin[t]},{t,Pi,2 Pi},PlotStyle->{Black,Dashed}]; Show[pp1,pp2,PlotRange->All] but in a single ParametricPlot. –  Zots Nov 9 '12 at 18:44
    
I misunderstood the aim of your question. Unfortunately, I do not know how to solve this without using more than one ParametricPlot. –  David Carraher Nov 9 '12 at 18:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.