1
$\begingroup$

If I have the following data:

lengthscale1SB = {{0, 3.8070469267093143`}, {0, 
    3.6334805550267246`}, {0, 3.5421004645025067`}, {0, 
    3.1777415559882036`}, {0, 3.5382988573632863`}, {0, 
    2.8210206229841543`}};

Which plotted like:

qDSClabel = {"1 K/min", "2 K/min", "5 K/min", "10 K/min", "20 K/min", 
   "30 K/min"};

ListPlot[List /@ lengthscale1SB, Frame -> True, FrameStyle -> 16, 
 Axes -> False, GridLines -> Automatic, 
 GridLinesStyle -> Lighter[Gray, .8], 
 FrameTicks -> {Automatic, Automatic}, 
 FrameLabel -> (Style[#, 20, Bold] & /@ {"y", 
     Row[{"x", " (", " units)"}]}), ImageSize -> Large, 
 LabelStyle -> {Black, Bold, 14}, 
 PlotStyle -> {Red, Blue, Darker[Green], Black, Cyan, Gray}, 
 PlotLegends -> Placed[Defer /@ qDSClabel, {0.1, 0.25}]]

gives:

enter image description here

Questions

How can I put two symbols in the legend? For example, right now it is "circle" 1 K/min, "circle" 2 K/min and so on. So, specifically, how can I put something like "cirle" "triangle" 1 K/min and so on?. Can this be done easily modifying slightly: PlotLegends -> Placed[Defer /@ qDSClabel, {0.1, 0.25}]?

$\endgroup$
1
$\begingroup$
ListPlot[List /@ lengthscale1SB, Frame -> True, FrameStyle -> 16, 
 Axes -> False, GridLines -> Automatic, 
 GridLinesStyle -> Lighter[Gray, .8], 
 FrameTicks -> {Automatic, Automatic}, 
 FrameLabel -> (Style[#, 20, Bold] & /@ {"y", 
     Row[{"x", " (", " units)"}]}), ImageSize -> Large, 
 LabelStyle -> {Black, Bold, 14}, 
 PlotStyle -> {Red, Blue, Darker[Green], Black, Cyan, Gray}, 
 PlotLegends -> Placed[PointLegend[Automatic, Defer /@ qDSClabel, 
    LegendMarkers -> {Row[{"●", "▲"}, Spacer[2]], 12}, 
    LegendMarkerSize -> {30, 20}, Spacings -> {.5, 0}], 
  {0.1, 0.25}]]

enter image description here

$\endgroup$
2
  • $\begingroup$ Thank you kglr. However, I am having a problem: when I use: PlotLegends -> Placed[PointLegend[Automatic, Defer /@ qDSClabel, LegendMarkers -> {Row[{Style["\[FilledCircle]", 12], Style["\[FilledUpTriangle]", 16]}, Spacer[2]], 12}, LegendMarkerSize -> {20, 20}, Spacings -> {.5, 0}], {0.12, 0.25}] (I am using Style to increase size), the symbols get erase as they get bigger. How can I fix this?. In other words, I also want to be able to increase the size without erasing them $\endgroup$ – John Jan 21 at 17:46
  • 1
    $\begingroup$ @John use a larger size, say LegendMarkerSize -> {30, 20}, to prevent clipping of markers. $\endgroup$ – kglr Jan 21 at 17:52

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.