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)

44
votes
4answers
11k 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 ...
28
votes
7answers
11k 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 ...
26
votes
3answers
4k 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
3k 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 ...
19
votes
5answers
3k 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
1k 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
718 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
887 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
388 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. ...
12
votes
3answers
953 views

Adapt ticks in plot and font in legend

Some of my 2-dimensional data are displayed with a code similar to this: ...
11
votes
1answer
173 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, ...
10
votes
1answer
6k 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
382 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
451 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
4answers
794 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 ...
9
votes
3answers
2k 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 ...
9
votes
3answers
810 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: ...
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
457 views

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

The new legending functionality in version 9 is much easier to use than the PlotLegends package and other bespoke ways of creating legends in earlier versions. ...
8
votes
1answer
253 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
696 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
1k 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
1k 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
126 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
134 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
294 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
507 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
1answer
872 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 ...
6
votes
1answer
243 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 ...
6
votes
1answer
343 views

Using PlotLegends with a numeric PointSize

Using PlotLegends with a PlotStyle containing (for instance) PointSize[0.02] creates a ...
5
votes
3answers
639 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
228 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
560 views

Placing bar chart labels on the upper and lower frame axes

In the bar chart (with negative values) ...
5
votes
2answers
336 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: ...
4
votes
3answers
366 views

Table in a Legend

Calculated data: ...
4
votes
2answers
127 views

Plots using TextAlignment with SwatchLegend to left align multi-line items

I have Legends that stretch over multi-lines and the only way I can get them left aligned is by adding white space to the end of the legend item. Does anyone know if there is a way to use ...
4
votes
3answers
4k 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.
4
votes
3answers
142 views

How to make an arbitrary number of plots have different labels/colors/etc?

I'm sorry but I'm not sure how to phrase this question well. Frequently I have a function that produces and returns a Plot[] or array of Plot[]'s, which I can then display with Show[], or combine with ...
4
votes
2answers
196 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 ...
4
votes
1answer
122 views

“Legended” not working with “Plot” or “LogLinearPlot”

Version 9 has a new option Legended, which I find appealing since it should allow me to add individual expressions/curves to a legend, but it doesn't seem to be ...
4
votes
3answers
164 views

How to order legend in Show?

I've asked this question in Wolfram community and have not received a response. I am wondering why when I use Show to combine 6 plots, the plot legend does not ...
4
votes
2answers
168 views

Prevent manipulations in PlotLegends

Mathematica code to reproduce: ...
4
votes
1answer
786 views

How do I use the ShowLegends function to produce a legend for my framed graphic?

I'm new to this site and new to Mathematica as you can see from my question. I'm also new to programming, btw. I'm trying to produce a legend for my plot which I've coded as follows: ...
4
votes
1answer
210 views

Dynamic legends involving show

My question is how do I get dynamic legends (legends that turn data on/off) to work with Show? This is an extension of an old question here; How to dynamically toggle curves on/off in a crowded ...
4
votes
1answer
306 views

How do I set the boundaries of the legend for a ListDensityPlot?

I have a 3-d array imported from a text file. One dimension represents time, and the other two represent space. It's basically an array of 2-d arrays of temperature values. I want to plot these values ...
3
votes
2answers
1k 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: ...
3
votes
1answer
202 views

Problem with the Plot of Functions and PlotLegends

For some odd reason the PlotLegends output is not as expected. ...
3
votes
1answer
110 views

Controlling margin around PlotLegends

Here's my code: ...