Tag Info

Hot answers tagged

13

We may observe that the automatically generated legend limits the number of legend items to the number of available colors in the given color scheme. Using this utility function: plot[scheme_] := Plot[Evaluate[Range[20] + x], {x, -5, 5}, PlotLegends -> "Expressions", PlotStyle -> scheme] Observe the result for indexed color scheme #42 which has ...


8

You have to add the index for the colors to LineLegend Legended[Grid[{{Show[oniplot], Show[cpplot]}}], LineLegend[97, {"factor = 2", "factor = 3", "factor = 4", "factor = 5"}]] In order to have the legend above the plots and with markers: Legended[GraphicsGrid[{{Show[oniplot], Show[cpplot]}}], Placed[LineLegend[97, {"factor = 2", "factor = 3", ...


6

f@x_ := ColorData["VisibleSpectrum"][Rescale[x, {0, 1}, {380, 750}]]; Plot3D[ Exp[-x^2 - y^2], {x, -2, 2}, {y, -2, 2}, ColorFunction -> f, PlotLegends -> BarLegend[{f@# &, {0, 1}}]]


4

Use colors=(("DefaultPlotStyle"/.(Method /. Charting`ResolvePlotTheme["Scientific" , ListLinePlot]))/. Directive[x_,__]:>x) to get the colors used in the "Scientific" plot theme. Then use colors as the first argument of LineLegend: Column[{ Row[{Style["Data from experiment 5B", FontFamily -> "Times", FontSize -> 12]}, Alignment -> ...


3

There's an example exactly like this in the documentation for BoxWhiskerChart. All you need to do is reshape your data into a list of doubles: xdata = {{"A", {1, 2, 5}}, {"B", {5, 7, 2, 2, 5}}, {"C", {3, 2, 5, 7}}}; ydata = {{"A", {7, 2}}, {"B", {7, 2, 5}}, {"C", {6, 7, 3}}}; labels = {xdata[[All, 1]], None} xdata = xdata[[All, 2]]; ydata = ydata[[All, ...


3

Your second solution can be improved by Evaluate[] on the first plot argument. Plot[Evaluate[y /. sol], {x, -10, 10}, PlotLegends -> Automatic]


3

To me it looks like there is a bug in the Implementation of BarLegend. When the the number of contours increases there is not only a switch from discrete contours to a continuous gradient (this behavior is documented), but also a change in the scaling (that's the bug). colorf = Blend[{{0, Red}, {20, Yellow}, {40, Green}}, Round[#, 0.1]] &; ...


2

Blend was modified in version 10. It appears that Blend is now scaled to {0, 1}. colorf = Blend[{{0, Red}, {0.5, Yellow}, {1, Green}}, Round[#, 0.01]] &; BarLegend[{colorf, {0, 30}}]


1

This is not another answer but rather an extension of kguler's correct response. Further issues are also identified. In order to help use kguler's answer I have made a function which may be useful to others. ClearAll[plotColors]; plotColors::usage = "plotColors[plotType,plotTheme] gives a list of the colors used in \ a plot when several curves are ...


1

MatrixPlot[RandomReal[{1, 4}, {10, 10}], PlotLegends -> BarLegend[{ColorData[{"Temperature", {1, 4}}], {1, 4}}], ColorFunction -> (ColorData[{"Temperature", {1, 4}}]), ColorFunctionScaling -> False, DataReversed -> True] Version 9.0.1.0: Version 10.0.1.0 (Wolfram Programming Cloud): Update: PlotLegends -> ...



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