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
2 answers
39 views

Weird issue with pgfplots legend deleting curly brace

When compiling the following \documentclass{article} \usepackage{amsmath} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[domain=-1:1] \...
user20478285's user avatar
1 vote
2 answers
29 views

Problem when using cases environment in pgfplots legend

I noticed that if I use cases from package amsmath in a pgfplots legend, the legend box does not contain the whole text. See the MWE. \documentclass{standalone} \usepackage{amsmath} \usepackage{...
Manuel Du 's user avatar
0 votes
1 answer
52 views

Adding legends to diagram lines on top of a graphics

I want to display my new results on top of a figure reproduced from an old paper. I experienced two major issues. 1.a/ If is use shifting and use \addlegendentry{My second} for a second time, nothing ...
katang's user avatar
  • 1,429
0 votes
1 answer
31 views

Package PGFPLOTS legend empty entry shift to left

I made a plot with 2 y-axis on the same x-axis. One one the left, one on the right. Thats the Code I used: \documentclass{standalone} \usepackage{siunitx} \usepackage{pgfplots} \usetikzlibrary{...
DoDo's user avatar
  • 3
1 vote
1 answer
29 views

How to merge legends of two y-axes in pgf plot?

I want to merge the two legends of this pgf plot, so that the second legend "This is legend two" is within the first legend box. Here is the MWE: \documentclass[ 12pt, a4paper, ]{scrbook} \...
Fantastic MsFox's user avatar
1 vote
2 answers
104 views

Creating a Common Legend for Subfigures with subcaption Package in LaTeX

I'm working on a LaTeX template, the elsarticle class from Elsivier, where I have two subfigures created using the subcaption package. I came across this answer which provides a solution for having a ...
Tien's user avatar
  • 135
1 vote
2 answers
66 views

How to add color and legends to bar chart

I am trying to create a simple chart using the code below: \begin{tikzpicture} \begin{axis}[ symbolic x coords={ Integrated Circuits, Transistors, Capacitors, ...
DEKKER's user avatar
  • 117
0 votes
0 answers
17 views

Place the text of a legend entry underneath the corresponding line in pgfplots

I have the following code, which brings me to the figure in the first image. Now I would like to place the text (in this example: exp(x) and x²+2x+1) of the legend entries underneath the red and blue ...
Alex's user avatar
  • 1
3 votes
1 answer
129 views

Rotate the symbol will cause it in legend not space rightly in 'pgfplots' in LaTeX

There is a symbol as triangle in pgfplots. As sometimes need the inverted triangle, I rotate it 180 degrees. It will work all right in the figure but not in the legend. \documentclass{article} \...
Y. zeng's user avatar
  • 1,883
1 vote
1 answer
87 views

Adding additional text in a legend

I am learning Tikz/Pgfplots and I am trying to recreate the following graph So far I have been able to come up with the following: \begin{tikzpicture} \begin{axis}[axis lines = center, axis ...
lorenzo's user avatar
  • 113
0 votes
1 answer
50 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.
xx y's user avatar
  • 1
1 vote
0 answers
39 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{...
TFK's user avatar
  • 11
0 votes
0 answers
17 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'...
fuj36840's user avatar
  • 550
0 votes
1 answer
120 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] \...
shefo's user avatar
  • 3
2 votes
1 answer
54 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} \...
Jeff's user avatar
  • 459
1 vote
1 answer
216 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{ ...
Yogesh Sharma's user avatar
3 votes
0 answers
53 views

How can I plot piece-wise function with legend using tikz? [closed]

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 ...
katang's user avatar
  • 1,429
0 votes
2 answers
78 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 \\ ...
Simon's user avatar
  • 303
1 vote
1 answer
101 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: \...
Michel's user avatar
  • 31
2 votes
2 answers
511 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[...
Daniel Valencia C.'s user avatar
1 vote
1 answer
125 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 ...
Ginko-Mitten's user avatar
0 votes
1 answer
210 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}[ ...
Jose A. Matarán's user avatar
0 votes
2 answers
66 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{...
user3713179's user avatar
2 votes
1 answer
410 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 ...
tgkolda's user avatar
  • 704
1 vote
1 answer
254 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 ...
Hannes Börngen's user avatar
4 votes
1 answer
95 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} \...
SampleTime's user avatar
1 vote
1 answer
59 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 \...
Majid Fard's user avatar
0 votes
1 answer
463 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, ...
user's user avatar
  • 4,755
1 vote
1 answer
43 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, ...
user17579347's user avatar
0 votes
1 answer
47 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 ...
Ioannis Kingdom's user avatar
2 votes
3 answers
350 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 ...
zetyty's user avatar
  • 777
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 ...
eenewbie's user avatar
2 votes
1 answer
688 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 ...
Jessica Walther's user avatar
2 votes
1 answer
251 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 ...
drachis's user avatar
  • 21
2 votes
1 answer
248 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 ...
Vika's user avatar
  • 405
0 votes
2 answers
2k 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}[...
FF-the learner's user avatar
0 votes
1 answer
487 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,...
CLAUDE's user avatar
  • 268
3 votes
1 answer
422 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 ...
Alex Heintz's user avatar
4 votes
1 answer
438 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 ...
Freon's user avatar
  • 127
1 vote
3 answers
500 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 ...
Kyle 's user avatar
  • 25
1 vote
1 answer
550 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 ...
lironT74's user avatar
0 votes
0 answers
80 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 ...
Pietro Saccardi's user avatar
1 vote
0 answers
863 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,...
paupau's user avatar
  • 11
1 vote
0 answers
141 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}; \...
Andre's user avatar
  • 11
0 votes
0 answers
75 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{...
Catarella's user avatar
  • 361
0 votes
1 answer
106 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 ...
Farouk Yahaya's user avatar
1 vote
3 answers
516 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{...
I Like to Code's user avatar
1 vote
0 answers
243 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 ...
dartacao's user avatar
1 vote
2 answers
58 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 ...
user241953's user avatar
4 votes
2 answers
200 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} \...
mdslt's user avatar
  • 503

1
2 3 4 5
9