6
votes
1answer
92 views

plot legend : increase its area

So my question in general is what is the method to change the precise area of the rectangle used in pgf plots? Yes, to make it larger ... MWE: a typical bar chart ...
1
vote
1answer
61 views

PGFPlots - trying to combine legends

I have an interesting problem. I am trying to create two graphs using the groupplots environment, side-by-side, that show different sets of data elements with different legend entries and different ...
3
votes
1answer
91 views

pgfplots: “group” legend entries?

Actually, I'm working on a study where I've to plot a lot of temperature data etc. Therefore, I use "pgfplots". Everything works pretty well, so that I get the result as shown in the attached picture ...
2
votes
1answer
59 views

2 rows legend and alignment

I got a legend with two rows and I would like to have a different alignment on each row. Is it possible ? In my current code, the legend entries on the second line are much longer than ones on the ...
1
vote
0answers
65 views

How to put legend below the chart?

I have the following code that produces a line chart: \begin{figure}[p] \centering \begin{tikzpicture} \begin{axis}[ use units, cycle list name=exotic, %This defines the color. It ...
2
votes
2answers
90 views

Pgfplots: let legend show two linestyles

I do have a double axis plot which which compares two different things (part 1 on the left axis in solid, part two on the right axis in dashed) for different paramters which are common for both plots. ...
3
votes
1answer
75 views

Tikz legend cannot be added?

I thought I can add a legend to a tikz picture by \addlegendentry{...}. But as soon as I uncomment the command the compiler complains about missing }. But when I comment the lines again, then it ...
0
votes
0answers
66 views

Choosing location of legend entries in Pgfplots

I am fairly new to using pgfplots and have been combing the manual for a couple hours now and I can't find an elegant solution to my problem. I would like to have two columns of legend entries and ...
3
votes
1answer
100 views

pgfplots legend to name not working

I would like to use legend to name feature to display legend externally. I have two graphs inside a tikz picture which comes from this question. Here is the code tha to tried to modify and make the ...
1
vote
0answers
60 views

legend transparency in pgfplots

I want to have a legend in pgfplpots such that it overwrites grid lines (i.e. grid lines are erased where the legend is placed) but not the axis (i.e. axis are drawn on top of legend, in case legend ...
3
votes
1answer
49 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
152 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
120 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
72 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
138 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 ...
4
votes
1answer
92 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 ...
3
votes
1answer
183 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 ...
7
votes
1answer
393 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
21 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 ...
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 ...
8
votes
1answer
141 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
215 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
129 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
212 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
239 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 ...
2
votes
2answers
664 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
158 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} ...
1
vote
1answer
475 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 ...
6
votes
2answers
387 views

Problems using \addlegendentry in a loop with pgfplots

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, ...
4
votes
1answer
317 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
24 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
276 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 ...
5
votes
1answer
188 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
8k 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
266 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
204 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
343 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
214 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
64 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 ...
4
votes
1answer
351 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 ...
5
votes
1answer
175 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
109 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
145 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
448 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
436 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
246 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
226 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
165 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
505 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
625 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} ...