Questions tagged [legend]

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

0
votes
0answers
20 views

pgplots: really bad displayed legend [on hold]

Despite I've give the legend pos=outer north east instruction, the legend is displayed weird near the origin of the axes \documentclass{article} \usepackage[T1]{fontenc} \usepackage{...
0
votes
0answers
22 views

pgfplots: How to add label to colorbar of 3D plot? [duplicate]

I want to add a label to a colorbar of a 3D plot. While adding labels to the axis is pretty easy, how to add it to the colorbar (which works as a z-axis in this plot)?? Minimum Working Example (MWE): ...
0
votes
0answers
36 views

Add text (that is not a plot) in a legend

I would like to make a legend that looks like this: Does anyone know how to do this?
1
vote
2answers
46 views

Pgfplots: Legend with multiple columns and rows, different entry widths

I have two data sets of five curves each that I want to display in one tikzpicture. The five curves of the first data set are solid lines, the five curves of the second data set are dashed. In the ...
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
27 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} \...
4
votes
1answer
52 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
26 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 ...
4
votes
2answers
62 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
41 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
40 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
53 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
27 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
69 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
33 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 ...
0
votes
0answers
33 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
76 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
28 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
39 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
180 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
34 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
58 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
52 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
88 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
212 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
40 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
32 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
44 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
289 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
113 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
166 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
87 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
349 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
89 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
196 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
64 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
80 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{\...
1
vote
1answer
91 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
95 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
84 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
360 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
327 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
115 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
511 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
79 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
104 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
408 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
380 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 ...