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
0 answers
23 views

Problem with the pgfplot legend markers/icon

I made the following stacked bar graphs. The graphs themselves are fine as they are, but now I got a problem with the legend/marker symbols. I want them to be singular squares, instead of the two ...
user avatar
  • 11
1 vote
1 answer
31 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 \...
user avatar
0 votes
1 answer
57 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 avatar
  • 4,325
0 votes
0 answers
23 views

one legend marker for two plots in pgfplots

I'm working on a pgf plot of a likelihood contour like so: \documentclass[margin=1pt,]{standalone} \usepackage{pgfplots,tikz} \usetikzlibrary{calc} \usetikzlibrary{shapes.misc} \tikzset{cross/.style={...
user avatar
  • 2,878
1 vote
1 answer
20 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, ...
user avatar
0 votes
1 answer
33 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 ...
user avatar
2 votes
3 answers
191 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 ...
user avatar
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 ...
user avatar
2 votes
0 answers
92 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 ...
user avatar
1 vote
0 answers
44 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 ...
user avatar
  • 11
2 votes
1 answer
53 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 ...
user avatar
  • 181
0 votes
2 answers
248 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}[...
user avatar
0 votes
1 answer
73 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,...
user avatar
  • 216
0 votes
0 answers
33 views

graph label in caption without using tikz

I created 4 graphs for a paper originally with tikz, and had the legend essentially in the caption. However, while trying to submit this paper, the portal of the specific journal says it doesnt ...
user avatar
3 votes
1 answer
91 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 ...
user avatar
4 votes
1 answer
52 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 ...
user avatar
  • 115
1 vote
3 answers
82 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 ...
user avatar
  • 25
1 vote
1 answer
75 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 ...
user avatar
0 votes
0 answers
32 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 ...
user avatar
0 votes
0 answers
42 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,...
user avatar
  • 1
0 votes
0 answers
16 views

How to separate each one of the legend entries

I need to make a plot and I wonder if there is a way to separate each one of the legend entries because I want to put each one in a different place. I mean, I don't want them to join in a square. I ...
user avatar
0 votes
1 answer
54 views

PGFPlot, Legend line and legend text isnt on the same level

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}; \...
user avatar
  • 1
0 votes
0 answers
59 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{...
user avatar
  • 321
0 votes
1 answer
47 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 ...
user avatar
1 vote
3 answers
72 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{...
user avatar
1 vote
0 answers
88 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 ...
user avatar
1 vote
2 answers
53 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 ...
user avatar
4 votes
2 answers
192 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} \...
user avatar
  • 447
2 votes
1 answer
48 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 = ...
user avatar
  • 23
0 votes
1 answer
117 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 ...
user avatar
  • 13
2 votes
1 answer
53 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 ...
user avatar
1 vote
1 answer
28 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} \...
user avatar
1 vote
1 answer
52 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,...
user avatar
  • 625
1 vote
0 answers
61 views

TikZ data visualization legends: reverse direction strategy or add empty entries?

I use the data visualization library of TikZ. I have a scatter plot with multiple sets. I have setup a preferred style sheet combination for the plot marks. These are ordered. I have also added legend ...
user avatar
  • 5,682
1 vote
1 answer
74 views

Custom legend order in pgfplots with externalization

I'm struggling with getting a custom legend order in my pgfplots groupplot. I tried this (esdd's answer) but I get the error Undefined control sequence. {\patchFailedError} Stefan Pinnow says one ...
user avatar
0 votes
0 answers
1k views

Matplotlib : Why doesn't legend font appear as Latex rendering

Below the PDF output generated by a Python script : As you can see, labels and title are correctly appearing as Latex rendering. Excepted the fact that Latex font is not applied for legend and I don'...
user avatar
0 votes
1 answer
68 views

Legend Position in a double-column paper

How can i change the legend position in a multi-columns paper? Is there anything wrong with my code? I would like to put the legend in the top center of those two figures. Thanks. \begin{figure}[t] \...
user avatar
  • 101
1 vote
1 answer
200 views

Include “contour” package into matlplotlib and set title using it

I transfer the initial post from stackoverflow since one said it is rather a question for Tex exchange (I am going do delete the initial one). Here is this post : In a matplotlib script, I try to ...
user avatar
3 votes
1 answer
69 views

How to change the width of the labelled area in legend?

I understood how to change the width of the plot lines in my legend, how can I get the same result for the area? Here I report my code that I wrote using tikzpicture: (I'm sorry for the large amount ...
user avatar
  • 33
1 vote
0 answers
39 views

Make pgfplots' legend look like an array [closed]

Is there anyway to make the legend of pgfplots look like an array? For example, assume that I want to make a legend look like this, where the legend is 2*2 array: PS: I am sorry that my figure is ...
user avatar
  • 216
1 vote
0 answers
184 views

PGFplots - Problem with "colorbar as legend" option

I have a problem when I use the option colorbar as legend : the displayed tick labels are incorrect. After looking in the PGFplots manual, I noticed that the example given also had this problem. Is it ...
user avatar
  • 281
-1 votes
1 answer
50 views

Move legend down a bit more

I have 2 questions: 1- How to lower the legend so it doesn't override the x-axis 2- How can I avoid the 5*10^-2 in the x-axis and get 0.05 \documentclass[a4paper,12pt]{book} \usepackage[T1]{...
user avatar
2 votes
2 answers
189 views

Add only one legend for all plots in a grouped stacked bar chart

I want to create a simple grouped stacked bar chart for 3 plots. Here is my code: \documentclass[tikz,border=5mm]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[ every axis/....
user avatar
  • 55
2 votes
0 answers
100 views

PGFplots - How to modify "line legend" style

I would like to know if it's possible to change the default legend style line legend. For one of my documents, I'm trying to redefine and harmonize (same width, etc) my legend styles (including line ...
user avatar
  • 281
0 votes
1 answer
60 views

Legend on top of Diagram left aligned with x axes

I have a set of Boxplot diagrams generated using Python3 (tikzplotlib). I would like to add legends now that are left aligned with the x-Axis and positioned on top of the diagrams. Currently I solve ...
user avatar
  • 165
2 votes
1 answer
68 views

How can I draw a fancy "proxy" legend line with pgfplots?

I have a couple of curves I am drawing in an axis, but one of them is a circle that is drawn with a "fancy" line (I just overlay a thick black curve with a slightly thinner white dashed ...
user avatar
  • 2,512
1 vote
1 answer
66 views

How to top-align PGFplots legend exactly flush with axis

My goal is to top-align the legend box with the plot so that it is exactly flush with the top axis frame. The following MWE works ok on first sight, but when looking closer, there is a small vertical ...
user avatar
  • 490
1 vote
1 answer
375 views

Add node colors and node shapes to legend in tikz-picture using forest tree and pgfplots

I want to add the elements of my tree to the legend (see the legend for description). I found this and this answer, but they do not explain how to add other shapes to the legend. I did not find ...
user avatar
  • 21
2 votes
1 answer
114 views

Tikz legend entry image - wrong line angle

I have a ybar tikzpicture with one horizontal line to mark a threshold. Unfortunately this line does not appear as a horizontal but as a somehow diagonal line in the legend. I tried some solutions by ...
user avatar
  • 23
0 votes
1 answer
47 views

Curves extends beyond the axis limits when plotting on added layers

I have encountered some problem while I was trying to change curves displaying order and at the same time maintaining the legend entries order. The curves order was changed as expected, however, they ...
user avatar
  • 75

1
2 3 4 5
9