The following approach solves the problem almost exactlyexactly. Small inaccuracy comes from the fact that I use AspectRatio
of the whole graphics instead of the actual aspect ratio of the plotting range with PlotRangePadding
included. But visually it is hardly noticeable. From the other hand, it isn't too difficult to improve this approach for obtaining exact result.
Now define future AspectRatio
of the plot and log-transformedplotting area (the option data1AspectRatio
(thedetermines the actual aspect ratio of the plotting area with PlotRangePadding
included):
aspectRatio = 1./GoldenRatio;
The Graphics
produced by ListLogLinearPlot
contains log-transformed data: it plotted in the usual linear cordinate system (it is just Ticks
what creates the illusion of a logarithmic plotcoordinate system):
aspectRatio = 1./GoldenRatio;
data1Log = {Log@#1, #2} & @@@ data1;
dataRange = MinMax /@ Transpose[data1Log];
This function makes vertical and horizontal scales almost equal in (if necessary one can improve it for obtaining exact result)Graphics
.
Now we can use these coordinates for placing the starsstar glyphs in Epilog
:
ListLogLinearPlot[data1Show[ListLogLinearPlot[data1, Joined -> True,
PlotStyle -> {Black, Thickness[0.01]},
AxesStyle -> Black, PlotRange -> All,
Epilog -> {Red, Translate[Inset[Style["☆", 15, Bold], {0, 0}], pts]},
AspectRatio -> aspectRatio], PlotRange -> dataRange, PlotRangePadding -> Scaled[.05]]
Note however that Mathematica can't guarantee exact positioning for the font glyphs on the plot. ResourceFunction["PolygonMarker"]
guarantees exact positioning of the markers:
Show[ListLogLinearPlot[data1, Joined -> True, PlotStyle -> {Black, Thickness[0.01]},
AxesStyle -> Black, PlotRange -> All,
Epilog -> {FaceForm[], EdgeForm[Red],
ResourceFunction["PolygonMarker"]["FivePointedStar", Offset[5], pts]},
AspectRatio -> aspectRatio], PlotRange -> dataRange, PlotRangePadding -> Scaled[.05]]
UPDATE: I just accidentally found that I knew about this feature of MeshFunctions -> {"ArcLength"}
already several years ago but completely forgot due to non-use of this functionality. I can add to that old post that now we have the wonderful GraphicsInformation
function by Carl Woll which simplifies things considerably.