Tag Info

Hot answers tagged

15

You can use the individual legends as tick labels: dates = Through[{First, Last}@#] & /@ res; llpd = MapIndexed[Thread@{#, First@#2} &, dates]; legends = MapIndexed[SwatchLegend[{ColorData[{"Rainbow", {1, 7}}][## & @@ #2]}, {#}, LegendMarkerSize -> {{10, 10}}] &, names]; ListLinePlot[llpd, Joined -> True, ...


5

I am continuing to explore this as I can't yet demonstrate exactly what is going on, but first note that ArrayPlot does not experience this problem: tab = Table[Exp[-((i - 25)^2 + (j - 25)^2)], {i, 50}, {j, 50}]; ArrayPlot[500 * tab, PlotLegends -> Automatic, ColorFunction -> "ThermometerColors"] Note that I multiplied the original table by 500 ...


3

You may also supply EdgeForm[] in Graphics[...] to force Mathematica not to draw edges.


2

There is no one-to-one equivalence because font glyphs and Graphics primitives are not rendered the same way. Essentially 22 in {"\[FilledCircle]", 22} is a font size whereas LegendMarkerSize is set as ImageSize which is in screen pixels. The issue then it to scale font size to fill a given pixel width which is a known difficult problem in Mathematica. ...


1

Borrowing from kguler the legends legends = MapIndexed[ SwatchLegend[{ColorData[{"Rainbow", {1, 7}}][## & @@ #2]}, {#}, LegendMarkerSize -> {{10, 10}}] &, names]; p1 = ListLinePlot[par, ColorFunction -> "Rainbow", Ticks -> {Range[1750, 1980, 10], Automatic}, PlotRangePadding -> {{5, 50}, {0, 1}}, GridLines -> ...


1

A graphical comment to Mr. Wizard's answer: SwatchLegend[ 63, Range[3], LegendMarkers -> { Graphics[Disk[]], Graphics[Polygon[{{1, 0}, {0, 1}, {-1, 0}, {0, -1}}]], Graphics[Rectangle[]]}] SwatchLegend[ 63, Range[3], LegendMarkers -> {{"\[FilledCircle]", #}, {"\[FilledDiamond]", #}, \ {"\[FilledSquare]", #}}] & [13.5] ...


1

Here's a workaround for the lazy (and those trying to copy from a Manipulate output): Copy the Legend like you would copy text Edit the plot via Drawing Tools (Right-Click on the plot, then "Drawing Tools") Insert a text frame, paste the Legend and resize and move it as you like Hope this helps.


1

MatrixPlot[Table[Exp[-((i - 25)^2 + (j - 25)^2)], {i, 50}, {j, 50}], PlotLegends -> Automatic, ColorFunction -> "ThermometerColors", ColorFunctionScaling -> False]


1

bl1 = Graphics[{Thickness[0.05], Line[{{0, 25}, {10, 25}}], Text[Style["200 nm", Black, FontSize -> 12], {10/2, 26}]}]; bl2 = BarLegend[{"ThermometerColors", {0, 100}}, LabelStyle -> Directive[Black, FontSize -> 12], LegendLabel -> "D33 content in wt%", LegendMarkerSize -> 300, LegendLayout -> "Row"]; lgnd = Column[{bl1, bl2}, ...



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