Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [legend]

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

1
vote
1answer
14 views

Legend entries labeled incorrectly with two

I have a graph with three plots and two y-axes. Two of the plots use the left y-axis and one uses the right y-axis. In order to get a single legend with all three plots, I am using the ideas in this ...
2
votes
0answers
22 views

pgfplots: How to align plot width to same width as legend when compiling external?

The user marmot has posted a nice approach on how to adjust the plot width to the legend width. Minimum Working Example (MWE): \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \...
2
votes
1answer
33 views

Legend in pgfplots

I don't really like how my legend is showing up, there is no space between the line and the text in the legend and i don't know how to rectify it. I set the font to \tiny in my legend style but it ...
0
votes
0answers
11 views

space between legend images of variable length and text entries

I have a two-column legend with variable image entries, namely solid lines and markers used in a scatter plot. I left aligned the legend content, but while this option aligns the text entries to the ...
0
votes
0answers
24 views

specialized legends aligned with changing text margins in two-sided documents

I have a figure with multiple subfigures and tikz-type of figures therein. This figure contains a \pgfplotslegendfromname{named} type of legend. This legend, which is wider than the text width, is ...
5
votes
2answers
58 views

pgfplots: How to align plot width to same width as legend?

The user marmot has posted a nice approach to put a legend below a multigraph diagram. Minimum Working Example (MWE): \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \usetikzlibrary{...
4
votes
1answer
30 views

Pgfplot - How to exactly align the legend in a plot

I have a legend in my pgfplots and want to manually position it at a point where the legend does not cover any text or measurement points. I know the axis property legend pos=north west, but it's not ...
0
votes
0answers
24 views

pgfplots: Is “scale only axis” only necessary for documents but not for standalone?

Assumed we have this kind of code: Minimum Working Example (MWE): \documentclass{article} \usepackage{showframe} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[height=\...
1
vote
1answer
42 views

pgfplots: How to control and align legend items precisely above each other?

The user marmot has posted a really nice approach of adding legend items into one single box below a multigraph diagram by placing them inside a \node. Based on this initial situation I have tried to ...
3
votes
1answer
25 views

pgfplots: How to align legends of multigraph diagram?

Assumed we have the following MWE to display various graphs in one single diagram. Minimum working example (MWE): \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=...
1
vote
1answer
63 views

how to fill the area under a curve

I can not find a way to fill the area under these 3 curves and the legend doesn't seem to show the correct line colours (the red one is missing?). Thanks. \documentclass{article} \usepackage{amsmath} ...
2
votes
1answer
31 views

PGF plot legend placement error

I am currently trying to relocate the legend of my plot at the top left corner. But as soon as I set the command [legend pos=north west], the legend is relocated, but the grid lines are not rendered ...
1
vote
0answers
29 views

Copy of series in legend for prepared boxplot

When I add a legend entry to a boxplot prepared plot, I get an identical copy of the box plot (which may be huge!) in the legend. How can I fix this? As a workaround, I am currently adding area legend ...
2
votes
1answer
61 views

pgfplots: trim axis breaks legend positioning

I have a figure that should be centered and contain three plots. One at the top, one at the bottom-left and one at the bottom-right. I used one tikzpicture with a regular begin{axis} for the top plot ...
1
vote
1answer
23 views

Legend customisation in groupplot

I have a groupplot in which each plot shows only part of the data--the first shows one out of five datasets while the second shows the remaining four. For space and aesthetic reasons, however, I want ...
1
vote
1answer
29 views

Histogram with Markers, Marker Nodes and Legend Not Displaying Everything Correctly

I am still kinda new to TEX. I am currently working on a paper submission, however I am having trouble properly combining markers, node labels for the markers, a legend and a histogram all in the same ...
2
votes
2answers
109 views

legend style customization in pgfplots

I have this bar graph, and I want to do 3 things: Remove the numbers in the bars, they are overlapping (If possible keep only one, symbolizing that both bars have the same value); Within the frame of ...
2
votes
1answer
31 views

Align units of equations and units of corresponding legends below each other

I am using this code to align equation units of right the equation and to create nice equation legends. Minimum Working Example: \documentclass{article} \usepackage{amsmath} \usepackage{booktabs} \...
3
votes
1answer
45 views

Adding legend entry for border of fill, from fillbetween

I've made a plot like the one below to show a distribution of values in the dependent variable versus the change of the independent variable. \documentclass[varwidth]{standalone} \usepackage{pgfplots}...
0
votes
1answer
42 views

Missing } inserted. in legend refernce. error during 2nd compilation

I am running into the following problem and hope that you can help me as my dead line is just around the corner and suddenly i have got this problem. I am using Texmaker with Miktex and i try to ...
3
votes
1answer
75 views

How to scale (enlarge) a legend in tikzpicture?

I am using this Symbols in my work. I am trying to add a legend to this code to annotate the graph. I found this code Legend in Tikzpicture So I have now the following code: \documentclass[tikz,...
3
votes
1answer
45 views

Shading Tikz Picture Layout

I am trying to plot functions and shade in between them. Here is the code: \documentclass[a4paper, 12pt]{article} \usepackage[dvipsnames]{xcolor} \usepackage{amsmath} \usepackage{pgfplots} \...
5
votes
2answers
197 views

Create legend for heat map

I have the following piece of code that colors words according to some value: \documentclass{article} \usepackage{xcolor} \begin{document} \colorbox{blue!0}{\strut test} \colorbox{blue!10}{\strut ...
1
vote
1answer
37 views

pgfplots - more symbols in same legend line (with same legend text)

I have the following PGFPlots (mini sample). \documentclass[11pt, a4paper, twoside]{scrreprt} % [11pt, parskip]{scrartcl} \usepackage[utf8]{inputenc} \usepackage[colorlinks = true, citecolor=black, ...
0
votes
1answer
28 views

Stopping table legend running over end of page when using longtable

My tables are formatted with a title at the top and a sometimes long legend at the bottom. When using a longtable, because there can be a page break at any point of the table, it is possible to have ...
0
votes
1answer
40 views

Curve fitted parameter appears as 0 in legend (pgfplots, gnuplot, pgfplotstable)

I fitted a curve on a dataset, but parameter c remains always 0 in the legend of the plot's fitting equation. Can you please help me why? I also checked the generated parameter.dat file and it ...
1
vote
1answer
184 views

pgfplots: change legend text color according to plot fill color

I have a (large) set of graphs with (multiple) lines/fills in a large document. The style generally corresponds to the MWE picture below. Many relevant style parameters like colors and line sizes etc. ...
4
votes
2answers
109 views

Adding legend to a Markov chain

I am trying to add a legend to a Markov chain I created using Tikz library. The picture and code are attached. I checked some possible solutions but they didn't work out. I would appreciate if someone ...
3
votes
1answer
144 views

create a standalone legend for a grid of plots

This question somewhat relates to Using a pgfplots-style legend in a plain-old tikzpicture I'm looking for a better way to do the following. I'm generating a huge amount of data, and from the data I'...
1
vote
1answer
74 views

Add a rectangle image to a pgf legend

I am making a rather simple tikzpicture which is a combination of a pgfplot and a sketch. The code is the following \documentclass[border=10pt,tikz]{standalone} \usepackage{pgfplots} \usetikzlibrary{...
2
votes
1answer
271 views

PGFplots-legend: Left-align text entry with its first respective entry below

Following-up my previous question, I would like to left-align both text entries with their first ones below them, respectively. In other words, I need to move text to be left-aligned with yy=x^2 and ...
2
votes
2answers
87 views

Legend out of scope of a graph

Trying to plot the following graph with legend with in the scope of a graph. Please advice. \documentclass[border=5mm]{standalone} \usepackage{graphicx} \usepackage{epstopdf} \usepackage{tikz,...
3
votes
2answers
173 views

PGFplots: How to align the equations of the legendentries at the equal sign?

How to align the legend equations at the equal sign knowing that this code shows the following error Missing } inserted. \end{axis} ? \documentclass{standalone} \usepackage{pgfplots} \...
3
votes
1answer
62 views

Incompatibility between marks on curve and legend

I have a new star style defined in pgfplots. The positions of the stars on the curve is correct but in the legend is wrong. The code and figure are below. The position of the star in the legend is ...
3
votes
1answer
64 views

Pgfplots only legend entries with cycle list

I would like to generate only legend with a cycle list for patterns in pgfplots. This is the code I have. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \def\mystrut{\...
2
votes
1answer
78 views

legend for multiple externalized tikz

I need to externalize the two tikz images inside the code below as PDF (for a journal article) and then read these PDFs, as well as add a single legend for both from outside by using \...
2
votes
1answer
73 views

Pgfplots: wrong legend image

Convince yourself about the color and image of the marker and line (where there should only be one at the time). Effectively the color and marker/line stay at the default value even though specified ...
1
vote
1answer
80 views

Adding a Legend to a Histogram

I created the following histogram but all labels were messed up. \documentclass{standalone} \usepackage[T1]{fontenc} \usepackage{pgfplots} \pgfplotsset{ compat=newest, xlabel near ticks, ...
2
votes
2answers
301 views

pgfplots legend symbol / icon

I have made the following graph. I would like the icons / symbols for the different legends, to be more than a small line. I want it to be a square with the fill color in the graph. The code is the ...
3
votes
1answer
295 views

Problem with legend position

I have been using the tikz package to plot my graphs. When I want to describe each graph in a plot, I use "legend entries" and using "legend pos" I can manage the box describing the graphs. But now I ...
0
votes
1answer
90 views

Two legend images for one marker in pgfplots

A similar question has been asked here: Pgfplots: let legend show two linestyles I have a two figures side by side that are plotted in different colors but share the same legend. I would like the ...
2
votes
2answers
407 views

Addlegendentry doesn't show properly the color in the legend of the plot PGFPlots

Please consider the following MWE: \documentclass[11pt,twoside]{article} \usepackage[spanish]{babel} \usepackage[utf8]{inputenc} \usepackage{pgfplots} \usetikzlibrary{arrows.meta, patterns} \...
2
votes
1answer
70 views

Use of “legend to name” in tikzpicture generates extra pdf pages

I use tikz for a graph and just want to put a legend outside of my plot and convert the picture into a single pdf to include this in my Tex document. (Instead of input the tikz file to my Tex ...
3
votes
1answer
92 views

Help to dual Y axis, dual stacked plot

The B means the block will be Blue, R means Red, Y means yellow, etc ... In plot, it will not be written, it represents only the colour of the plot. Related Link MWE: \documentclass{article} \...
1
vote
1answer
351 views

How to increase the length of a legend box in PGFPlots [duplicate]

If I have a legend using PGFPlots too long near the right margin of the document I can not see part of it. How can I insert a line break inside the legend, or adjust the length? (The legend is on the ...
7
votes
2answers
354 views

Filled curved in legend entry - tikz/pgf

I am trying to make a simple plot in pgfplots that consists of a curve with a filled area below it and vertical dashed lines that divide the area below the curve in sections. A simple output can be ...
2
votes
1answer
106 views

How to place legend in a suitable position in the following tikz diagram?

I have the following code for a tikz diagram. Instead of labeling all edges individually, I want to put a legend box for similar colors representing the edges. In this diagram the legend box will ...
3
votes
1answer
387 views

pgfplot legend with fill, of fill between two curves

I would lie to make a legend where the legend marker is the fill of the area. However, when filling between two curves in pgfplots the lines are defined before the fill, so I have idea how to do this. ...
1
vote
3answers
700 views

Get legend outside plot on tikz and customise axis labels

I've made a schematic plot in tikz with the below code. \begin{tikzpicture} \pgfplotsset{ticks=none} \begin{axis}[ xlabel=$Treatment$, ylabel=$Level of donation$] \addplot[smooth,mark=*,blue] plot ...
1
vote
1answer
120 views

pgfplots: Centering a row in legend

For the following MWE, I would like to: center the legend image of the long entry with its text, expand the legend box to encompass its entries, and center the second row of entries with respect to ...