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

learn more… | top users | synonyms

2
votes
1answer
48 views

pgfplots legend nested in matrix

I'm using a \matrix to arrange subplots, each created using pgfplots. When I tried to use \legend to add a legend to individual plots, lualatex tells me Package pgf Error: You cannot nest ...
0
votes
1answer
37 views

table legend - wrong reference

I'm using these commands to create a table with a legend, but the problem is that when I make a reference to it, it appears as "Table IIIB" instead of "Table III". Can you help me please ? ...
1
vote
1answer
34 views

How to have a color square in a text caption

Just like the figure on the right hand. The small squares in green color.
0
votes
0answers
49 views

I have 3 data series and 2 different y-axis. How can I add, outside the graph, the legend for each of three series?

Does someone know how can i change the position of my legend to right-side of my graph? I try many things but i can't. Please give me some help! Here is my code! \resizebox{\textwidth}{!}{ ...
3
votes
3answers
143 views

Tikz-Create a Picture Legend

I am trying to create a legend inside a tikzpicture. The picture shows an accelerator and I would like to make a legend that will explain each part. My code is \documentclass{standalone} ...
2
votes
1answer
45 views

How can I place a node relative to a legend?

I'd like to place custom formatted nodes relative to the legend in a plot. The answer to Placing node relative to legend is a solution per se, but related to op's actual intent so it isn't helpful to ...
1
vote
0answers
90 views

Cannot align legend's text in plots using tikzpicture package

I'm trying to align the text (text + $math$) within the legend in my pgfplot. Despite I put the "legend cell align=left", the text still is centred. Any guess? \documentclass[]{article} ...
6
votes
1answer
119 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
2answers
59 views

pslegend with dot instead of rule

I have the following MWE \documentclass[pstricks,border=0pt]{standalone} \usepackage{pst-node, pst-coil, pst-plot} \begin{document} \begin{psgraph}[axesstyle=frame,Ox=0, Dx=0.1, ...
1
vote
1answer
92 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
147 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
76 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
85 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 ...
3
votes
2answers
124 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
95 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
70 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
128 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
73 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
57 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
206 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
170 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
157 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
119 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
281 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 ...
9
votes
1answer
567 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 ...
3
votes
1answer
63 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
112 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
159 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
277 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
164 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
265 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
280 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
225 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
2answers
799 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
163 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
584 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 ...
2
votes
1answer
102 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
559 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
482 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
376 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
321 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
226 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
214 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
10k 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
421 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
232 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 ...