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.

learn more… | top users | synonyms (1)

48
votes
4answers
13k 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 ...
32
votes
7answers
13k 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 ...
28
votes
3answers
5k 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'd then like to add a legend ...
26
votes
3answers
5k 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 ...
23
votes
7answers
4k 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 ...
23
votes
2answers
468 views

Poets of the 19th century

...
19
votes
5answers
4k 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. ...
17
votes
4answers
2k 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 ...
14
votes
5answers
827 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 ...
14
votes
5answers
1k 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 ...
13
votes
2answers
459 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. ...
13
votes
2answers
283 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 ...
12
votes
3answers
1k views

Adapt ticks in plot and font in legend

Some of my 2-dimensional data are displayed with a code similar to this: ...
12
votes
1answer
248 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
3answers
475 views

Using PlotLegends with a numeric PointSize

Using PlotLegends with a PlotStyle containing (for instance) PointSize[0.02] creates a ...
11
votes
4answers
3k 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 ...
10
votes
4answers
1k 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 ...
10
votes
2answers
582 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 ...
10
votes
3answers
911 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: ...
10
votes
1answer
7k 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. ...
10
votes
1answer
468 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 ...
10
votes
3answers
508 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) ...
9
votes
2answers
376 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 ...
9
votes
2answers
4k 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: ...
8
votes
2answers
217 views

Attaching a legend to BallAndStick picture

I am looking for a way to add a legend showing the identity of various atoms (with different colours) to this picture. Any Clues? ...
8
votes
2answers
157 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): ...
8
votes
1answer
142 views

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

While testing the examples from this recent post, i've noticed a problem in V.10 with PlotLegends when it has to automatically generate more than 15 labels (i.e. ...
8
votes
2answers
131 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. ...
8
votes
1answer
293 views

How does PlotLegends actually work with ListPlot3D?

I'm sensing this might be a rookie mistake but normally I roll my own legends but decided to try the built in legends for a ListPlot3D. ...
8
votes
1answer
1k 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 ...
8
votes
1answer
808 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 ...
8
votes
2answers
2k views

Legends in combined Plot and ListPlot

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

Logarithmic scale in the legend of a ListContourPlot

Is there a way to use a logarithmic scale in the colour legend of a ListContourPlot? The contours can be logged by taking the ...
7
votes
4answers
2k 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 ...
7
votes
1answer
179 views

Why does not BarLegend accept user-defined color function?

I encountered a really strange problem with BarLegend. Say you have a user-defined color function: ...
7
votes
1answer
291 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: ...
6
votes
3answers
320 views

Fill circle layers with colors according to read values from a plotted curve

I want to read (temperature) values from plotted (cooling) curves and visualize them in layered circles. I have an example made manually for clarification: 3 plotted curves, at certain time steps ...
6
votes
2answers
527 views

How do I identify each surface in a multi-surface Plot3D?

I am plotting three surfaces on a 3D plot. They differ in the value of one parameter. Is there a way to distinguish each surface for various values of the parameter? My code is: ...
6
votes
2answers
787 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? ...
6
votes
2answers
258 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 ...
6
votes
2answers
105 views

MatrixPlot provides wildly inaccurate PlotLegend?

I noticed something weird with MatrixPlot's PlotLegends -> Automatic behavior- here's a minimal example: ...
5
votes
3answers
753 views

Using PlotLegends

Please don't answer this with "Just trash PlotLegends" or anything like that as I have tried homebrew solutions. I keep running into problems which I can't debug as ...
5
votes
1answer
266 views

Can I add legends to a SmoothHistogram?

Under the options menu for Histogram, there is an option called ChartLegends, which adds little boxes beside the plot to ...
5
votes
3answers
676 views

Placing bar chart labels on the upper and lower frame axes

In the bar chart (with negative values) ...
5
votes
2answers
353 views

How To Span Table Headings?

What I am doing wrong? I would like to get a header to the table and based on your code I tried this: ...
5
votes
1answer
75 views

How to share `LineLegend` among sub-figures in `GraphicsGrid`?

Using GraphicsGrid, I have put two figures that share the same x-axis in a row. However, I failed to let them share a common ...
5
votes
1answer
180 views

Wrong with VisibleSpectrum

...
5
votes
2answers
181 views

How to set PlotLegend Number Format

Is there any way to make Mathematica to show the legend labels like a real number rather than in fraction form? I read the BarLegend options, however they are just ...
5
votes
2answers
63 views

Why does Rotate in PlotMarkers behave strangely?

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 explanation. First a basic example of normal behavior: ...
4
votes
2answers
2k views

Plot CSV-data; make statistical statements in Mathematica / WA

First, I'm quite new to Mathematica so sorry in advance if some questions seem to be trivial. I have a CSV-file which looks like this: ...