Questions tagged [legend]
a legend in a graph helps the reader determine the correspondence between line style and data values
443
questions
0
votes
1
answer
37
views
How can I change the image size in a legend on pgfplots?
I need the small picture as large as the word.But I didn't find how.
1
vote
0
answers
28
views
How Can I change the legend positon
I would like to change the position of the legend, modifying the current position by placing it below and centered between the graphic (c) and (d).
\begin{figure}
\begin{tikzpicture}
\begin{...
0
votes
0
answers
14
views
PGFPfots: Filled marker does not correspond with legend
I have two files from which I want to create a single scatter plot. For the marker, I use the meta option to give them a specific style based on a string value. However, the legend and the markers don'...
0
votes
1
answer
40
views
How to change color of text in legend of pie chart in overleaf
I would like to change the color of the text 7.91-6.33 in figure A's legend and the text 73169 - 60901 in figure B's legend to red.
Please any help would be really appreciated.
\begin{figure}[htbp]
\...
2
votes
1
answer
37
views
Adding legends to a pgf plot with table
I need to add a legend to each color in the plot. Like, inserting a box inside the plot that has the color and its name:
How can I do that?
MWE:
\documentclass{standalone}
\usepackage{subcaption}
\...
0
votes
0
answers
12
views
color scatter points (bubbles) based on column of data set and print only the used legend entries
My question builds on How to colour scatter points and create legend entries based on a data type column
and I just copy the answer from @Symbol 1 :
\documentclass[border=9,tikz]{standalone}
\...
0
votes
0
answers
32
views
bubble plot in tikz (pgfplots): add legend corresponding to bubble sizes
Given the minimal working example provided in Bubble Plot in tikz with size depending on value and color defined by a fixed group ,
I want to add a bubble legend like it can be produced in Matlab and ...
0
votes
1
answer
42
views
Placing legend in upper left corner of bar graph
Want to place the legend in the upper left corner of the bar graph. Following is my code
\documentclass[lettersize,journal]{IEEEtran}
\usepackage{pgfplots}
\usetikzlibrary{patterns}
\pgfplotsset{
...
3
votes
0
answers
44
views
How can I plot piece-wise function with legend using tikz?
I have a piece-wise function (actually, some points connected with a line in a region) and I want to add a legend. My problem is that if I add several \addplot segments, the \addlegendentry displays ...
0
votes
0
answers
23
views
\addplot graphics gets mark in legend with no markers in axis options
I am preparing a rather complex report with many plots. For some I need to plot data with Scilab and include the graphs as PNGs, because the data represents measurements with 1Hz or even 100Hz, ...
0
votes
0
answers
21
views
Adding a figure in Tikz plot is recognized as a legend marker
To my previous question which can be found in the link here: Plots lines disappear in Tikz when inserting an image
The plot that appear after compiling with the command \addplot graphics [xmin=-3,xmax=...
0
votes
2
answers
57
views
cell color in a table -- add legend somewhere under the table to explain the meaning
\documentclass{article}
\usepackage[table]{xcolor}
\begin{document}
\begin{table}
\caption{a table}
\begin{tabular}{c c c c c c}
\cellcolor{blue!=10} 1 & 2 & 3 & 4 & 5 & 6 \\
...
1
vote
1
answer
51
views
In pgfplots how to set the length of the legend
I have made a graph in LaTeX using pgfplots, but when I include a system of equations into the legend, the legend length becomes too small. And I can't seem to increase the legend length.
My code:
\...
1
vote
1
answer
140
views
How to fix the caption spacing in tblr and talltblr environments from the tabularray package?
The spacing between the text and the table legend is different between the tblr and talltblr environments. In MWE this difference can be observed.
\documentclass[12pt,a4paper]{article}
\usepackage[...
1
vote
1
answer
52
views
Remove unwanted entries from Legend in pgfplot
I am trying to combine a box-plot with the actual points to show distribution. Furthermore, the marks used for the points depend on whether the treatment it represents was positive (marked x) or ...
0
votes
1
answer
76
views
Unknown error using legend entries
I'm having trouble with my tikzpicture. I have the following code:
\begin{center}
\begin{tikzpicture}[scale = 1]
\begin{axis}[
...
0
votes
0
answers
70
views
pgfplots: Legend for markers choosen by point meta in a scatter plot
What I made
I am using point meta to colour the points of a scatterplot according to a label, as shown by the MWE and the screenshot below. I am however struggling to make a legend mapping the colour ...
0
votes
2
answers
44
views
Handling with customlegend style
How can I do so the size of the customlegend box adapts to its content?
\documentclass[12pt]{article}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepgfplotslibrary{...
2
votes
1
answer
228
views
pgfplots legend marker scale
The legend of my scatter plot is not picking up the sizes of the markers that I'm using. I'm being extreme here so that the difference is obvious. I'm hoping to understand how to get the sizes to be ...
1
vote
1
answer
181
views
Alignment of pgfplot inline legend in body text and caption
I would like to use pgfplots' "legend to name" feature to reference the (named) legend in the caption of the respective figure environment.
Additionally, it would be nice to be able to put ...
4
votes
1
answer
69
views
Multiple text alignments in TikZ legend entries
I am looking for a simple way to have multiple alignments in a TikZ legend.
I have the following code which produces a TikZ figure:
\documentclass[11pt,a4paper]{article}
\usepackage{pgfplots}
\...
1
vote
1
answer
47
views
Select from a set of inputs_ Legend line style_ Grid style legend
I have a \foreach loop in the following macro to create a legend box for my radar chart. First, how can I make legend to be in two columns and two rows? Second, I have used the 4th input of the \...
0
votes
1
answer
293
views
How to fix Undefined control sequence \caption@setlabelseparator with TexLive 2022?
I am trying to use again the answer from this question of mine from 2019 (Misplaced \noalign. \captionsetup ->\noalign when using \captionsetup inside memoir \legend command) with Tex Live 2022, ...
1
vote
1
answer
31
views
pgfplots, distinct legend for each groupplot
I'm trying to have distinct legends placed below each of the groupplots. I'm using the following code:
\begin{tikzpicture}
\begin{groupplot}[
group style={
group name=my plots,
...
0
votes
1
answer
45
views
pgfplots - legend entries not recognised as array when passed as a defined variable through keyval
I am plotting a graph in pgfplots, and would like the legend entries to be passed as a defined variable. In the code below, the first example does this, but does not work (all entries come through on ...
2
votes
3
answers
300
views
How to get "inner" auto-positionning of a TikzPicture legend?
EDIT 2 (Feb 20): New question (hopefully clearer)
With pgfplots it's possible to obtain "inner" and "outer" figure legend (see Paul Gessler's answer) as:
I would like to achieve ...
1
vote
0
answers
19
views
Multiple Linear Regressions, Legend does not work [duplicate]
I am working on a diagram with tikz. There are two linear regressions in the diagram, but \addlegendentry does yield weird results for the second plot. Instead of the red star (which i would have ...
2
votes
0
answers
432
views
Pie chart with legend position south
I tried the legend to the south code from this question (see code below): Pie chart with joined legend position
but it unfortunately does not work.
If i change yshift to a fixed value it work. BUT ...
2
votes
0
answers
167
views
tikz pgf - Use multiple images for one legendentry
I have a plot in which I am showing experimentally obtained data and different models for the data. In order to keep the legend clean I want to summarise slightly different versions of the same model ...
2
votes
1
answer
134
views
Tikz plot: legend and markings
I need to
put a mark on the x-axis at the point of maximum to indicate x=75.
place a legend in the top left corner (above the graph to indicate "$\mu = 5$").
How can I do that with this ...
0
votes
2
answers
1k
views
How to add a legend next to a figure in latex
I created a 4-subfigures figure:
\begin{figure*}
\begin{subfigure}[b]{0.4\linewidth}
\includegraphics[width=\textwidth]{1.png}
\caption{1}
\label{fig:1}
\end{subfigure}
\hfill
\begin{subfigure}[...
0
votes
1
answer
298
views
Legend-cell alignment in pgfplots
Consider the LaTeX code
\documentclass{standalone}
\usepackage{tikz,pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[legend columns=2,
legend style={at={(0.5,1.02)},anchor=south,...
3
votes
1
answer
279
views
Legend with marks and loosely dashed
I have a problem with the visibility of the mark denoted by X in my legend, using a loosely dashed line. How I can make it more clear, e.g. by shifting the dashes a little to the right? (so that the ...
4
votes
1
answer
231
views
Splitting a graph legend into two legends
Im trying to split a single long legend into two legends. However, the way i did it just filled in the entire line. The is what im trying to achieve: (I think it would be better if those icons were ...
1
vote
3
answers
230
views
Global Legend for Different Plots
I have several axis environments that form an array of plots. Sometimes these different axes environments have the same data plotted, other times they have different data sets plotted. I would like to ...
1
vote
1
answer
337
views
Adjusting axes so graphs and legend do not overlap
I would like to add a legend to a graph, and automatically adjust the graphs so the legend won't overlap with them. The legend must stay inside the axes area. Currently it looks like this:
And I ...
0
votes
0
answers
62
views
Mathtools and PGFPlots conflict: `centercolon` and `addlegendentry` do not compile
I am using \mathtoolsset{centercolon} in a document, together with PGFPlots. I noticed that if I insert a colon in the \addlegendentry command, the document keeps compiling forever and never produces ...
0
votes
0
answers
512
views
Change font size in legend
I have the following tikz plot figure.
I want the legend to have a smaller text.
I would prefer to just scale it by 0.5.
Is there any easy way to do that?
Thanks in advance!
\documentclass[10pt,...
1
vote
0
answers
137
views
PGFPlot, Legend line and legend text isnt on the same level [closed]
I have the following code:
\begin{tikzpicture}
\begin{axis}[legend style={at={(0.5,-0.1)},anchor=north}]
\addplot {x};
\addlegendentry{$x$}
\addplot {x^2};
\...
0
votes
0
answers
70
views
Pgfplots and Groupplot: Legend Management
I have the following MWE:
\documentclass{article}
\usepackage[dvipsnames]{xcolor}
\usepackage{pgf,pgfplots,pgfplotstable}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{colormaps}
\usepgfplotslibrary{...
0
votes
1
answer
70
views
How can I create a legend of an envelope plot?
I making envelope plots which shows the minimum median max of my values. but when i try to create a legend it doesnt pick the median which has the right color as seen in the image below:
MWE for your ...
1
vote
3
answers
251
views
PGFPlots: How do I add a legend to a plot drawn manually (not using \addplot)?
I'm making a plot using rectangles that I drew manually,
instead of using the standard plot types defined in PGFPlots.
Here is an MWE:
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{...
1
vote
0
answers
209
views
No colors in marks on pgfplots legend, using groupplots and standalone? [closed]
I'm trying to make an image with 2 groupplots, and a single legend.
Issue #1 should be evident: the legend is showing up to the right of the plots, not below them. < This has been solved using a ...
1
vote
2
answers
56
views
Automatic Report Printer: Handle long technical expressions in TOC and legend entries
I'm currently programming a automatic printer with Latex for some technical reports. The whole printer can be controlled and launched from an external programm which provides csv-files and Data which ...
4
votes
2
answers
199
views
Legends become identical in pgfplot
I have a code like below, but I am not sure why its legends become all blue and with a similar sign. Would you please help me to resolve this problem?
\documentclass{article}
\usepackage{pgfplots}
\...
2
votes
1
answer
105
views
Problem with legend image in ybar combined chart
i have problem with legend image in ybar combined chart. The last entry is not dashed line. Is there any options for addlegendimage to solve this?
\begin{tikzpicture}
\begin{axis}[
ybar = ...
0
votes
1
answer
269
views
multicolumn in tikz legend
I have a simple task, which I couldn't find a solution for so far.
I have a plot with 3 legend entries, 2 short ones, and a long one. I can use legend columns=2, to get a two-column legend but it ...
2
votes
1
answer
65
views
PGF/TikZ: Align legend nodes in TikZ picture with plots below
I have a bar plot with three legends above each group, which I want to align. The first legend should be left, the second in the middle and the third right. I set each anchor to south west, south and ...
1
vote
1
answer
43
views
Insert legend in a looping PGFplots
I want to intert the legend for my picture iteratively. My code is:
\documentclass[11pt,border=10mm]{standalone}
\usepackage[portuguese]{babel}
\usepackage[utf8]{inputenc}
\usepackage{tikz,pgfplots}
\...
1
vote
1
answer
85
views
Add an arrow in the legend of a tikzpicture
I'm trying to add an arrow in the legend entries of the following pic:
which I obtained with the following code:
\begin{figure}[hbt!]
\centering
\begin{tikzpicture}[scale=0.9]
\begin{axis}[xmin=1,...