Group Abstract Group Abstract

Message Boards Message Boards

0
|
9K Views
|
3 Replies
|
3 Total Likes
View groups...
Share
Share this post:

PlotMarkers option messes up font sizes. How to get v9's default markers?

Posted 12 years ago
POSTED BY: James Stein
3 Replies

You have discovered an error which has already been fixed for a future version. GridLines->{Automatic, None} will remove the horizontal grid lines.

Module[{dates, vals, data, j, f, i, o}, 
 dates = Table[{2012, k, 1}, {k, 12}];
 vals = {1, 2, 3, 4, 5, 6, 6, 5, 4, 3, 2, 1};
 data = Transpose[{dates, vals}];
 j = Joined -> False;
 f = Filling -> Axis;
 i = ImageSize -> {150, 93};
 o = Sequence[data, j, f, i];
 DateListPlot[o, GridLines -> {Automatic, None}, 
  PlotTheme -> "Classic"]]
POSTED BY: Tim Shedelbower
Posted 12 years ago

Thank you, Tim, this is helpful.

However, I observe that when PlotTheme -> "Classic" is used with DateListPlot, horizontal grid lines appear. Reading the documentation for PlotTheme, this surprised me -- once again, ListPlot and DateListPlot seem to behave differently in ways unrelated to the nature of the horizontal axis. It seems they do not share a common code base.

I discovered that PlotTheme -> {"Classic", "Frame"} will use the classic markers and also nix the horizontal grid lines.

Here's code to help folks visualize this:

Module[{dates, vals, data, j, f, i, o},
 dates = Table[{2012, k, 1}, {k, 12}];
 vals = {1, 2, 3, 4, 5, 6, 6, 5, 4, 3, 2, 1};
 data = Transpose[{dates, vals}];
 j = Joined -> False;
 f = Filling -> Axis;
 i = ImageSize -> {150, 93};
 o = Sequence[data, j, f, i];
 Print[
  DateListPlot[o],
  DateListPlot[o, PlotTheme -> "Classic"],
  DateListPlot[o, PlotTheme -> {"Classic", "Frame"}]];
 o = Sequence[vals, j, f, i];
 Print[
  ListPlot[o],
  ListPlot[o, PlotTheme -> "Classic"],
  ListPlot[o, PlotTheme -> {"Classic", "Frame"}]]
 ]

The output:

enter image description here

POSTED BY: James Stein

James,

The point sizes in v10 adjust with the number of points. As the point quantity increases the point size decreases. The font size for "B" is 10 which is the default font size, so "A" and "B" are identical in size. v9 produces the same result except the font family is Times. Below are a few solutions you can try:

Module[{d3}, 
 d3 = {{1, 2, 3, 5, 8}, {2, 3, 6, 9, 10}, {4, 5, 7, 10, 12}};
 ListPlot[d3, 
  PlotMarkers -> {{"•", 20}, {"•", 15}, {"•", 10}}]]

Module[{d3}, 
 d3 = {{1, 2, 3, 5, 8}, {2, 3, 6, 9, 10}, {4, 5, 7, 10, 12}};
 ListPlot[d3, 
  PlotMarkers -> {Style["A", 10], Style["B", 8], Style["C", 6]}]]

Module[{d3}, 
 d3 = {{1, 2, 3, 5, 8}, {2, 3, 6, 9, 10}, {4, 5, 7, 10, 12}};
 ListPlot[d3, PlotTheme -> "PlotMarkers"]]

Module[{d3}, 
 d3 = {{1, 2, 3, 5, 8}, {2, 3, 6, 9, 10}, {4, 5, 7, 10, 12}};
 ListPlot[d3, PlotTheme -> "Classic"]]

The last example using PlotTheme->"Classic" will display v9 default markers.

Tim

POSTED BY: Tim Shedelbower
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard