2
$\begingroup$

I want to Plot a fancy graph, but I found a strange behaivor using PlotRange and AxesStyle. When I Plot my graph with PlotRange -> {{-0.39, 3.5}, {4.5, 10.5}} the AxesStyle works, when I try with a number less than -0.39 the AxesStyle don't work.

f[x_, ITERATIONS_] := Sum[j*Exp[x*j], {j, 0, ITERATIONS}]/
  Sum[Exp[x*j], {j, 0, ITERATIONS}];

Plot[
 {Style[f[x, 10], Black, Thickness[0.002]], 
  Style[10, Dashed, Black, Thickness[0.001]]},
 {x, 0, 3.5},
 PlotTheme -> "Scientific",
 Axes -> True,
 AxesStyle -> Directive[Thickness[0.001]],
 FrameStyle -> Directive[ FontSize -> 18, Black, Thickness[0.002]],
 ImageSize -> Large,
 AspectRatio -> 1/2,
 FrameLabel -> {Style[
    "x (= \[CurlyEpsilon] / \!\(\*SubscriptBox[\(k\), \(B\)]\)T)", 
    Black, FontSize -> 18], 
   Style["\[LeftAngleBracket]j\[RightAngleBracket]", Black, 
    FontSize -> 18]},
 PlotRange -> {{-0.4, 3.5}, {4.5, 10.5}}, (* Here is the problem. *)
 FrameTicks -> {{{ {10 /2, 
      Style[N /2, SingleLetterItalics -> False]}, {10, 
      Style[N, SingleLetterItalics -> False]}}, None},  {{0}, None}}
 ]

-0.39:

enter image description here

-0.38:

enter image description here

I want to Plot this graph with a PlotRange -> {{-0.1, 3.5}, {4.5, 10.5}}, how can I do it?

$\endgroup$

1 Answer 1

2
$\begingroup$

A work-around: You can use GridLines and GridLinesStyle instead of Axes -> True and AxesStyle:

Plot[{Style[f[x, 10], Black, Thickness[0.002]], 
  Style[10, Dashed, Black, Thickness[0.001]]}, {x, 0, 3.5}, 
 GridLines -> {{0}, {}}, PlotTheme -> "Scientific", 
 GridLinesStyle -> Directive[Thickness[0.001]], 
 FrameStyle -> Directive[FontSize -> 18, Black, Thickness[0.002]], 
 ImageSize -> Large, AspectRatio -> 1/2, 
 FrameLabel -> {Style["x (= ε / \!\(\*SubscriptBox[\(k\), \(B\)]\)T)", 
    Black, FontSize -> 18], 
   Style["〈j〉", Black, FontSize -> 18]}, 
 PlotRange -> {{-0.1, 3.5}, {4.5, 10.5}}, 
 FrameTicks -> {{{{10/2, Style[N/2, SingleLetterItalics -> False]}, 
     {10, Style[N, SingleLetterItalics -> False]}}, None}, {{0}, None}}]

enter image description here

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