Questions tagged [legend]
a legend in a graph helps the reader determine the correspondence between line style and data values
460 questions
3 votes
2 answers
139 views
pgfplots: Pick which scatter classes to show in legend
I have a plot with several scatter plots using the same classes. I want to add a legend, but only use one class in the legend, having one entry for each \addplot. How can I achieve this? Here's an MWE....
4 votes
1 answer
72 views
Unexpected border in legend with bar interval plots
I'm encountering unexpected behavior when using xbar interval or ybar interval plot styles with pgfplots. When I use the option draw=none, I expect no border to appear around the bars, including in ...
1 vote
1 answer
74 views
Combine the legend for the same line types
I need to avoid repetitions in the legend captions, so I want to draw two lines (red and blue) in the legend and add one signature to them $x^2$, then draw two more lines in the legend (red and blue) ...
3 votes
1 answer
100 views
Adding Hatching and Legend to Table Cell
Good day. I have made a table in Excel, and am trying to convert it to LaTeX. I am struggling to add hatching to cells, and to add the visual legend. I have tried using GPT and Gemini to help, but ...
2 votes
1 answer
63 views
Color not showing up properly in legend of Tikz picture graph
I am trying to plot a map of indifference curve for complements. Addlegendentry is not showing the proper colors in the legend key. How do I fix this? \begin{center} \begin{tikzpicture} \begin{axis}[ ...
2 votes
1 answer
65 views
How to show the legend color when there are multiple boxplots of one data and a single boxplot for another data?
I am having a problem with the right legend colour. I have two plots showing the data for Males and one plot showing the data for Females. However, the legend for Females shows black, whereas it is ...
1 vote
3 answers
128 views
How to add a legend for this graph?
My code is below. \documentclass[11pt]{article} \usepackage{tikz} \usetikzlibrary{patterns,arrows,decorations.pathreplacing,calc,intersections,through,backgrounds,plotmarks} \usepackage{float} \begin{...
2 votes
1 answer
75 views
tikz foreach loop variables in pgfplots legend in math mode
How do I use the variables of (nested) tikz foreach loops in the legend of a plot in math mode? This MWE fails: \documentclass[tikz]{standalone} \usepackage{pgfplots} \begin{document} \begin{...
1 vote
1 answer
77 views
Change (horizontal) line length for single legend entry in pgfplots
How do I change the line length of an individual entry in a pgfplots legend? I cannot use the solution provided here, as I also have other custom markers in the legend, and this screws up the vertical ...
3 votes
1 answer
73 views
Align line with caption in Tikz pgfplot legend
See how the red line is below the center of the caption? Is there a way to centrally vertically align the line of each item with the caption inside the legend? \documentclass[12pt]{article} \...
1 vote
2 answers
75 views
Aligning legend with figure width memoir class
I'm using the memoir class. Let's say I have a figure like this. \begin{figure}[htbp!] \centering \caption{Super-cool Figure} \label{fig:super_cool} \includegraphics[width = 0.7\...
0 votes
1 answer
51 views
shared legend position is not changed
\documentclass{article} % Standard package includes \usepackage{times} \usepackage{latexsym} % For proper rendering and hyphenation of words containing Latin characters (including in bib files) \...
0 votes
2 answers
73 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] \...
1 vote
2 answers
56 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{...
0 votes
1 answer
69 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 ...