josklaps1
(Jos Klaps)
March 19, 2019, 1:28am
1
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
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"}}]
josklaps1
(Jos Klaps)
March 19, 2019, 11:23pm
3
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