a legend in a graph helps the reader determine the correspondence between line style and data values

learn more… | top users | synonyms

11
votes
2answers
3k views

Using a pgfplots-style legend in a plain-old tikzpicture

I am using a plain-old tikzpicture to produce a pie-chart-like plot. Now, all other plots in my paper are handled using pgfplots (which doesn't do pie charts) and have their legend typeset by ...
14
votes
1answer
2k views

pgfplots: externalization and legend referencing

There are some issues when using the pgfplots option legend to name together with externalization. When I disable externalization, everything works fine. When I enable externalization, I get an error ...
9
votes
1answer
6k views

Legend in tikzpicture

I am looking for a way to create a legend in a regular tikzpicture. I found this Using a pgfplots-style legend in a plain-old tikzpicture but I don't know how to put the legend at the wanted ...
22
votes
1answer
3k views

How can I adjust the horizontal spacing between legend entries in PGFPlots?

I am using legend columns=-1 to make a horizontal legend. However, the distance between the individual legend entries is too small for my taste. Is there a straightforward way to increase the ...
6
votes
2answers
4k views

tikz legend in caption

I have adapted a piece of code that I found on the Q&A forum multiple legends in pgfplots as follows in order to include the legend of a drawing directly into the caption: EDIT 1 ...
16
votes
1answer
3k views

pgfplots: prevent single plot from being listed in legend

In order to fill the area between two complex curves I use tables and the vertcat command (see Fill between two curves in pgfplots.). Now I don't want the plotted area to appear in my legend, just ...
5
votes
2answers
2k views

pgfplot column chart legend shape

I have the following code in Latex using gpfplot. The legend in the generated graph always looks like the image attached. There are two boxes instead of one for each entry. Why this is happening? How ...
4
votes
1answer
1k views

pgfplots, custom legend and tikz library external

I try to create Tikz figure with several pgfplots subplots. I want to have one legend for them since they all have the same curves. I found out from this question that i can label and than reference ...
16
votes
1answer
5k views

Colors and legend in groupplots/barplot

In order to compare three items I use the groupplot command. For each item I have n different criteria to compare. Is it possible to set the color for each criteria itself? Meaning the first bar in ...
6
votes
1answer
8k views

Put legend (pgfplots) below the plot

I have a pgfplot where the legend is right to the plot. I create the plot as follows: \begin{axis}[ scale only axis, xmode=log, ymode=log, width=7cm, legend cell align=left, ...
5
votes
1answer
178 views

Strange interaction between `addlegendentry` and `y filter` in pgfplot

From this answer How to scale existing coordinates data in pgfplots? I am using y filter to process data, all fine until I decide to put a legend entry in the plot. I cannot seem to simultaneously use ...
14
votes
1answer
2k views

Add a legend title to the legend box with pgfplots?

I am using the awesome pgfplots package to draw some plots. I usually use \addlegendentry and get a nice default legend box. There are some options for legend box placement and layout (e.g. number of ...
7
votes
1answer
3k views

Putting LaTeX table legend in a “x\y” style [duplicate]

Possible Duplicate: Tables of numbers Is it possible to put a "x\y" style legend in one cell (maybe be made up of several cells) of a table? It would be great to make the 'x' slightly lower ...
8
votes
1answer
468 views

dashed line in pgfplots legend results in incomplete marks

When defining the pgfplots legend entries myself, I have a problem when using dashed lines in combination with marks. The mark is also dashed (or dotted, etc.), just as the accompanying line is. Is ...
3
votes
1answer
234 views

In Lyx, align text inside a float caption

I'm trying to align a legend inside a table caption, so that the colons are vertically aligned. I can do it with the align ambient outside of the caption, but if I use the same code inside the caption ...
2
votes
1answer
601 views

Legend with Markers for Mesh Plot

I use a mesh plot with scatter points (2d) where the colors are determined from a third coordinate of the data as described in this question. The legend however should contain the markers of a curve ...
5
votes
1answer
818 views

Manually add legend symbols in text (without \label and \ref)

I would like to add legend symbols from pgfplots in my text. I am aware of the possibility to use the \label and \ref commands but my setup is complicated and I fear that making it work will more time ...
12
votes
1answer
7k views

pgfplots: Legends in multiple y-axis plot overlapping

I am trying to add a legend for two plots on two different y-axes, however they are overlapping each other and each one is being written in its own box. I would like for both of them to share a single ...
9
votes
2answers
488 views

How to add legend to contour plots?

The following does not work: \documentclass{standalone} \usepackage{tikz,pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[view={0}{90},legend entries={foo,bar}] % 'legend entries' causes ...
4
votes
1answer
673 views

How to draw horizontal(row) legend without the surronding rectangle?

I found the following code to manually draw legend, but it produces vertical(column) legend. How to draw it horizontally? I don't want surrounding rectangle also. \documentclass{article} ...
6
votes
1answer
3k views

pgfplots scale legend position when below xlabel

When using matlab2tikz to generate a .tikz from Matlab where the legend location is set to 'SouthOutside' (below the ylabel of figure), the position of the legend will cover the ylabel unless the ...
5
votes
1answer
772 views

Legend position & bad x ticks scale

I'm currently experimenting tikz-pgf, but facing some strong behaviour. How is it possible to have only 1 legend for a groupplot? Why is the scale 10^(-3) appearing below the first plot? Here is ...
4
votes
1answer
305 views

line legend for mesh plots

I am doing a group plot of related curves. Since they are related by a parameter, I want to color them according to (a function of) that parameter. For that purpose, I used the mesh option, and then ...
8
votes
1answer
203 views

pgfplots: problem in the legend using custom marks

With the help of \pgfdeclareplotmark I defined a custom mark for a plot and it worked as expected; however, in the legend, the mark appears with a vertical shift. What is causing this problem and how ...
6
votes
1answer
7k views

Customize legend position in PGFplots axis environment

I am trying to customize the position of the legend in the axis environment of PGFplots. A simple way to do this is by using something like legend pos=south west|south east|north west|north east ...
2
votes
2answers
613 views

matlab2tikz and legend location

I have a matlab plot given below, that is converted to tikz. Let's call it myfile.tikz \begin{tikzpicture} \begin{axis}[% width=\figurewidth, height=\figureheight, scale only axis, xmin=1, xmax=3, ...