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.

Filter by
Sorted by
Tagged with
68
votes
5answers
26k 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 ...
42
votes
5answers
12k 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'...
33
votes
3answers
8k 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 ...
59
votes
9answers
41k 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,...
44
votes
7answers
11k 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 ...
32
votes
3answers
28k 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. ...
12
votes
3answers
1k 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 ...
34
votes
2answers
10k 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 ...
27
votes
7answers
8k 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. ...
29
votes
7answers
3k 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 ...
7
votes
4answers
7k views

How can I label a ListDensityPlot with a color bar?

Here is an example of what is desired, only the result wouldn't be a contour plot, but a ListDensityPlot. The arguments would be a gradient and a list of numbers.
15
votes
1answer
401 views

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

Update: NOT fixed in v 10.1.0 (Mar2015) While testing the examples from this recent post, i've noticed a problem in V.10 with PlotLegends when it has to ...
14
votes
5answers
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 ...
16
votes
2answers
1k 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 ...
9
votes
5answers
17k 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...
4
votes
1answer
667 views

Customizing a graph (Dashing, PlotMarkers, Labeled)

There are actually several questions here but I thought they are closely related so I should not split into several posts. Here we go... I have the following list ...
11
votes
4answers
387 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 ...
8
votes
1answer
537 views

Problem with custom ticks in BarLegend in Mathematica 11.1

Bug introduced in 11.1 and persisting through 11.2.0 I think the bar legend custom ticks are automatically sorted in Mathematica 11.1. Am I making some stupid mistake here or is it a bug? This is ...
4
votes
3answers
546 views

Bar legend coloring doesn't correspond to array plot coloring in the expected way

Execute this code: ...
9
votes
2answers
5k views

Legends in combined Plot and ListPlot

I have a set of data ...
8
votes
2answers
1k views

In LineLegend, how do I force the legend entries to appear in a single column?

I want to create a single column LineLegend with at least 12 different entries. Suppose that I define lists colors and ...
11
votes
1answer
3k views

How to position legends exactly where I want them?

I just noticed another plot legend question today and while user solutions to this, in particular code by @Jens, are IMO better than the built in solutions, exact positioning often still requires some ...
21
votes
4answers
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 ...
6
votes
2answers
1k views

Single Legend for a Table of Plots

For this toy problem ...
19
votes
5answers
2k 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 ...
13
votes
2answers
840 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. ...
7
votes
1answer
1k views

How to add own description to BarLegend?

Is there a default-option possibility to add own defined names of the contour-labels in BarLegend? I want to have a string "hot" ...
16
votes
2answers
3k 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 ...
2
votes
3answers
3k views

How to color a contour plot over a subset of colors displayed in the bar legend

This seems real easy but I can't find the answer. I have a few contour plots that I am combining and want to use only one bar legend that captures all the values. Given that I know the range of values,...
2
votes
1answer
144 views

Different distance in .jpg plot and .eps

I noticed that when I run my code to draw a plot: ...
6
votes
2answers
207 views

Why does Rotate in PlotMarkers behave strangely?

Bug introduced in 9.0 or earlier and persisting through 12.0 While answering Change the inner color of markers I came across a behavior that may be a bug. I would like to know if there is another ...
6
votes
4answers
1k views

ParametricPlot and PlotLegends don't seem to cooperate

Bug introduced in 9.0.1 -- fixed in 10.0.0? I noted that only part of the legend shows up in ParametricPlot using v9's ...
13
votes
3answers
10k 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: ...
30
votes
2answers
766 views

Poets of the 19th century

...
17
votes
3answers
6k 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 ...
13
votes
1answer
459 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, ...
11
votes
2answers
4k 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 ...
14
votes
1answer
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 ...
13
votes
3answers
944 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. ...
10
votes
3answers
940 views

How to use legends from PlotLegends in LevelScheme?

I've been attempting to find efficient ways to generate graphics with legends for export, and have been working with both LevelScheme and the new (to v9) ...
4
votes
3answers
2k views

How to use LineLegend and SwatchLegend together

I am wondering if one can place on the right of the plot frame a single legend that is a combination of a LineLegend and a SwatchLegend. What I want is to see the line with its label on top of the ...
7
votes
2answers
110 views

What are these markers at the bottom of BarLegend?

Bug introduced in 11.3 and fixed in 12.0 I've noticed these small ruler-type markers at the bottom of BarLegend objects. ...
7
votes
3answers
1k views

adjust the alignment of different legends

I used Show to combine a ListPlot and Plot, and each plot has its own legend. The code is as ...
6
votes
2answers
350 views

Perfect vertical alignment (centering) of PointLegend markers and their labels [duplicate]

I want to produce a stand-alone PointLegend for a bunch of plots which I generated. Unfortunately, the markers are slightly off-axis. I have applied all the options ...
1
vote
1answer
824 views

Plot Legends when first argument was generated by Table[]

I can get a plot to generate legends for different functions when these functions are put into a hand-coded list. However, when I generate the list of functions using Table[] only one legend is ...
2
votes
1answer
2k views

Adjusting the legend colors to match that in MatrixPlot

I am trying to show the legend with a ColorData for a discrete Fourier transform coefficient table. Here's a sample data table: ...
19
votes
2answers
24k 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. ...
6
votes
2answers
376 views

PlotLegends “Expressions” default for ListPlot?

gwr pointed out an apparent problem with setting a default Option value of PlotLegends for DateListPlot. I traced the problem ...
5
votes
2answers
754 views

Customizing DensityPlot[]'s automatic bar legend

To get the density plot of a function f[x,y] with a bar legend, I'm using ...
5
votes
2answers
960 views

Gray background in export pdf

I am trying to output a simple plot with a legend and the output keeps coming out with a gray background. A simple example is the following: ...