Tag Info

Hot answers tagged

11

This is not a bug. I think that this is not a bug, see addendum. Based on my (limited!) experience, I believe that LineLegend and PointLegend are in fact the very same thing with differing default options. LineLegend has Joined -> True while PointLegend has Joined -> False by default, but otherwise they are identical. The syntax you used, i.e. ...


9

Somehow the AbsolutThickness you specified gets replaced by a default value of AbsoluteThickness[0.2]. This misbehavior can be corrected by replacing the incorrect value with your specification. Needs["GeneralUtilities`"] PlotLegends; (*preload definitions*) Cell[BoxData[ MakePasteBox@ BarLegend[{"SunsetColors", {0, 1}}, LabelStyle -> ...


4

"Expressions" for legend in ListPlot family is used because of Association. With Association input, the plot will automatically pick up the keys as legends. Here is an example: ListPlot[<|"A"->{1,2,3},"B"->{2,3,4}|>] SetOptions is to set the default values to options but it doesn't guarantee that the settings will be used by the plot since ...


3

In the answer of Karsten 7. the BarLegend is shown as a Cell expression, and since I want to use the legend in an actual plot, it is not immediately useful. However, with the help of his/her answer, I managed to solve my problem. First I make the legend: barLegend = ToExpression[FrameBox@@MakeBoxes[ BarLegend[{"SunsetColors", {0, 1}}, LegendMarkerSize ...


2

$Version "10.2.0 for Mac OS X x86 (64-bit) (July 7, 2015)" dat = Transpose@{Range@40, RandomReal[{.8, 1.2}, 40]*Range@40}; Legended[ ListPlot[dat], Placed[ LineLegend[{Blue}, {Style["I want a line legend!!!", 14]}], {.3, .8}]]


2

I went back to the old legend functions that I used before BarLegend existed, and tried the following: First, copy the definitions of trimPoint, colorLegend, display and at by selecting the large code block in the section Color bar legend. Then do this: display[{ colorLegend[ ColorData["SunsetColors"], {-.5, .5}, LabelStyle -> ...



Only top voted, non community-wiki answers of a minimum length are eligible