6
votes
1answer
73 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
53 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
64 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 ...
1
vote
0answers
58 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
161 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 ...
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 ...
1
vote
1answer
94 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. ...
0
votes
1answer
227 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
183 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
618 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
155 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
379 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
94 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, ...
6
votes
2answers
340 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
292 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 ...
4
votes
1answer
193 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} ...
6
votes
1answer
7k 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
207 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
195 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
131 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 ...
8
votes
2answers
417 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} ...
5
votes
0answers
237 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
217 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
160 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
150 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
220 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 ...
4
votes
1answer
320 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
3k 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
836 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
491 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 ...
4
votes
1answer
681 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
540 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]{ ...
5
votes
1answer
773 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 ...
6
votes
1answer
263 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
515 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 ...
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 ...
2
votes
2answers
848 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 ...
9
votes
1answer
6k 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 ...
11
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 ...
2
votes
1answer
601 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 ...
2
votes
1answer
872 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$, ...
16
votes
1answer
3k 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 ...
14
votes
1answer
2k 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 ...