8

I have large data consisting of values obtained by sweeping across three parameters (e, w, and f). I want to plot all this data on one graph using different shapes for e (e.g., circle, triangle, square, and diamond), different colors for w, and a letter inside the shape for f. So far I have

Jw1e1 = {{16, 832}, {32, 3150}, {64, 12237}, {128, 48212}};
J1 = ListLogPlot[Jw1e1, PlotMarkers -> (Style[Framed[H], Red]), 
  Frame -> True]
Jw1e3 = {{16, 826}, {32, 3127}, {64, 12145}, {128, 47851}};
J3 = ListLogPlot[Jw1e1, PlotMarkers -> (Style[Framed[H], Blue]), 
  Frame -> True]
Show[J1, J3]

I cannot figure out how have a square, circle, etc. appear as the specified shape by changing Framed[H]. If I replace Framed[H] by Circle[], Circle[{0, 0}] appears on my plots and replacing by Circle[H], Circle[H] appears.

cormullion
  • 24,243
  • 4
  • 64
  • 133
namu
  • 83
  • 3

2 Answers2

10

Update: Using some of the ideas in the linked Q/As, you can get a finer customization of your markers:

Jw1e1 = {{16, 832}, {32, 3150}, {64, 12237}, {128, 48212}};
Jw1e3 = {{16, 826}, {32, 3127}, {64, 12145}, {128, 47851}};
(* second list modified so that the two plots do not overlap*)
lists = {Jw1e1, {1, .1} # & /@ Jw1e3} ;
markerDisk = Graphics[{Opacity[.6],
 Dynamic@EdgeForm[{clr = CurrentValue["Color"], Thick}],
 Dynamic[FaceForm[{Opacity[1], Lighter[clr, .3]}]], Disk[], Opacity[1],
 Style[Text[#], White, Bold, 16]}, ImagePadding -> Scaled[.01]] &;

ListLogPlot[lists, Joined -> True, ImageSize -> 500,
 PlotRangeClipping -> False, ImagePadding -> 35,
 PlotMarkers :> ({markerDisk[#], 0.15} & /@ {A, B})]]

enter image description here


From Docs > PlotMarkers > Details:

enter image description here

mrkr = Graphics[{Red, Thick, Circle[], Style[Text[H], Red, Bold, 24]}]; 
ListLogPlot[Jw1e1, PlotMarkers -> {mrkr, .2}, Frame -> True]

enter image description here

Related Q/As

Why doesn' t PlotMarker option None return no PlotMarkers?

ListPlot with plotmarkers determined by point

kglr
  • 394,356
  • 18
  • 477
  • 896
  • Quick question. Why does the command markerDisk2 = Graphics[{Opacity[.5], Dynamic@EdgeForm[{clr = CurrentValue["Color"], Thick}], Dynamic[FaceForm@Lighter@clr], Rectangle[], Opacity[1], Style[Text[A], Black, Bold, 18]}, ImagePadding -> Scaled[.2]] &; ListLogPlot[Je1w1H, Joined -> True, ImageSize -> 500, PlotRangeClipping -> False, ImagePadding -> 35, PlotMarkers :> ({markerDisk2[#], 0.15} & /@ {A, B})] have the letters offset from the Rectangle? – namu Feb 03 '13 at 06:40
6

You were nearly there:

Jw1e1 = {{16, 832}, {32, 3150}, {64, 12237}, {128, 48212}};

J1 = ListLogPlot[Jw1e1, 

  PlotMarkers -> (Style[Framed[H, RoundingRadius -> 20], Red]), 

  Frame -> True]

The nice thing here is that you can play around with RoundingRadius and that longer/larger text markers will be properly framed as well.

J1 = ListLogPlot[Jw1e1, 

  PlotMarkers -> (Style[

     Framed["Longer than strictly necessary", RoundingRadius -> 20], 

     Red]), Frame -> True]

Driving it home:

J1 = ListLogPlot[Jw1e1, 

  PlotMarkers -> 

   Framed[Style["Larger than \n strictly necessary", Large, Red], 

    RoundingRadius -> 20], Frame -> True]

Mathematica graphics

Yves Klett
  • 15,383
  • 5
  • 57
  • 124