Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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 Nov 10 '12 at 21:09

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

up vote 8 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

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. – DavidC Nov 9 '12 at 18:53

Your Answer


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.