# Questions tagged [legending]

Questions on legends, figures (usually insets) that indicate what those lines/bars/points in plots refer to, using arrangements of graphic elements and text, whether manually or using built-in functions.

735 questions
Filter by
Sorted by
Tagged with
29k views

### Creating legends for plots with multiple lines?

So I have a graph with multiple lists, for e.g. data = {{1,2}, {3,4}, {3,5}, {2,3} . . .} If I then do ...
46k views

### Labeling individual curves in Mathematica

I need to create a plot for export and inclusion in a report. Is there a better way to label curves than PlotLegends? From what I've read and my personal experience,...
13k views

### Sizing cells in a GraphicsGrid/GraphicsRow

I would like to add a colour bar to a plot. I tried to use GraphicsRow for this. In a GraphicsRow, each item is given the same ...
13k views

### ListPlot with each point a different color and a legend bar

I would like to generate a ListPlot with the color for each point in the plot corresponding to a particular value (not associated with the position in the plot). I'...
35k views

### How can I save both the plot and the legend together?

In this example, how can I put the legend inside the graph? Currently, when I save the graph, only the graph is saved, not the legend. ...
13k views

### Logarithmic scale in a DensityPlot and its legend

I was recently faced with the task of creating a DensityPlot with a logarithmic colour scale, and with providing it with an appropriate legend. Since I could not find any resources to this effect on ...
998 views

...
9k views

### ShowLegend values

How do I get ShowLegend to put the max and min values that a plot produces. for example, when using ListDensityPlot, with ...
4k views

### Make legend same height as plot

One common style for density plots is to have a vertical legend that is the same height as the plot itself. Some example density plots from Google Image search: How can we make DensityPlots with ...
9k views

### Using PlotLegends with Show messes up the graphics

I have already obtained the plot that I want but am having trouble legending the graph correctly. ...
7k views

### Setting the default font for PlotLegends

I'm pleased that Mathematica 9 appears to have brought us prettier legends. If I always want the legend in ...
3k views

### How can I change the thickness of tick marks in BarLegend?

Bug introduced in 10.1 or earlier and persisting through 11.0.1 or later This answer explains how to change various undocumented options for BarLegend with ...
30k views

### Formatting legend text font

I am using this code to plot a graph, and I am trying to make the font of the legend bigger. ...
9k views

### Changing the tick labels in a BarLegend

In the following plot, the colors mean the phase, so I need to label the color bar not in integers, but in increments of $\pi$. I searched, but could not find how to change the ticks. Does anyone have ...
1k views

### How can I generate a legend for a BubbleChart?

Is there a way to make a nice disk radius legend (with linear or log scale) for a BubbleChart? Something like the following example should be built in:
4k views

### Changing the inter-item spacing in Legends (version 9 and up)

The legending functionality in versions 9 and higher is much easier to use than the PlotLegends package and other bespoke ways of creating legends in earlier ...
529 views

### PlotLegends won't generate automatically more than 15 labels in v10

Update: NOT fixed in V10.0 - 12.0.0 While testing the examples from this recent post, i've noticed a problem in V.10 with PlotLegends when it has to automatically ...
2k views

### How to raise the LegendLayout "Row" size

When using LegendLayout->"Row", with a lengthy row, I get line breaks. This would seemed logic if it was confined by another structure. But if happens even when ...
24k views

### How to add PlotLegends in a Show function?

I have multiple ListPlot in a Show where i want to add PlotLegends, but adding the PlotLegend...
6k views

### Control BarLegend size

I want to plot a big 2D array of experiment data. I need plot axes and tick labels as well as a bar legend using BarLegend: ...
4k views

### PlotLegends -> "Expressions" not working when Plot given one function

I don't get a legend when I use the option PlotLegends -> "Expressions" when the first argument to Plot is a single function. It works OK when I give ...
9k views

### How can I change the size of the plot markers

I use ListPlot in order to plot four sets of data and also insert legends in my plot. Here is the Mathematica code ...
6k views

### How to add a common color legend to a grid of density plots?

I have a grid of density plots, say something like: GraphicsGrid[Partition[Table[ DensityPlot[Sin[i x] Sin[y/i], {x, -4, 4}, {y, -3, 3}], {i, 1, 4}], 2]] I ...
5k views

### Straightforward way to make a multicolumn line legend?

I have a plot showing 8 curves, and I'm able to define a line legend styled in either a column or a row version. I have the following code: ...
6k views

### Why are PlotLegends not combined with Plots?

I'm using PlotLegends in v9. It seems that in the documentation examples, plots and legends are combined into one graphic: Here's an example from ...
9k views

### Too much whitespace in a GraphicsGrid containing Legended Plots

Where is all the vertical whitespace coming from, and how do I get rid of it? ...
2k views

### Changing the order of elements in a chart legend

In a stacked BarChart or Histogram the bars are stacked from bottom to top, while the legend entries are listed from top to ...
3k views

### How do you plot the same function with different options over different intervals?

Here is the motivation for my question. I want to plot Sin[x] over the interval 0 to 2 π, ...
740 views

### Learning curve for Mathematica

May be some of you (moderators and custodians) would discard this question as opinion-based and requiring discussion, but I didn't want the effort to go to waste so felt compelled to ask. Please feel ...
2k views

### Number format in Legend Labels

I would like to use the usual (new and nice) BarLegend[] with something like BarLegend[{"LakeColors", 1/10000 {-2, 2}}] which ...
1k views

### In version 9 PlotLegends, how can I remove the strange edges that appear around LegendMarkers?

I'm running Mathematica version 9. I am using ListPlot to plot two sets of data. For each data set, I am using different ...
935 views

### How can I get LineLegend to pick up my plot's BaseStyle?

The new legends functionality in version 9 really simplifies creating legends, and it automatically picks up the styles of the lines. ...
992 views

### Vertical (mis-)aligning of plotmarkers and legend text in V10 PlotLegends

Consider this example, taken from the docs and modified for a larger font size using Style (V10.0): ...
1k views

### Changing BarLegend border style

I want all the lines in my plot to be a consistent style, let's say thick and black for the purpose of this question. ...
11k views

### Legend of a plot: how to increase the size of the line/marker?

I'm using the following kind of code to do the legends of my plots: ...
2k views

### How do I change the Font in BarChart Legend?

Just wondering if anyone knows the proper Syntax to change the Text properties in the BarChart's ChartLegend. I cannot seem to figure out how to get Style[] to apply. Here is an example: ...
22k views

### Plot legend inside a Show [duplicate]

Possible Duplicate: Using PlotLegends with Show messes up the graphics I have created a composite plot function: I want to add a legend to it, however ...
4k views

### Set the same color scale across multiple ListContourPlots?

This is probably straightforward - but how would I set the same color scale across multiple ListContourPlots? if I have values from 10 to 25 on one ...
526 views

### BarLegend changes in Version 10

Apparently, BarLegend in version 10 displays tick legends in scientific notation when they are smaller in magnitude than 0.01. For instance, ...
1k views

### PieChart with radial coloring/color function

I am trying to visually compare multiple functions that depend on a single argument running from $0$ to $1$. They describe a radial property and so I thought it would be nice to use a kind of ...
2k views

### Match colors to plot themes

How do I get the colors to match the plot theme when I use a PlotLegend that is separate to the plots? I have had a look at How to access new colour schemes in ...
6k views

### Getting a correct custom legend for contourplot?

I am having trouble making a custom range for a legend in ContourPlot since the legend doesn't "talk" to the PlotRange and ...
2k views

### Adapt ticks in plot and font in legend

Some of my 2-dimensional data are displayed with a code similar to this: ...
4k views

### How to change the spacing of line in legend?

Given this plot: ...
290 views

### Highlight line in plot

I have a plot with many functions. Some of the functions overlap. In Maple, when you plot functions with legends, you can just click on the legend and it highlights the corresponding line. Does ...
431 views

### ArrayPlot gives wrong plot legend, how to fix?

Bug introduced in 10.0 and fixed in 11.2.0.0 My minimal working example is the code ArrayPlot[{{1, 0.1, 0}, {0.1, 0, 0}}, PlotLegends -> Automatic] The plot ...
2k views

### Using PlotLegends with a numeric PointSize

Using PlotLegends with a PlotStyle containing (for instance) PointSize[0.02] creates a ...
542 views

### BarLegend can't make spaced contours when contours number>11

According to Document of BarLegend,BarLegend will select equally spaced contours: BarLegend[cf,contours] generates a legend that identifies color ranges from the color function cf based on the ...