7
$\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]

enter image description here

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

$\endgroup$
1
  • $\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$
    – ktm
    Jan 29, 2018 at 14:07

3 Answers 3

7
$\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$
3
  • 1
    $\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, 2018 at 18:26
  • 2
    $\begingroup$ In v.12.3, the first solution now uses the word Null as a PlotMarker. $\endgroup$
    – Chris K
    Sep 26, 2021 at 15:11
  • 2
    $\begingroup$ And don't try PlotMarkers -> Nothing unless you want to see some ugly error messages and output! $\endgroup$
    – Chris K
    Sep 26, 2021 at 15:13
7
$\begingroup$

Too easy with PlotStyle:

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

enter image description here

$\endgroup$
4
$\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 and acknowledge you have read our privacy policy.

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