Message Boards Message Boards

0
|
4583 Views
|
2 Replies
|
3 Total Likes
View groups...
Share
Share this post:

[?] Use Epilog in Manipulate?

Posted 5 years ago

Hello,

Epilog with "No Points" in Manipulate are not working as it should be. Does anyone know what's wrong?

data2 = {{1, 10}, {2, 11}, {3, 20}, {4, 30}};
Manipulate[
 ListLinePlot[data2
  , Epilog -> If[points == "No Points", None
    , If[points == "Points", {PointSize[0.04], Red, Point[data2]}]
    ]]
 , {points, {"No Points", "Points"}}
 ]

Thank you in advance !

Regards,....Jos

POSTED BY: Jos Klaps
2 Replies

Dear Rohit Namjoshi,

Thanks for your quick reply and help.

I was not aware that the function "Which" could be used in this type of plot and also that the function "None" could not be used as a graphics primitive.

My plots with over 55,000 raw data are now working perfectly.

Thanks again for your help, this is very much appreciated.

Best Regards,....Jos

POSTED BY: Jos Klaps
Posted 5 years ago

Jos,

None is an option value, it cannot be used as a graphics primitive. Use an empty list instead.

Manipulate[
 ListLinePlot[data2, 
  Epilog -> 
   If[points == "No Points", {}, 
    If[points == "Points", {PointSize[0.04], Red, 
      Point[data2]}]]], {points, {"No Points", "Points"}}]

For this situation, I find it easier to read using Which rather than nested If.

Manipulate[
 ListLinePlot[data2, 
  Epilog -> 
   Which[points == "No Points", {}, 
         points == "Points", {PointSize[0.04], Red, Point[data2]}]], 
 {points, {"No Points", "Points"}}]
POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract