2
$\begingroup$

I have the following data:

dataEnnn0 = {6.4*10^6, 5.4*10^6, 9*10^6, 6*10^6, 10*10^6, 10*10^6, 20*10^6, 10*10^6};

dataEnnn24 = {2.3*10^6, 1.1*10^6, 3.5*10^6, 1*10^6, 1*10^6, 3*10^6};

To plot the data, I found the following code in the website:

xvals = {0, 24};

datannn = {#, 
 Around @@ 
  Through[{Mean, StandardDeviation}@
    Symbol["dataEnnn" <> ToString@#]]} & /@ xvals;

ListPlot[datannn, PlotRangeClipping -> False, 
PlotRangePadding -> {{0, Scaled[0.1]}, {0, Scaled[0.1]}}, 
BaseStyle -> AbsoluteThickness[3], AxesOrigin -> {0, 0}, 
Ticks -> {xvals, Automatic}, 
AxesLabel -> {Style["Time (h)", FontSize -> 16, 
FontFamily -> "Latin Modern Roman 10"], 
Style[Row[{"LOP"}], FontSize -> 16, 
FontFamily -> "Latin Modern Roman 10"]}, 
AxesStyle -> Arrowheads[Medium], 
LabelStyle -> {FontFamily -> "Latin Modern Math", 16, GrayLevel[0]}, 
ImageSize -> Large, 
PlotLegends -> 
Placed[{Style["Death", FontSize -> 16, 
FontFamily -> "Latin Modern Roman 10" ]}, Right], Mesh -> All, 
PlotStyle -> RGBColor[0.922526, 0.385626, 0.209179], 
Epilog -> {AbsoluteThickness[5], Arrowheads[0.05], 
Arrow[{{18, 200}, {18, 800}}], 
Text[Style["The highest number of crimes?", FontSize -> 12, 
 FontFamily -> "Latin Modern Roman 10"], {12, 600}]}]

which gives:

enter image description here

I have two questions:

  1. How can one push the arrow and the text in the Epilog further in order they become more visible? Something like the arrow and text in this post: Adding text and arrow to the result of a plot

  2. Does anyone have other suggestions for presenting the ticks on the y axis better?

$\endgroup$

1 Answer 1

1
$\begingroup$

Something like:

yvals = {# 10^7, #} & /@ {0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4};
    
ListPlot[datannn, PlotRangeClipping -> False, 
 PlotRangePadding -> {{0, Scaled[0.1]}, {0, Scaled[0.1]}}, 
 BaseStyle -> AbsoluteThickness[3], AxesOrigin -> {0, 0}, 
 Ticks -> {xvals, yvals}, 
 AxesLabel -> {Style["Time (h)", FontSize -> 16, 
    FontFamily -> "Latin Modern Roman 10"], 
   Style[Row[{"LOP/10^7"}], FontSize -> 16, 
    FontFamily -> "Latin Modern Roman 10"]}, 
 AxesStyle -> Arrowheads[Medium], 
 LabelStyle -> {FontFamily -> "Latin Modern Math", 16, GrayLevel[0]}, 
 ImageSize -> Large, 
 PlotLegends -> 
  Placed[{Style["Death", FontSize -> 16, 
     FontFamily -> "Latin Modern Roman 10"]}, Right], Mesh -> All, 
 PlotStyle -> RGBColor[0.922526, 0.385626, 0.209179], 
 Epilog -> {AbsoluteThickness[5], Arrowheads[0.05], 
   Arrow[{{18, 600}, {18, 200}}], 
   Text[Style["The highest number of crimes?", FontSize -> 12, 
     FontFamily -> "Latin Modern Roman 10"], Scaled[{0.65, -0.04}]]}]

enter image description here

Addendum

I hope I understand "pull up" correctly:

ListPlot[datannn, PlotRangeClipping -> False, 
 PlotRangePadding -> {{0, Scaled[0.1]}, {0, Scaled[0.1]}}, 
 BaseStyle -> AbsoluteThickness[3], AxesOrigin -> {0, 0}, 
 Ticks -> {xvals, yvals}, 
 AxesLabel -> {Style["Time (h)", FontSize -> 16, 
    FontFamily -> "Latin Modern Roman 10"], 
   Style[Row[{"LOP/10^7"}], FontSize -> 16, 
    FontFamily -> "Latin Modern Roman 10"]}, 
 AxesStyle -> Arrowheads[Medium], 
 LabelStyle -> {FontFamily -> "Latin Modern Math", 16, GrayLevel[0]}, 
 ImageSize -> Large, 
 PlotLegends -> 
  Placed[{Style["Death", FontSize -> 16, 
     FontFamily -> "Latin Modern Roman 10"]}, Right], Mesh -> All, 
 PlotStyle -> RGBColor[0.922526, 0.385626, 0.209179], 
 Epilog -> {AbsoluteThickness[5], Arrowheads[0.05], 
   Arrow[{{18, 0.2 10^7}, {18, 0.6 10^7}}], 
   Text[Style["The highest number of crimes?", FontSize -> 12, 
     FontFamily -> "Latin Modern Roman 10"], Scaled[{0.65, 0.1}]]}]

enter image description here

$\endgroup$
0

Your Answer

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