3
$\begingroup$

I'd like a pin plot with no pinheads (i.e., no plot markers). While there are other ways to get the effect I want, I expected the following to work:

ListPlot[{1, 2, 3}, Filling -> Axis, PlotMarkers -> None]

But the result still includes (smaller) plot markers. How does one turn off the plot markers?

$\endgroup$
  • $\begingroup$ I agree that what you tried should work. In the meantime, there are plenty of ways to workaround this, one might be ListPlot[{1, 2, 3}, Filling -> Axis, PlotMarkers -> {Graphics[Opacity[0]]}] $\endgroup$ – user6014 Jan 29 '18 at 14:07
4
$\begingroup$

Some simple ways to do it.

ListPlot[{1, 2, 3}, Filling -> Axis, PlotMarkers -> Null]

ListPlot[{1, 2, 3}, Filling -> Axis, PlotMarkers -> ""]

ListPlot[{1, 2, 3}, Filling -> Axis, PlotMarkers -> Graphics[]]

All three give

plot

$\endgroup$
  • $\begingroup$ As I noted in the question, there are many workarounds. The latter two set PlotMarkers to something innocuous but do not actually turn them off. But your first suggestion roughly answers my question, but I'm not quite sure what it means to set PlotMarkers->Null. It looks like Mma creates an inset with a Null in it so that nothing gets printed? And, why doesn't PlotMarkers->None just turn off the whole mechanism? (Bug or feature?) $\endgroup$ – Alan Jan 29 '18 at 18:26
4
$\begingroup$

Too easy with PlotStyle:

ListPlot[Prime[Range[25]], Filling -> Axis, PlotStyle -> None]

enter image description here

$\endgroup$
2
$\begingroup$
ListPlot[{1, 2, 3}, Filling -> Axis, PlotStyle -> Opacity[0]]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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