4
$\begingroup$

I have a plot I wanted to put a marker at the transition (a point at which straight line starts to become little curve) and saturation (curve becomes straight line) points in the graph. I have manually identified the point. I wanted to put the star at transition point, and circle saturation point. And to name the graph as mode 1 with arrow.

    ks1={0.01,1.,2.,4.,6.,8.,10.,25.,50.,100.,200.,300.,400.,500.,600.,800.,1000.,2000.,4000.,5000.,10000.,15000.,20000.,30000.,40000.,70000.,100000.,1.*10^6,1.*10^8,1.*10^12};
    b1={1.8743,1.8784,1.88248,1.89049,1.89828,1.90587,1.91327,1.96335,2.03035,2.12536,2.23701,2.30098,2.34255,2.37175,2.3934,2.42334,2.44307,2.48725,2.51208,2.5173,2.52799,2.53164,2.53348,2.53533,2.53625,2.53745,2.53793,2.53894,2.53909,2.53543};
    markermode1={{0.943,1.87835},{41086.3,2.53793}};
    s1=ListLogLinearPlot[Transpose[{ks1, b1}], Joined -> True, 
 PlotStyle -> {Black, Thickness[0.01]}, AxesStyle -> Black, 
 Epilog -> {Red, AbsolutePointSize[10], Point[markermode1]}]
$\endgroup$
  • 1
    $\begingroup$ do you get what you need if you use markermode1 = {{Log@0.943, 1.87835}, {Log@41086.3, 2.53793}}? $\endgroup$ – kglr Jan 13 at 5:43
  • $\begingroup$ I wanted my marker star symbol I used Style["[SixPointedStar]", 60]. but getting error $\endgroup$ – acoustics Jan 13 at 5:48
4
$\begingroup$
markermode1b = {{Log@0.943, 1.87835}, {Log@41086.3, 2.53793}};
ListLogLinearPlot[Transpose[{ks1, b1}], Joined -> True,
 PlotRangeClipping -> False, 
 PlotStyle -> {Black, Thickness[0.01]}, AxesStyle -> Black, 
 Epilog -> {Red, Text[Style["\[SixPointedStar]", 36], #] & /@ markermode1b}]

enter image description here

Update: "to make the lower one filled with colour and the upper one unfilled with colour"

star = First[First[ImportString[ExportString[
   Style["\[SixPointedStar]", FontSize -> 16], "PDF"], "PDF", "TextMode" -> "Outlines"]]];
emptyhex = Graphics[{EdgeForm[{Thickness[.1], Red}], White, star}, ImageSize -> 20];
filledhex = Graphics[{EdgeForm[], Red, star}, ImageSize -> 20];

ListLogLinearPlot[Transpose[{ks1, b1}], Joined -> True, 
 PlotStyle -> {Black, Thickness[0.01]}, AxesStyle -> Black, 
 Epilog -> {Inset[filledhex, markermode1b[[1]]], 
   Inset[emptyhex, markermode1[[2]]]}, PlotRangeClipping -> False]

enter image description here

Update 2: Alternatively, you can use Mesh combined with a Dynamic setting for PlotMarkers:

hex = {filledhex, emptyhex}; 
ListLogLinearPlot[Transpose[{ks1, b1}], 
 Joined -> True, PlotStyle -> {Black, Thickness[0.01]}, 
 AxesStyle -> Black, PlotRangeClipping -> False, PlotRange -> All, 
 Mesh -> {markermode1[[All, 1]]}, 
 PlotMarkers -> Dynamic[{Last[hex = RotateRight[hex]], .1}]]

enter image description here

$\endgroup$
  • $\begingroup$ How to make the lower one filled with colour and the upper one unfilled with colour? $\endgroup$ – acoustics Jan 13 at 5:59
  • $\begingroup$ @acoustics, please see the update. $\endgroup$ – kglr Jan 13 at 6:54
3
$\begingroup$

Creating a second ListLogLinearPlot solves this problem without having to modify markermode1:

s1 = ListLogLinearPlot[
  Transpose[{ks1, b1}],
  Joined -> True,
  PlotStyle -> {Black, Thickness[0.01]},
  AxesStyle -> Black
  ];

s2 = ListLogLinearPlot[
  markermode1,
  PlotMarkers -> Text[Style["\[SixPointedStar]", 36]],
  PlotStyle -> Red
  ];

Show[s1, s2]

Mathematica graphics

We can also put these together like this:

s1 = ListLogLinearPlot[
  {Transpose[{ks1, b1}], markermode1},
  Joined -> {True, False},
  PlotStyle -> {{Black, Thickness[0.01]}, Red},
  PlotMarkers -> {{Graphics[], 0}, {Text[Style["\[SixPointedStar]", 36]], 1}},
  AxesStyle -> Black
  ]

Mathematica graphics

We can accommodate the filled and unfilled marker types by making one data series for each type. I used the nice markers that kglr created in his answer:

data = Transpose[{ks1, b1}];
filledMarkers = {{0.943, 1.87835}};
unfilledMarkers = {{41086.3, 2.53793}};

s1 = ListLogLinearPlot[
  {data, filledMarkers, unfilledMarkers},
  Joined -> {True, False, False},
  PlotStyle -> {{Black, Thickness[0.01]}, Red, Red},
  PlotMarkers -> {
    {Graphics[], 0},
    {filledhex, 0.1},
    {emptyhex, 0.1}
    },
  AxesStyle -> Black
  ]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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