3

Possible Duplicate:
Why does ListPlot ignore some global options?

Using this data:

curve = {{0.833, 0.1}, {0.25, 0.08}, {0.5, 0.15}, {1, 0.2}, {2, 
0.3}, {3, 0.45}, {5, 0.75}, {7, 1.25}, {10, 1.85}, {20, 
2.55}, {30, 3}};  

ListPlot with options set inside show plot markers:

Mathematica graphics

But if I put the exact same options in SetOptions, like this:

SetOptions[ListPlot, ImageSize->300, Frame->True, Joined->True, PlotMarkers->Automatic,
AxesOrigin->{0.5,0}, PlotRange->All, GridLines->Automatic, GridLinesStyle->LightGray,
FrameLabel->{"Years","Yield (%)","Treasury Yield Curve on Oct 17, 2012"},
LabelStyle->{11, FontFamily -> "Arial"}];  

The plot markers disappear. I perfer to keep the (relatively unimportant) options out of posts here, showing only the data, plot function, and results. This annoyance thwarts me.

George Wolfe
  • 5,462
  • 21
  • 43
  • 1
    It seems to work with ListLinePlot and corresponding options (minus the Joined part). – b.gates.you.know.what Oct 21 '12 at 17:43
  • 1
    I guess that would do the trick for my purpose, and I'll use it. But it should work with ListPlot. – George Wolfe Oct 21 '12 at 18:02
  • I agree, hopefully you'll get a better answer. – b.gates.you.know.what Oct 21 '12 at 18:21
  • Looks buggy, right? Seems when neither PlotRange or AxesOrigin aren't in Automatic it forgets to check PlotMarkers in the defaults? Blergh – Rojo Oct 21 '12 at 21:06
  • This kind of thing has come up before. I expect to close this question as a duplicate soon, but for now I believe the standard work-around is ListPlot[curve, Options@ListPlot] – Mr.Wizard Oct 21 '12 at 21:08
  • Yeah, alternatively, you could set the PlotRange or AxesOrigin options in some creepy way like DisplayFunction -> ($DisplayFunction@Show[#, AxesOrigin -> {0.5, 0}, DisplayFunction -> Identity] &) and leave the "real" option as Automatic – Rojo Oct 21 '12 at 21:11

0 Answers0