Skip to main content
fixed wrong statements, now the solution produces exact result
Source Link
Alexey Popkov
  • 62.3k
  • 7
  • 154
  • 375

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]]

plot

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]]

plotplot

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.

The following approach solves the problem almost exactly. 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-transformed data1 (the Graphics produced by ListLogLinearPlot contains log-transformed data: it is just Ticks what creates the illusion of logarithmic plot):

aspectRatio = 1./GoldenRatio;
data1Log = {Log@#1, #2} & @@@ data1;

This function makes vertical and horizontal scales almost equal (if necessary one can improve it for obtaining exact result).

Now we can use these coordinates for placing the stars in Epilog:

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]

plot

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.

The following approach solves the problem exactly.

Now define future AspectRatio of the plotting area (the option AspectRatio determines the actual aspect ratio of the plotting area with PlotRangePadding included):

aspectRatio = 1./GoldenRatio;

The Graphics produced by ListLogLinearPlot contains log-transformed data plotted in the usual linear cordinate system (it is just Ticks what creates the illusion of a logarithmic coordinate system):

data1Log = {Log@#1, #2} & @@@ data1;
dataRange = MinMax /@ Transpose[data1Log];

This function makes vertical and horizontal scales equal in Graphics.

Now we can use these coordinates for placing the star glyphs in Epilog:

Show[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]]

plot

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]]

plot

UPDATE: I just accidentally found that I knew about 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.

added 550 characters in body
Source Link
Alexey Popkov
  • 62.3k
  • 7
  • 154
  • 375

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.


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.

added 15 characters in body
Source Link
Alexey Popkov
  • 62.3k
  • 7
  • 154
  • 375

Now define future AspectRatio of the plot and log-transformed data1 (the Graphics produced by ListLogLinearPlot contains log-transformed data,: it is just Ticks what creates the illusion of logarithmic plot):

aspectRatio = N[11./GoldenRatio];GoldenRatio;
data1Log = {Log@#1, #2} & @@@ data1;

ObtainingExtracting the equidistant points and performing the inverse coordinate transform:

Now define future AspectRatio of the plot and log-transformed data1 (the Graphics produced by ListLogLinearPlot contains log-transformed data, it is just Ticks what creates the illusion of logarithmic plot):

aspectRatio = N[1/GoldenRatio];
data1Log = {Log@#1, #2} & @@@ data1;

Obtaining points and performing the inverse coordinate transform:

Now define future AspectRatio of the plot and log-transformed data1 (the Graphics produced by ListLogLinearPlot contains log-transformed data: it is just Ticks what creates the illusion of logarithmic plot):

aspectRatio = 1./GoldenRatio;
data1Log = {Log@#1, #2} & @@@ data1;

Extracting the equidistant points and performing the inverse coordinate transform:

Source Link
Alexey Popkov
  • 62.3k
  • 7
  • 154
  • 375
Loading