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
35 views

PGFPlots - Legend box aligning with axis [duplicate]

I am trying to increase the size of the legend such that it exactly fits to size of the plot. But even after having a look at the PGF manual I could not figure out how I can realise my plan. ...
4
votes
1answer
45 views

justify legend enteries in pgfplots

I wanted to know how I can go about left aligning the legend enteries in my pgfplot. This is the effect I would like to have: Here is my code: \documentclass[tikz]{standalone} ...
5
votes
1answer
41 views

Move position of y-axis label and legend in pgfplots

I would like to move one of the y-labels to the second group of plots on the right and legend more to the center of the plots as shown here: Here is the code: \documentclass[11pt]{book} ...
3
votes
1answer
61 views

pgfplots legend with two ordinates (lines and bar chart)

In the legend, I would like to have a line for the red and orange lines (as it is the case), and ybar legend style for the rest. I just can't figure out the easiest/best/any way to do it. MWE: ...
1
vote
0answers
48 views

Adding vspace between x-axis label and legend generated with legend to name feature [closed]

I recently started working with pgfplots and now I am trying to generate two horizontally aligned plots using the same data. So I wanted to use one single, centered legend for both plots. It is all ...
1
vote
0answers
27 views

The location of figure in PNAS template mess up caption and legend

I am modifying this PNAS template (http://www.latextemplates.com/template/pnas) for my journal. I have been puzzled by the position of figure and its effects on caption position and legend indentation ...
2
votes
1answer
34 views

Remove marker from legend in pgfplot

In my code below, there is a marker in the legend. I just have two plots without any markers. How to remove these markers and just have the line be shown in the legend entry? Here is my code: ...
1
vote
1answer
74 views

change color of line in legend image (tikz pgfplot)

I want to change the color of the line in the legend image, because the line color in my plot is different to the mark color. \begin{figure}[h!] \begin{tikzpicture} \begin{axis}[legend pos=south ...
3
votes
1answer
58 views

More visible legend entries for only filled pgfplots bar chart

How can I get more visible legend images next to the textual legend entries A, B, C? The default for only filled bar charts seems to consist only of a hair thin vertical line, which makes it quite ...
1
vote
0answers
44 views

pgfplot - keep legends widthin \linewidth when the are set outside

I'm using pgfplots, but i want to have my legends next to the plot. This is easy by setting legend style and anchor. But i also want the plot to be as big as possible. So if my labels are to long, ...
1
vote
1answer
97 views

Multi-line legend entry in pgfplots

In some of my plots the curve description in the legend is too long, making the legend going over the plot, even if the legend is placed as far away as possible. Therefore I want to have multiple ...
3
votes
1answer
43 views

Pgfplot Legend Type

I need a legend type given below. I want to write parameter values just once. How can i get this type legend. code example \documentclass{article} \usepackage{amsmath} \usepackage{amsfonts} ...
1
vote
1answer
30 views

Using the tikzexternal.sty package together with legend to name feature

I am using the following TeX code (minimal example), which compiles fine, when running pdflatex then run make -f filename.makefile and repeat the procedure a second time to also include the referenced ...
5
votes
1answer
77 views

Move common legend to top right of plots in pgfplots

in my code below, I wanted some help to move my common legend to the top right of the plots like this: Can you assist me with this? Thanks. Here is my code: \documentclass[11pt]{book} ...
0
votes
1answer
21 views

Common Legend in pgfplot - having problems compiling

I am trying to get a common legend for the six plots that I have. I tried to implement the code found here, but could not get my program to compile. I tried to get the legend at the bottom of the ...
1
vote
1answer
109 views

PGFPlot : Relative positioning of legend according to axis

I am trying to move the legend of a PGFPlot above the top right corner, but using relative positioning like at={(current axis.above of north east)} in stead of manually giving a position like at={(1, ...
3
votes
1answer
102 views

tikz legend in caption and colorbrewer

Related to the question tikz legend in caption I want to use the colorbrewer library (just unzip the archive in the working directory). However, it seems that they cannot be used together. ...
1
vote
1answer
74 views

Change mark size in legend entry

I want the marks in the legend to be bigger than in the plot. But I'm facing the problem that if I use mark options in legend style, then I can't use it again in addplot. At the moment I get the ...
2
votes
1answer
161 views

Pgfplots legend style marker size

I have the following plot: \begin{tikzpicture} \begin{axis}[ xlabel={\tiny X}, ylabel={\tiny Y}, xmin=0, xmax=5, ymin=0, ymax=18, minor x tick num=4, minor y tick num=4, ytick={0, 2, ...
3
votes
1answer
61 views

Show line to the right of text in plot

By default, tikz shows the text in a legend to the right of the line as shown in the picture below. \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} ...
6
votes
3answers
194 views

How to reposition the legend?

Right now, it looks like this: I don't like that the box intersects the function graph. How could you reposition it? And I cannot see the label for the y-axis. Where has it gone? Could you also ...
2
votes
1answer
40 views

How to put a Legend under a figure?

In my document I got a figure with a lot of symbols in it like this: I want to add a legend to it, explaining all the symbols used. How do I achieve this? \begin{figure} \centering ...
5
votes
1answer
86 views

Split line in `legend` with `pgfplots`

In the following plot, how can I split the red line of the caption into a red line and a blue dashed line (so that the total length of the red-blue segment is that of the green one)? MWE: ...
3
votes
1answer
49 views

pgfplots legend disappearing with externalization

I have an issue with a combination of a special legend I am doing in a pgfplot, and with using tikz externalization. See the MWE below. The legend will not appear if I use externalization, but if I ...
6
votes
1answer
247 views

How to increase legend lines lengths in PGFplots

I want to know how I can make PGFplots to draw longer segments in the legend. I looked at couple of previously asked questions and none seemed to work for me. In this question: "adjust the legend ...
0
votes
1answer
142 views

How to only show legend in pgf plot?

I have created with matlab2tikz a standalone picture, saved in myfile.tikz Here is the code: % This file was created by matlab2tikz v0.5.0 running on MATLAB 8.4. %Copyright (c) 2008--2014, Nico ...
2
votes
0answers
23 views

Colorbar for lineplot using pgfplots [duplicate]

I am doing a lineplot with pgfplots. However, instead of the usual legend, I would prefer a colorbar, as I am basically trying to visualize a transition, and for that I chose colors in a gradient like ...
3
votes
1answer
449 views

Resize font in legend below \tiny

I have small graph in my presentation (I have to). To adjust the size of the legend, I have to use very small legend. But \tiny is not enought. Here is a MWE : \documentclass{beamer} ...
1
vote
1answer
42 views

clear me the doubt in positioning legend option

\begin{tikzpicture} \begin{axis}[ axis lines=middle, samples=100, ymax=5,legend pos=north east ] \addplot[cyan,domain=0.001:8] {abs(log10(x))}; \addplot[red!70!black,domain=-2:4] ...
4
votes
1answer
571 views

Why can't I move the legend position with PGFPlots?

I am trying to use PGFPlots to draw some graphics into my document, but I didn't manage to move the legend to the desired position. Here is the minimal code that I made: \documentclass{article} ...
1
vote
1answer
160 views

Background color of legend in graphics made with tikzpicture/pgfplots

I'm using tikzpicture and pgfplots to make graphics. And, I'm wanting a beamer presentation with black font and white writing. When I'm plotting the graph, the legend box is just a white box and I ...
3
votes
1answer
165 views

Showing legend for boxplot in pgfplots

I am trying to display a legend for a boxplot created in pgfplots. However the size of the legend is almost as large as the plot and covers up all of my plot, how do I fix this? ...
4
votes
1answer
253 views

pgfplot legend on top of grid but below graphs in axis as well as groupplot

Is there a way to specify the order of layers of elements in a pgfplots-axis? In my certain case I'd like to have the legend on top of the grid, but below the actual graphs: I know for this ...
2
votes
1answer
81 views

Adding a legend with connector to a picture with overpic and tikz lead to a misspositioning of the bottom left corner of the tikz picture box

I try desperately to make a macro which allows me to simply add a circled number with connector on a figure. To do that, I try to use into the command \put of overpic a tikz function which makes the ...
1
vote
1answer
151 views

Shared legend below a group of horizontally aligned figures in pgfplots [duplicate]

How should I run the following example code using /pgfplots/legend to name={<name>} to put a shared legend below a group of horizontally aligned figures? The example code using ...
2
votes
1answer
131 views

Legend entry not showing correct image

I don't know why the legend does not reflect the correct image for its respective entry. I want the last two entries to just show the marker and not the line (dashed line). I set the last two to just ...
4
votes
1answer
280 views

How to make a nice legend for a histogram with pgfplots

I am trying to make a histogram with the fitted curve plotted on it. Here's the mwe: \documentclass[a4paper]{scrartcl} \usepackage{tikz} \usepackage{pgfplots,pgfplotstable} ...
3
votes
2answers
108 views

latex - colorbox in caption as legend - how to center or alternative solution?

I have an image of a diagramm that I want to use as a source in my work. I have no possibility to create this diagram. So, I want to add colorboxes in the caption as a legend. here is my actual code. ...
3
votes
1answer
93 views

Changing arrow style between graph and legend

I want to have the arrows on the ends of the graph but have the legend just show straight lines (without arrows). MWE: \documentclass[12pt]{article} \usepackage{amsmath, amssymb} ...
1
vote
1answer
175 views

multi-Figure with pgfplots with one legend and rotation

I would like to have in a page two figures like the one the code below at the same page using subcaption and sidewaysfigure. The first problem is that probably there is a mistake at the position of ...
5
votes
1answer
530 views

Vertical spacing and item separation between entries in pgfplots' legend

One could find a lot of questions on how to change the horizontal spacing between legend entries in pgfplots, but I can't find anything on the vertical spacing between the entries. For example, when ...
2
votes
0answers
214 views

Legend entry for each point in scatter plot with matching color

I have a file with multiple columns, of which I create scatter plots where positions are given from column 1 vs column 2, while the mark color is based on column 3. I now wish to automatically create ...
6
votes
1answer
156 views

Add break node to plot in pgfplots

I was able to 'break' the vertical axis using pgfplots, but some issues came along with it: Most importantly, I can't find how to add the 'break sign' (the two parallel lines) to my plot as well, ...
6
votes
1answer
178 views

Custom area legend image not working

I'm trying to use the result from a fill between as a legend entry, but I can't get it to work: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} ...
2
votes
1answer
162 views

Am I properly inserting legends in groupplots? Labels “multiply defined”

I have a few places in my document where I use groupplot to insert several figures, but I only want one legend as it's common to them all. I've done this using legend to name=foo and then, after the ...
5
votes
2answers
446 views

Setting all nodes to use \sffamily without overriding font size

In my document, I want all labels in tikz and pgfplots graphics to use sans-serif, so I use \tikzset{every node/.append style={font=\sffamily}}. This works. However, when I use this, inside my axis ...
2
votes
1answer
363 views

Bar Chart Patterns in Legend

I have a groupplot with three bar charts using a common legend. This worked great when I was using color, but now I have to prep for publication in black and white. I'm not well versed at all in ...
1
vote
2answers
161 views

Different space between nodes for Tikz legend

I want to add a legend to my graph, explaining what different arrows mean. I thought I might be able to do it using coordinates, but the spaces between them are the same as spaces between the nodes ...
3
votes
0answers
200 views

Legend image arguments for the command `\addlegendimage`, 3d legend image

In the 3d plot I want to modify the third legend entry to only show the marks and not the line. From http://tex.stackexchange.com/a/113765/28093 I understood that I'm supposed to use something ...
1
vote
0answers
81 views

Selectively add legend entries to plot on large CSV

I have a plot with 63 lines, only some of which I would like legend entries for. The full legend takes up half a page, and using the \ref method does not give me consistency with the surrounding ...