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

learn more… | top users | synonyms

2
votes
0answers
383 views

Adding a legend next to subfigures of pgfplots

I have an error bar chart, where I would like to add a legend. Using this type of code, I am facing problems to add any kind of legend. Please consider my current code: ...
6
votes
1answer
241 views

pgfplots - How can I achieve an xbar plot with bars adding up to 100% on both ends?

edit I don't need a solution anymore, I decided to not use the "negative" bars on the right side but I am leaving (and not deleting) this question in case someone else is looking for this in the ...
3
votes
1answer
69 views

How to put legend graphic representation to the right of the label

All the pgfplots examples I could find have the graphic (e.g. symbol) to the left of the label (see example below) in the legend. I think this default is very good but due to space constrains I have ...
2
votes
0answers
142 views

Legend in graph with tikz [closed]

I need to make a legend for my graph in TikZ, but I need that legend would be from 3 columns, how can I do this? I use this code: \newenvironment{customlegend}[1][]{% \begingroup \csname ...
5
votes
1answer
431 views

pgfplots: Changing horizontal spacing in the legend [duplicate]

I'm drawing a simple scatter plot with pgfplots, which also includes a legend as shown in the upper part of the picture next. However, I find the horizontal spacing odd because the distance between ...
3
votes
1answer
260 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 ...
5
votes
1answer
185 views

How to get the drop shadow for a pgfplots legend right?

When using drop shadows in legend style of a plot created with pgfplots not only the legend box but also the lines that are part of the legend images "cast a shadow" in the final picture. Since ...
7
votes
1answer
116 views

pgfplots and hyperref clash for complicated figure in book class

When using the book class, pgfplots, hyperref, and section labeling according to "How to reset chapter and section counter with \part", I get the following error ! You can't use `the character -' ...
7
votes
1answer
155 views

Despite using the 'no markers' option, I still get plotmarks in my legend. Why?

Nice to finally post a question myself after finding solutions to my problems on numerous occasions within these forums. I hope someone can be of help (and that this hasn't been asked already). The ...
8
votes
2answers
534 views

Comma in legend in pgfplots

The following code with the comma in the legend entry fails to compile. \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
6
votes
1answer
468 views

How to fill the mark in pgfplot legend

I would like to create a graph using pgfplots. I don't like the legend symbol used for ybars and decided to go with a line legend entry and squares instead. How can I fill these marks, so that they ...
5
votes
0answers
257 views

legend problem in highlighting a data plot

I followed the tips on highlighting in data plots at http://www.howtotex.com/tips-tricks/highlighting-in-tikz-plots/ The highlighting does not work well with \addlegendentry. A MWE is shown below. ...
2
votes
1answer
248 views

Pgf plots and a tabular legend

I have a plot where I want to add a legend which is the combination of lines and marks. For that I want to replace (or define a new) the original pgf plots legend type. As said before, in the ...
4
votes
1answer
177 views

Legend on second frame has only one entry, labeled wrong

Using pgfplots in beamer with \only frames, the legend for the second frame (only) inexplicably shows only one entry, with the color of the last \addlegendentry, but the legend of the first. The other ...
8
votes
1answer
563 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
755 views

Modify the legend-style in pgfplots

I have a question concerning pgfplots. I made a minimal example which is related to the example in the pgfplots manual (page 182): \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} ...
8
votes
1answer
312 views

legend placement with bounding box restrictions and externalization in pgfplots

I find it useful to add \pgfplotsset{/tikz/every picture/.append style={trim axis left,trim axis right}} to my preamble for bounding box restrictions. But then when I use the legend to name feature ...
8
votes
1answer
223 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 ...
5
votes
1answer
164 views

Legend position in standalone pgfplot moves when plot is used in document

The following mwe shows that the legend position in a pgfplot changes when the standalone version is scaled in a document that includes it. Standalone: From driver: (I changed the sizes to ...
8
votes
1answer
241 views

Split tikz tree level in two parts

I would like to rebuild this graphic for my bachelorthesis. The problem that i ran into was, that i don't know how to split the graph in the second level, like shown in the picture above. I was ...
2
votes
1answer
80 views

StrSubstitute not working nicely with pgfplots

This question is related to my older question here, but now slightly different. I now have a function that is supposed to take two multivalued arguments. One contains the columns i want to plot. If i ...
1
vote
1answer
173 views

Legend entry with curve fits

I am plotting two data sets with curve fits added manually (by defining two functions). How can I edit my legend entry to combine the data points and lines into one icon? So instead of having four ...
4
votes
1answer
343 views

Missing mark at legend for tikz bar chart

I have the following code: \begin{tikzpicture} \pgfplotstableread{ % Read the data into a table macro Label First Second Third test 30 30 40 }\datatable \begin{axis}[ xbar ...
6
votes
1answer
4k 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
1k views

New line in pgfplots/tikz not displaying in TeX

I have a multiple-line legend entry to preserve the width of my figure. I can use \newline in Matlab and the legend entry is split between two lines. When I produce a .tikz of the figure however, I ...
9
votes
2answers
578 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 ...
7
votes
2answers
3k views

How to modify the image of an legend entry

I have the following code \documentclass[tikz,convert={size=640}]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ legend entries={simulation sample 1, ...
2
votes
1answer
363 views

pgfplots: Scatter plot with multiple series side-by-side

I have multiple machines on which I did benchmarks. Now I wan to use pgfplots to show multiple y values (the variance in the measurement) for a single x value (a benchmark parameter) within a single ...
2
votes
1answer
229 views

How can I add or overlay a legend to an .eps image

Assume someone has several Matlab plots saved as .eps graphics and realizes in some of them the legend for the curves is missing. Is there a way to add these legends afterwards, or to overlay another ...
5
votes
1answer
1k views

Global legend for multiple figures

Similar to this question, I need output as follows but in a neat way. My solution code is not neat any more: I added a dummy axis to use its legend. Also the legend must be at top of the page. Here ...
1
vote
1answer
126 views

Legend of picture, caption

I would like to assign one caption to a picture in my report, without this caption begin in the listing of figure. I use the following: \begin{figure}[htbp] \begin{minipage}[l]{.645\linewidth} ...
4
votes
3answers
556 views

Spider Graph Legend and Caption

I would like to add: legend (Red, blue and Green) and figure caption (with legend) for my Keviat plot. The code of my keviat is listed below. Thank you \documentclass[]{scrartcl} ...
4
votes
1answer
338 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 ...
4
votes
1answer
844 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} ...
4
votes
1answer
590 views

How to manually draw horizontal legend and place it correctly in tikz?

This is my tikz code to draw some plots. \documentclass{article} \usepackage{tikz,subfig} \begin{document} \begin{figure} \centering \subfloat[Iteration Domain for a Tile]{ ...
2
votes
1answer
262 views

How to generate a separate legend picture?

I want to generate a tikzpicture which only contains the legends, and not the plots themselves. I use the following code and it returns an error: ! Package pgfplots Error: Sorry, the supplied plot ...
5
votes
1answer
811 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 ...
2
votes
2answers
736 views

Remove border around area legend rectangle

I have a legend with the option area legend to draw a little rectangle in the legend instead of a line segment. There is a border around the rectangle I would like to either remove or make the same ...
2
votes
1answer
183 views

ytick pgfplot issue

I have the following latex code but unfortunately cannot get the ytick to be of my choice. \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{center} ...
6
votes
1answer
274 views

Problem of superimpose and how to change legend symbol

Given the plot as follows I have two problems: a and b are superimposed on each other, how should I make this clear on the graph? How could I change legend c to other icons like star? (It looks a ...
5
votes
1answer
586 views

Pgfplots, Legend Color

I have the following problem: I Have a TikZ Picture with two data plots, each with a different color. I want each one to appear in the legend, and I'm using \addlegendentry. The problem is that Latex ...
2
votes
1answer
157 views

How to make the legend border tighter?

I am trying to make the legend border tighter. What is the \begin{axis}[legend style={...}] property to adjust the legend border (both width and height of the border)? \documentclass{article} ...
5
votes
1answer
778 views

How can I adjust the column width of legend in PGFplots?

I would like to adjust the width of the legend lines (images) in PGFplots. Since legend is a TikZ matrix, I can adjust the separation between lines, space between text and lines by changing the matrix ...
1
vote
0answers
57 views

fix position legend in pgfplot [duplicate]

Possible Duplicate: Put legend (pgfplots) below the plot I'm trying to set correctly the right position of the legend of my plot. I would have the legend just bottom right of my plot. Any ...
4
votes
0answers
77 views

LaTex Pgfplots Two axes 1 legend [duplicate]

Possible Duplicate: Using a pgfplots-style legend in a plain-old tikzpicture I'm trying to accomplish this: I have a plot with two y-axes. The first y has two plots, the second has one. I ...
2
votes
0answers
144 views

How can I adjust the width of legend images in PGFPlots? [closed]

I am using pgfplots to create charts. How can I adjust the width of images of legend entries? I have adjusted plot coordinates in legend image code in the line legend style, but this not worked ...
3
votes
0answers
260 views

pslegend bounding box odd while using Cirkuit

This question is regarding pst-plot and more specifically \pslegend. The code below produces the two following plots: One of these figures is generated without the \pslegend and it appears to have ...
6
votes
1answer
9k 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
2k 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 ...