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

learn more… | top users | synonyms

3
votes
1answer
28 views

pgfplots: adds “-indexX” to duplicate columns when pulling column name by \pgfplotstablegetcolumnnamebyindex

I am making graphs from a huge CSV with a macro hacked from http://tex.stackexchange.com/a/45125 and http://tex.stackexchange.com/a/24023 Which selects start/end column and adds them etc. But ...
4
votes
1answer
48 views

pgfplots - legend displays incorrectly for stacked bar chart

I have a problem with formatting the legend correctly. Here is my code: \begin{figure}[H] \centering \begin{tikzpicture} \pgfplotstableread{ x Order m0 m132 m3 m460 ...
4
votes
1answer
46 views

tikzpicture : hide only one “plot” from legend

Found the answer: pgfplots: prevent single plot from being listed in legend I plot multiple things to one tikzpicture. Because the plotting order is important to me, to avoid overlaying of the hatch ...
3
votes
0answers
66 views

matlab2tikz does not capture legend title? [duplicate]

I generate a plot in MATLAB using the code below (MWE): x = [1:100]; y = x.^0.5; [hLine1]=semilogx(x,y); hleg1 = legend(sprintf('%.4f',0.4334)); set(get(hleg1,'title'),'string','test'); set(hleg1, ...
7
votes
2answers
91 views

Linear and non-linear functions inside \addplot to get a unique legend

I have functions which have two intervals, a linear and non-linear. I want to have these inside the command \addplot in pgfplots, to get only one legend. I tried it with them in a separated write, but ...
3
votes
1answer
40 views

Plot legend without line break

I am having a plot with legend entries. The entries are not really long, it would be nice to have them in a single row. The default behavior adds a line break after each entry. Furthermore, the are ...
2
votes
1answer
82 views

Force pgfplots to draw legend according to cycle list instead of the first plots

I use pgfplots to plot multiple curves from a file. The graph is plotted in two steps Draw only the marks, taking the original values from the file Draw only the lines, approximating the curve of ...
6
votes
1answer
131 views

How to make the legend box transparent in pgfplots?

The legend box is covering parts of the graph (even though I removed the borders). How do I make the legend box transparent?
2
votes
0answers
20 views

Legend symbol not being displayed correctly in pgfplots [duplicate]

I'm trying to create a horizontal bar plot with log axis. Adapting several examples I could get what I needed. However, the legend symbols are not being displayed the way I want. Here's what I got so ...
3
votes
1answer
56 views

Legend on every page

This is both a style question as well as a latex question: What is the preferred method of providing a legend for about 30 figures having a similar or the same legend in a thesis? Is it desirable ...
2
votes
0answers
30 views

Legend for selected functions only [duplicate]

In my plot, there are 6-7 \addplot[] entries but I want legend for only one of those functions. How can I do that? I tried \addlegendentry after the function I wish to have a legend for but it creates ...
1
vote
1answer
79 views

Can not externalize a tikz graph with two legend entries

I have a tikz file that contains a matlab scatter plot. It is created by matlab2tikz. The tikz file (sample.tikz) looks as follows and compiles fine in the document without the externalization. ...
8
votes
1answer
93 views

legend looks strange for joint line and bar plot in pgfplots

I am trying to draw both a line plot and a bar plot in the same plot. However, the legend for the line plot looks wrong. Question: How do I make the legend look like the legend for a regular line ...
1
vote
1answer
86 views

Place vertically centered legend to the right of groupplots

I want to place the legend to the right of groupplots using the pgfplots package, and for the legend to be vertically aligned at the center. In other words, I want the legend to be placed at the point ...
2
votes
2answers
93 views

Linewrap in legend in pgfplots [Solved]

I try make plot with long text in legend. \documentclass{report} \usepackage{pgfplots} \pgfplotsset{ every axis legend/.append style={at={(0.5,-0.13)},anchor=north,legend cell align=left}, tick label ...
1
vote
0answers
120 views

How to adjust the inner and outer margin spaces around legend in PGFPlots?

How can I adjust the inner/out right/left/top/bottom margins of legend in PGFPlots? (not the space between the legend entries) e.g. indicated in the below figure.
0
votes
1answer
157 views

Package collision matlab2tikz and legend in polaraxis. pgfplotset and multiple size definition problem

How can plots, created by matlab2tikz and common tikzpicture-polaraxis be correctly used within the same document? The example is of the structure packages, matlab2tikz-pic1, matlab2tikz-pic2 and ...
5
votes
2answers
136 views

Legend position control within rotated polar axis

How can I shift (control) the position of the legend within rotated polar axis environment? (e.g. shift into the south-east corner?) \documentclass{article} \usepackage{pgfplots} ...
2
votes
1answer
396 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, ...
2
votes
0answers
143 views

How to align bars with the legend?

I'm able to draw bar chart using tex file mentioned below \documentclass[landscape,a3paper,11pt]{article} \usepackage{pstricks-add} \usepackage{pgfplots, pgfplotstable} \begin{document} ...
4
votes
0answers
197 views

Create legend tikzpicture without pgfplots

I already tried to create a legend with pgfplots but it seems that conflicts with tikz-uml library (another tikzpicture that I have in the same file) so I want to know how can I create a legend with ...
1
vote
1answer
66 views

Alienation for a manually generated legend

I have generated the graphic below with the following code: \documentclass[11pt]{article} \usepackage{tikz,xifthen} \usetikzlibrary{arrows, decorations.text, decorations.markings, shapes, patterns, ...
1
vote
1answer
303 views

Legend marker in pgfplot bar chart

I spent the last hours trying to solve this issue. I hope you can help me, sorry if the answer appears clearly somewhere else, I was not able to find it. I would like to adjust the marker/symbol in ...
5
votes
2answers
223 views

Problems using `addlegendentry` in a loop with `pfgplots`

I have some spectra to plot, which I exported from the Siemens Xray toolbox, which works nicely with pgfplots. Since these are multiple files that look the same I think I can do it with a for loop, ...
2
votes
1answer
195 views

pgfplot xbar legend ordering

when I am drawing a xbar chart, I have troubles with the legend entries. They appear to have the opposite ordering as I suppose they should have. \begin{tikzpicture} \begin{axis}[xbar] \addplot ...
1
vote
0answers
23 views

tikz legend with only 1 bar, not 2 [duplicate]

I have bar graphs made with tikz picture and pgfplots and the legend has two bars shown for each item. If this were printed in black and white I can see it being confusing given that I have multiple ...
2
votes
1answer
211 views

legend in Unequal upper and lower deviation in PGFplots error bar!

I want to set different lower and upper deviations for error bars. It seems that PGFplots does not support unequal +,- error bar length. I have come up with a solution, that is to draw + and - error ...
4
votes
1answer
172 views

How to label a TiKz shape for referencing its legend in the caption

How can I label a TiKz line style for further referencing in figure caption. For \addplot the label just follows it. However, I don't know how to do it for \draw. MWE: \documentclass{book} ...
5
votes
1answer
136 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 ...
6
votes
1answer
4k 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 ...
1
vote
1answer
142 views

pgfplots: multiple legends or one legend and a heading

In my plot, I want my standard legend that says what value of c corresponds to what color. However, I would also look to put the function in plot. \documentclass[tikz]{standalone} ...
5
votes
2answers
149 views

Color legend in Y axis

I have the following multiple y-axis plot that results in the image on the top image. However, I want to add a sort of legend in each of the Y axis, similar to what I manually drew in the bottom ...
2
votes
0answers
200 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
156 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
57 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
119 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 ...
4
votes
1answer
203 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
178 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
157 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
86 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
123 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
268 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
318 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 ...
4
votes
0answers
209 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
172 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
142 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 ...
5
votes
1answer
347 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
321 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
237 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
175 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 ...