0
$\begingroup$

How do I control the Frame Tick Style on all axes using Plot?

I am seeking to control the Frame Tick style in two similar graphs, but I am getting different results from ListPlot vs from Plot.

This code gives a plot with the specified format on all four axes:

ListPlot[{1, 2, 3, 10}, PlotMarkers -> {{\[FilledUpTriangle], 20}}, 
 PlotRange -> {{0, 30}, {0, 4000}},
 Frame -> True,
 FrameTicks -> {{Automatic, Automatic}, {Automatic, Automatic}},
 FrameStyle -> {{Thickness[0.003], Black}, {Thickness[0.003], Black}},
 FrameTicksStyle -> {{{Thickness[0.003], Black}, {Thickness[0.003], Black}}, 
                     {{Thickness[0.003], Black}, {Thickness[0.003], Black}}},
 LabelStyle -> {FontFamily -> "Helvetica", FontSize -> 16, FontWeight -> Bold, Black},
 BaseStyle -> {FontWeight -> "Bold", Black, FontSize -> 16, FontFamily -> "Helvetica"}
]

This nearly identical code gives a plot with the desired ticks on the left and bottom axes, but default ticks on the other two:

Plot[{M}, {M, 15, 35}, PlotRange -> {0, 200},
 Frame -> True,
 FrameTicks -> {{Automatic, Automatic}, {Automatic, Automatic}},
 FrameStyle -> {{Thickness[0.003], Black}, {Thickness[0.003], Black}},
 FrameTicksStyle -> {{{Thickness[0.003], Black}, {Thickness[0.003], Black}},
                     {{Thickness[0.003], Black}, {Thickness[0.003], Black}}},
 LabelStyle -> {FontFamily -> "Helvetica", FontSize -> 16, FontWeight -> Bold, Black},
 BaseStyle -> {FontWeight -> "Bold", Black, FontSize -> 16, FontFamily -> "Helvetica"}
]
$\endgroup$
  • 1
    $\begingroup$ I am not sure that I understand the problem. This is what I see when I execute your code: capture, where the top is ListPlot and the bottom is from Plot. The styles look very similar to me. Perhaps you should include your own output and point out the differences in detail. I am on MMA v. 11.2, Win7-64. $\endgroup$ – MarcoB May 30 '18 at 1:17
1
$\begingroup$

As far as I can tell the only reason you see a difference is because your plot ranges disagree. If you make them the same there will be no difference.

ListPlot[Transpose[{Subdivide[2, 28, 10], Subdivide[2, 38, 10]}],
  PlotMarkers -> {{\[FilledUpTriangle], 20}},
  PlotRange -> {{0, 30}, {0, 40}},
  Frame -> True,
  FrameStyle -> {{Thickness[0.003], Black}, {Thickness[0.003], Black}},
  FrameTicksStyle -> 
    {{{Thickness[0.003], Black}, {Thickness[0.003], Black}}, 
     {{Thickness[0.003], Black}, {Thickness[0.003], Black}}},
  LabelStyle -> 
    {FontFamily -> "Helvetica", FontSize -> 16, FontWeight -> Bold, Black}, 
 BaseStyle -> 
   {FontWeight -> "Bold", Black, FontSize -> 16, FontFamily -> "Helvetica"}]

list_plot

Plot[{4 M/3}, {M, 0, 30},
  PlotRange -> {{0, 30}, {.0, 40}},
  Frame -> True,
  FrameStyle -> {{Thickness[0.003], Black}, {Thickness[0.003], Black}}, 
  FrameTicksStyle -> 
    {{{Thickness[0.003], Black}, {Thickness[0.003], Black}}, 
     {{Thickness[0.003], Black}, {Thickness[0.003], Black}}},
  LabelStyle -> 
    {FontFamily -> "Helvetica", FontSize -> 16, FontWeight -> Bold, Black}, 
 BaseStyle -> 
   {FontWeight -> "Bold", Black, FontSize -> 16, FontFamily -> "Helvetica"}]

line_plot

$\endgroup$
  • $\begingroup$ Here is what I get $\endgroup$ – Paul Drake May 31 '18 at 3:49

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