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)

41
votes
4answers
10k 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
10k 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 ...
25
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 ...
25
votes
3answers
4k 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 ...
21
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 ...
18
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
615 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 ...
13
votes
5answers
746 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 ...
12
votes
3answers
862 views

Adapt ticks in plot and font in legend

Some of my 2-dimensional data are displayed with a code similar to this: ...
10
votes
1answer
324 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. ...
10
votes
1answer
5k 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
328 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
412 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
589 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
721 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: ...
8
votes
2answers
349 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
2answers
3k 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
1answer
192 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
607 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 ...
7
votes
2answers
726 views

Legends in combined Plot and ListPlot

I have a set of data ...
7
votes
1answer
941 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 ...
6
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 ...
6
votes
3answers
260 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
1answer
171 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
292 views

Using PlotLegends with a numeric PointSize

Using PlotLegends with a PlotStyle containing (for instance) PointSize[0.02] creates a ...
6
votes
1answer
89 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: ...
5
votes
3answers
542 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
2answers
320 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? ...
5
votes
1answer
201 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
483 views

Placing bar chart labels on the upper and lower frame axes

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

Table in a Legend

Calculated data: ...
4
votes
3answers
3k 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
130 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
159 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
3answers
109 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
160 views

Prevent manipulations in PlotLegends

Mathematica code to reproduce: ...
4
votes
1answer
692 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
185 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
293 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
159 views

Problem with the Plot of Functions and PlotLegends

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

Controlling margin around PlotLegends

Here's my code: ...
3
votes
1answer
396 views

Legend for ListContourPlot

Consider this example below for ListContourPlot. ListContourPlot[ Table[Sin[j^2 + i], {i, 0, Pi, 0.02}, {j, 0, Pi, 0.02}], PlotLegends -> Automatic] I ...
3
votes
3answers
501 views

ParametricPlot and PlotLegends don't seem to cooperate

I noted that only part of the legend shows up in ParametricPlot using v9's PlotLegends: ...
3
votes
1answer
149 views

How to reverse the gradient and ticks in BarLegend

I created a plot with a horizontal BarLegend for TemperatureColors (see1). Code: ...
3
votes
1answer
37 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 ...