The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [legend]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
42 views

Simple legend box below multiple TikZ pictures

I have three subfigures in a figure, each has three TikZ pictures inside and a caption. Now I would like to add a legend for all TikZ pictures together. I searched through other posts and tried ...
2
votes
2answers
40 views

How to insert a vertical line as legend entry for a vertical graph

I have two graphes, one horizontal (y1) and one vertical (y2) line. For a better identification in the legend, I want the vertical graph (y2) also to be represented by a vertical line in the legend. ...
0
votes
0answers
24 views

Pgfplots: Two legends for scatter plot with multiple plots and classes [duplicate]

I need to create a detailed scatter plot. It contains two different plots, each with several classes - each plots can contain upward of 1000 coordinates with varying levels/classes in each. There may ...
2
votes
0answers
49 views

Why does a nan-only plot lead to an error when requesting a legend

Let me first admit that this may be a really dumb question. I am using matlab2tikz to export some figures from matlab. As I need some legend entries to be unrelated to my actual plots, I use nan-...
0
votes
1answer
26 views

pgfplots: How to make a legend entry span and centered in an entire row of the legend matrix?

How to make the legend entry of x span and centered in the entire first row while continuing printing the rest of entries in the subsequent rows and columns? \RequirePackage{luatex85} \documentclass{...
0
votes
0answers
17 views

How to make legend in tkzKiviatDiagram?

I drew a radar chart using tkzKiviatDiagrm. \begin{figure} \centering \caption{Caption} \label{fig:my_label3} \begin{tikzpicture} \tkzKiviatDiagram[scale = 0.75, label distance = ....
0
votes
1answer
52 views

How to add a new color in a plot?

I have a plot where there are multiple legend entries. The colors rotate to different colors for 6 legend entries. After that, I have a repeat color. How do I specify a new color for the 7th entry (in ...
0
votes
1answer
46 views

Seeking Beamer Template Similar to Presentation Below

I'm a really big fan of this presentation style https://www.archer.ac.uk/training/course-material/2014/04/PMMP_UCL/Slides/castep_1.pdf and I'm wondering if anyone has come across the sort of ...
3
votes
2answers
96 views

Figure with one caption below and one caption/legend on the side

I'm looking for a way to add a legend to the side of my image, while still keeping my caption below. I currently have the following code: \begin{figure} \centering \includegraphics[height=4cm]{...
2
votes
1answer
87 views

Pie chart with joined legend position

I'm a LaTeX rookie so I'm hoping someone will be able to help me. I've been stuck with this figure for quite some time and haven't found a solution. Specifically, I have made 2 pie charts next to ...
1
vote
1answer
179 views

PGFPlots: Align outside legend with neighbouring subfigures

I'm using pgfplots with tikz's external library for my graphics, and I must use the subfigure package for compliancy reasons. As you can see in the mwe below (part "Attempt 1"), inside a figure* ...
1
vote
2answers
66 views

How to center a plot with outside legends

I would like to center a plot with outside legends, but the whole figure gets centered (plot with legends). The position of the plot should be like the outside legend is not there. \documentclass{...
0
votes
0answers
29 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): ...
1
vote
2answers
174 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
31 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
32 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
74 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
29 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
75 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
59 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
60 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
86 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
37 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
71 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
41 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
58 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
106 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
32 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
58 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
276 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
37 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
89 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
69 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
151 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
48 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
244 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
46 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
37 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
53 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
442 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
116 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
230 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
131 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
454 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
91 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
252 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
65 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
119 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
108 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 \...