TransWikia.com

Epilog isn't working

Mathematica Asked on October 24, 2020

I’m trying to put an arrow to denote a point on a Plot

ListPlot[{Transpose[{temp1, lum1}], Transpose[{temp2, lum2}], 
  Transpose[{temp3, lum3}], Transpose[{temp4, lum4}]}, 
 PlotStyle -> {Hue[First@#2/12], Hue[First@#2/15], Hue[First@#2/18], 
   Hue[First@#2/21]}, 
 Epilog -> {Arrow[{{4.2, 3.6}, {4.4, 3.6}}], 
   Text["text", {4.4, 3.6}, {4.4, 4}]}, 
 ScalingFunctions -> {"Reverse", Identity}, PlotRange -> Full, 
 PlotTheme -> "Detailed", 
 FrameTicksStyle -> Directive[FontSize -> 22], 
 PlotStyle -> {Automatic, Green}, AxesLabel -> Automatic, 
 Frame -> True, 
 FrameLabel -> {Style["Temperatura Log T [K]", FontSize -> 22, Bold], 
   Style["Luminosidad Log L [!(*SubscriptBox[(L), (sol)])]", 
    FontSize -> 22, Bold]}, ImageSize -> Large]

but Epilog seems to not be working properly. The output is

enter image description here

while I’d expect to see an arrow pointing to the yellow point at (4.4,3.6)

One Answer

SeedRandom[1]
data = RandomReal[{3.5, 4.4}, {100, 2}];

ListPlot[data, Frame -> True, 
 ScalingFunctions -> {"Reverse", Identity},
 PlotRangeClipping -> False, 
 Epilog -> {Arrow[{{-4.2, 3.6}, {-4.4, 3.6}}], 
   Text[Style["text", FontSize -> Scaled[.05]], {-4.4, 3.6}, {Left, Bottom}]}]

enter image description here

Text[Style["text", FontSize -> Scaled[.05]], {-4.4, 3.6}, {-1, -1}] gives the same picture.

You can also use Offset[{xprinterpoints, yprinterpoints}, {xpos,ypos}] in the second argument of Text to specify the position. Using

  Text[Style["text", FontSize -> Scaled[.05]], Offset[{15, 5}, {-4.4, 3.6}], {-1, - 1}]

above, we get

enter image description here

Using

Text[Style["text", FontSize -> Scaled[.05]], Offset[{15, -5}, {-4.4, 3.6}], {-1, 1}]

gives

enter image description here

and

Text[Style["text", FontSize -> Scaled[.05]], Offset[{-25, 0}, {-4.4, 3.6}], {-1, -1}]

gives

enter image description here

Correct answer by kglr on October 24, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP