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 making a discrete plot and a regular function plot together. But my curve is so thick that for color-blind people, it's pretty much impossible to see the black dots of my discrete plot:

plot1 = ParametricPlot[{Sin[t], Cos[ t]}, {t, 0, 2 Pi}, 
   PlotStyle -> {Red, Thickness[0.01]}];

plot2 = ListPlot[Table[{Sin[n], Cos[n]}, {n, 50}], 
   PlotRange -> {-1, 1}];

Show[plot1, plot2]

combined plot

I tried adding "thickness" parameter, but it didn't work.

share|improve this question
    
Look up PlotMarkers in the documentation. You can set the size and shape and also use a graphics primitive. See this for more: mathematica.stackexchange.com/q/2214/5 –  rm -rf Oct 4 '12 at 4:38
    
@rm-rf We are starting to answer in comments. This is crazy. We should set up a policy. –  belisarius Oct 4 '12 at 4:48
    
@rm-rf, okay I tried doing ListPlot[Table[{Cos[n], Sin[ n]}, {n, 50}], PlotMarkers -> {Table[{Cos[n], Sin[ n]}, {n, 50}], Large}] but it isn't giving me dots. So I switched to "PlotMarkers -> Automatic" and it worked! But I seem to have no control over the size –  sidht Oct 4 '12 at 4:55
    
@belisarius I just left a hint for some of the newer users to attempt answering (or for OP himself to read up on the docs and answer)... not for Mr.Wizard. –  rm -rf Oct 4 '12 at 5:23
    
@rm-rf :))))))) –  belisarius Oct 4 '12 at 5:41

1 Answer 1

up vote 3 down vote accepted

I recommend using Graphics primitives for this kind of application, which gives you direct (and usually easier) control of appearance. As a bonus performance is usually better as well.

For simple applications such as this, if you don't also need the plots separately, you can use Epilog in ParametricPlot to insert these primitives:

ParametricPlot[{Sin[t], Cos[t]}, {t, 0, 2 Pi}, 
  PlotStyle -> {Red, Thickness[0.01]}, 
  Epilog -> {PointSize[Large], Point@Table[{Sin[n], Cos[n]}, {n, 50}]}
]

Mathematica graphics

See documentation for PointSize and AbsolutePointSize for complete control of point size.

If you need the plots separately you can do that too, like this:

p1 = ParametricPlot[{Sin[t], Cos[t]}, {t, 0, 2 Pi}, 
       PlotStyle -> {Red, Thickness[0.01]}
     ];

p2 = Graphics[
       {PointSize[Large], Point @ Table[{Sin[n], Cos[n]}, {n, 50}]},
       PlotRange -> {-1, 1}
     ];

Show[p1, p2]

In a comment J. M. reminds us that this form for p2 also works:

p2 = ListPlot[Table[{Sin[n], Cos[n]}, {n, 50}], PlotStyle -> {Black, PointSize[Large]}];

My recommendation to use graphics primitives is so that more complicated styles are within reach and so that code may be shared between Graphics and Epilog. Perhaps I am complicating things for such a simple operation and you would prefer that.

share|improve this answer
    
That's interesting. I just opened up the Epilog page on Mathematica. I have no idea what it says nor do I think the command explanation tells me anyway that it plots dots for me. –  sidht Oct 4 '12 at 4:58
    
@jak You must understand Graphics, PointSize, and Point as well. Epilog allows you to overlay primitives such as Point on top of the result of ParametricPlot. See this documentation and ask for clarifications where you have trouble. –  Mr.Wizard Oct 4 '12 at 5:01
    
Yeah I definitely will. Thank you –  sidht Oct 4 '12 at 5:04
    
@jak, thanks for Accepting my answer (green check-mark), but please consider waiting 24 hours. This gives other people a chance to answer before the topic appears concluded. –  Mr.Wizard Oct 4 '12 at 5:07
1  
I prefer the Epilog route, but for the second method, having p2 = ListPlot[Table[{Sin[n], Cos[n]}, {n, 50}], PlotStyle -> PointSize[Large]] works just as well. –  J. M. Oct 4 '12 at 9:39

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.