2
$\begingroup$

I have a graph that looks like this:

enter image description here

I need to have it labeled so that 14 appears in the lower left (I know it's obvious but that's what the publication I'm working with wants). That makes the origin of the graph clearer.

Is it possible to force '14' to appear in the lower left corner, and then keep the rest of the graph as is? I've been playing around with Ticks (a la adding the Ticks->{{0.05,14},{0.10,14}} flag manually, which seems to break as well.

Here's my code:

le={{14., 0.195652}, {15., 0.108434}, {16., 0.115108}, {17., 
  0.119565}, {18., 0.149091}, {19., 0.148855}, {20., 0.163498}, {21., 
  0.155303}, {22., 0.20922}, {23., 0.145522}, {24., 0.16129}, {25., 
  0.146617}, {26., 0.180812}, {27., 0.177536}, {28., 0.163636}, {29., 
  0.170455}, {30., 0.161172}, {31., 0.183099}, {32., 0.180272}, {33., 
  0.125}, {34., 0.126246}, {35., 0.0885246}, {36., 0.0771704}, {37., 
  0.0766773}, {38., 0.0711974}, {39., 0.0730897}, {40., 0.09}}

ListPlot[le, PlotTheme -> "Monochrome", Joined -> True, 
 Filling -> Bottom, AspectRatio -> 0.3, PlotRange -> All, 
 AxesLabel -> Automatic]

Apologizes if I'm missing something crushingly obvious.

Again, ideally the graph would look the same with the addition of '14' under the first datapoint in the lower left corner of the graph.

$\endgroup$
0

2 Answers 2

4
$\begingroup$
Join[{{14, 14}}, Table[If[Mod[k, 5] == 0, {k, k}, {k, ""}], {k, 15, 40}]]
{{14, 14}, {15, 15}, {16, ""}, {17, ""}, {18, ""}, {19, ""}, {20, 20}, {21, ""}, {22, ""}, {23, ""}, {24, ""}, {25, 25}, {26, ""}, {27, ""}, {28, ""}, {29, ""}, {30, 30}, {31, ""}, {32, ""}, {33, ""}, {34, ""}, {35, 35}, {36, ""}, {37, ""}, {38, ""}, {39, ""}, {40, 40}}
ListPlot[le
 , PlotTheme -> "Monochrome"
 , Joined -> True
 , Filling -> Bottom
 , AspectRatio -> 0.3
 , PlotRange -> {{13, All}, All}
 , AxesLabel -> Automatic
 , Ticks -> {
  Join[{{14, 14}}, Table[If[Mod[k, 5] == 0, {k, k}, {k, ""}], {k, 15, 40}]],
  Automatic
  }
 ]

enter image description here

$\endgroup$
0
3
$\begingroup$

@kguler gave other solutions in a recent post.

In particular there is an elegant one using the function AbsoluteOptions.

However it won't work for you in version 10 as AbsoluteOptions has been reported broken.

So, for Mathematica versions < 10 :

(PlotTheme option was introduced in v.10 but the "Monochrome" effect can be reproduced with PlotMarkers, PlotStyle, FillingAxis)

g = ListPlot[le, Joined -> True, Filling -> Bottom, AspectRatio -> 0.3,
 PlotRange -> {{13.5, Automatic}, Automatic}, AxesLabel -> Automatic,
 PlotMarkers -> Automatic, PlotStyle -> Black, FillingStyle -> GrayLevel[0.8]];    

then

Show[g, Ticks -> {Join[First[Ticks /. AbsoluteOptions[g]], {{14, 14.}}], Automatic}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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