Tag Info

Hot answers tagged

11

This is an intentional change to make PlotLegends -> "Expressions" more consistent with PlotLegends -> Automatic. Both now do not produce legends when only one line is present. What you are looking for is PlotLegends -> "AllExpressions" which has the old behavior, e.g. Plot[x, {x, 0, 1}, PlotLegends -> "AllExpressions"] More generally, ...


6

In version 10 the PointSize of the legend will automatically match the PointSize of the Plot: ListPlot[Table[RandomReal[NormalDistribution[], {20, 2}], {2}], PlotLegends -> {"a", "b"}, PlotStyle -> PointSize[0.02]] Edit: The answer by @eldo made me realize, that this is only true up to a PointSize that is equal to the default ...


4

I was able to isolate the problem with BarLegend in v.10.0.0. Yes, it is clearly a bug. Let us see the how the thin grey lines are implemented: Cases[ ToBoxes[BarLegend[{"DeepSeaColors", {0, 1}}, LegendLayout -> "ReversedColumn"]], _LineBox, Infinity] {LineBox[ NCache[{{-(15/2), 225/2}, {15/2, 225/2}, {15/ 2, -(225/2)}, {-(15/2), ...


2

This is straightforward. All of the legend functions accept the generic, top level arguments, e.g. LineLegend[Automatic] which allows you to modify the behavior. So, you would use BarLegend[Automatic, LabelStyle -> {FontSize -> 20}].


2

My V10 output doesn't agree with Karsten's answer, f.e.: ListPlot[Table[RandomReal[NormalDistribution[], {20, 2}], {2}], PlotLegends -> {"a", "b"}, PlotStyle -> PointSize[0.05]] I tried to fix this by building my own PointLegend: PointLegend[{ Directive[Blue, AbsolutePointSize[20]], Directive[Orange, AbsolutePointSize[20]]}, {"a", "b"}] ...


2

A workaround is to use GeometricTransformation instead of Rotate. By specifying coordinates in the Offset form we can achieve consistent size of markers on the plot and in the legend. The cropping of the markers in the legend can be avoided by increasing their sizes as MinHsuan Peng suggests: ListLinePlot[{Prime~Array~12, Fibonacci~Array~12}, PlotMarkers ...


1

A workaround to question 2 is to increase legend marker size: LineLegend[Automatic, LegendMarkerSize -> {40, 20}]


1

I received an answer to the report I filed with WRI tech support on this issue. I think there might some interest it what it said, so I quote the relevant part: There is some change of behavior for PlotLegends->"Expressions". If you want to generate legends for each function, you can use $\ \ \ \ \ \ $Plot[Sin[x], {x, 0, 2 Pi}, PlotLegends -> ...



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