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

learn more… | top users | synonyms

6
votes
1answer
10k 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
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 ...
5
votes
1answer
3k views

Two columns in legend in pgfplots

I know how to create a legend in a pgfplots plot. See Legend in tikzpicture and Using a pgfplots-style legend in a plain-old tikzpicture. But I do not know how I can create a legend with two ...
1
vote
1answer
666 views

Marker color in legend

Since I updated to TexLive2012 yesterday, I can't get ant colored markers in my legend. Where as first I could put the following in the \addlegendentry options, it now won't work. ...
10
votes
2answers
1k views

pgfplotstable: How to access column name?

I have used \pgfplotstableset to assign column names in the preamble. However, I don't know how to access them. \documentclass{article} \usepackage{amsmath} \usepackage{pgfplots, pgfplotstable, ...
9
votes
1answer
2k views

Pgfplots axis, option to remove (or ignore) legends

Is there an option in pgfplots at the axis level or a setting of legend style option, that would effectively ignore the subsequent legend entries in the plot? \documentclass{article} ...
6
votes
1answer
267 views

Is it possible to combine cases with pgfplots legend?

I would like to print a function and add a legend which makes use of cases. The current code is: \documentclass{article} \usepackage[pdftex,active,tightpage]{preview} \setlength\PreviewBorder{2mm} ...
3
votes
1answer
361 views

Use symbols with \label and \ref in custom legend

I would like to build a legend entry that refers to two simultaneous plots, because it is more intuitive to do so. I use \label and \ref to refer to the plot symbols, but they are shifted in the ...
5
votes
1answer
956 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 ...
1
vote
1answer
321 views

Vertically aligned legend to PGFPlots subplots

What I want to do is to have 3 PGFPlots subplots and the legend arranged in four equally sized boxes. However, when I use the following code, in the output the legend is not vertically aligned with ...
7
votes
1answer
737 views

Custom legend for intensity plot

I created an intensity-plot (x and y axes are positions, the color of the point gives the intensity) in an external program (igor pro) and included the "bare" plot via the \addplot graphics command ...
3
votes
1answer
280 views

Plots with only a few scattered marks and correct legend

I would like to draw several plots with lines and only a few marks. The markes are irregularely spaced, so I used a method alluded to in the pgfplots manual, section 4.8.5 (Legend appearance), page ...
2
votes
1answer
584 views

How can I add a legend in aligned subplots

I want to have two subplots with the same x axis aligned above one another. In the manual I read, that I should use \matrix{} to achieve this. Now I want to have legends in both plots. But since the ...
6
votes
1answer
525 views

Legend referencing in caption *and* externalization

I am trying to make a reference to a plot inside a figure's caption while using the externalize library. The issue of plot reference using externalization has already been raised in this question. I ...
2
votes
2answers
916 views

Using node shapes or self made tikzpicture as image in legend

I am using the solutions of Using a pgfplots-style legend in a plain-old tikzpicture and Legend in tikzpicture to create a legend in a tikzpicture. In this legend I need a cylinder as image. I ...
11
votes
1answer
7k 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 ...
5
votes
1answer
2k views

pgfplots particular legend

\usepackage{pgfplots} \pgfplotsset{width=10cm} \begin{figure} \centering \begin{tikzpicture} \makeatletter \newcommand{\pgfplotsdrawaxis}{\pgfplots@draw@axis} \makeatother \pgfplotsset{axis line ...
13
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 ...
8
votes
1answer
221 views

Translator doesn't work in external pgfplot legend

I would like to have my pgfplot legend automatically translated wrt the language used in my article. Thus, I use to use the translator package, which a very easy and pleasant solution. It works like a ...
13
votes
1answer
8k views

pgfplots: alignment and size of math in legend

The legend entries created by a more complex math formula as in this example are overlapping and the alignment to the lines is wrong. \documentclass[]{scrbook} \usepackage{pgfplots} ...
13
votes
1answer
8k 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
828 views

pgfplots: legendentrys are wrong

I'm using pgfplots to plot a lot of data as you can see below. For some of the plots I'v specified a legendentry, but the marks for these plots are not shown in the legend. does anyone know where the ...
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 ...
15
votes
1answer
3k 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 ...
2
votes
0answers
872 views

pgfplots - subplots with common legend [closed]

This is a followup question of this one. It uses the same MWE but about a different issue so a separate it here. I used Tikz node to create the custom legend but used absolute positioning to place it ...
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 ...
6
votes
1answer
3k views

Pgfplots: put plot legend on the outside margin?

I use classsicthesis style for my PhD. Since this style is somehow geared towards using the outside margin for additional notes and stuff, I thought I could also place the legends of my plots there. I ...
2
votes
1answer
628 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
402 views

Put small title under name in a signature

I want to put a descriptive name under the name in a signature: I currently have: \def\sig#1{\vbox{\hsize=5.5cm \kern2cm\hrule\kern1ex \hbox to \hsize{\strut\hfil #1 \hfil}}} ...
2
votes
1answer
938 views

How to correct for a xshift in the pgfplot legend?

Using the following example code: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel=$x$, ...
6
votes
2answers
5k 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 ...
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 ...
18
votes
1answer
4k 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 ...
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 ...
2
votes
1answer
1k views

Bar plot legend not displaying correctly

In the legend for a bar plot that I'm building, I'm only getting a small tick next to the name, not a block of color. I'm not defining any special cycle lists. The code for the plot is: ...
15
votes
1answer
3k views

Removing legend box (border) in pgfplots

I'm attempting to remove or 'turn off' the legend border in pgfplots, but I can't seem to figure out how to do it. I assume it will look something like this: \begin{axis}[ legend style={?}] where ...
7
votes
1answer
4k views

Legend in caption

It may be a bit difficult sometimes to deal with the legend of a figure in a LaTeX document. Depending on the context, you may have to place the legend over the existing curves because of a lack of ...
15
votes
1answer
3k 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 ...