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
0answers
6 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 ...
0
votes
1answer
20 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}; \...
0
votes
0answers
45 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
1answer
29 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
3answers
39 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
0answers
23 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
2answers
50 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
2answers
191 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
1answer
30 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
0answers
18 views

Placing text above/below example line in legend

I have a graph with multiple lines and am trying to figure out a way to move the resulting large legend out of the way in a good way. Right now it's placed underneath the graph but since I'm working ...
0
votes
1answer
61 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
1answer
41 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
1answer
27 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
1answer
35 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,...
1
vote
0answers
31 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 ...
1
vote
1answer
44 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 ...
0
votes
0answers
433 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'...
0
votes
1answer
34 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] \...
0
votes
0answers
39 views

Matplotlib same LaTeX format for text and float-to-string part

I am trying to work on the legend of my graph: As you can see that I used the dollar symbol for timestep to make it latex (I hope I am not wrong) but I am unable to get the same font/format for the ...
1
vote
1answer
126 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 ...
3
votes
1answer
54 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 ...
1
vote
0answers
28 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 ...
1
vote
0answers
124 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 ...
0
votes
0answers
15 views

How to fix mark position inside legend in pgfplots

I got this figure: \begin{figure}[H] \centering \begin{tikzpicture}[scale=1.2] \begin{axis}[axis lines = middle, mark=square*, xlabel = {Millas}, ...
-1
votes
1answer
40 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]{...
0
votes
0answers
21 views

putting a legend outside, on a line [duplicate]

how can I put a legend outside on a single line under the x axis \documentclass[a4paper,12pt]{book} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english,italian]{babel} \...
2
votes
2answers
68 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/....
2
votes
0answers
66 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 ...
0
votes
1answer
41 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 ...
2
votes
1answer
55 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 ...
1
vote
1answer
37 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 ...
1
vote
1answer
169 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 ...
2
votes
1answer
63 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 ...
0
votes
1answer
45 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 ...
2
votes
1answer
111 views

pgfplots: trim axis in tikzpicture messes up legend position

So I will begin this question by linking to an existing unanswered question on the same matter: Link. I am unsure if I should revive the old question or post a new one, so I just ended up making a new ...
0
votes
1answer
153 views

Scatter plot: Legend and line color don't match

I've defined the colors of the scatter plot based on the value of a data column. In addition to the values themselves, I'm plotting the mean, which has its separate column. However, the mean plot and ...
0
votes
2answers
100 views

How to create a legend with TikZ?

I would like to know how I can create a color legend as shown in the figure. \definecolor{BrightGreen}{rgb}{0.4, 1.0, 0.0} \begin{tikzpicture}[scale = 0.7] \tikzset{roundnode/.style = {thick, draw = ...
0
votes
1answer
148 views

Legend for each part of a piecewise function using PGFPlots

I'm trying to either include a legend that labels will label all three pieces of the function inside the tikzpicture, or figure out a way to cleanly label the graph outside of the tikzpicture. I was ...
2
votes
1answer
61 views

Line break in legend from tikzplotlib generated plot

as you can see my legend is that big that it is impossible to place it without covering the actual plot. I already reduced the font size. I would like to get a line break in the legend in order to ...
2
votes
1answer
163 views

Wrong line color in pgfplot legend

How can I make sure the line through the brown square in the legend (to be clearer, at R^2) is green, just like the straight line of the graph? That's my minimal working example: \documentclass[12pt]{...
3
votes
1answer
166 views

Make PGFPlots legend look similar to ggplot2

I have attempted to make a pgfplot that resembles the R ggplot2 design to my liking (in Overleaf): ggplot2 reference: pgfplots: \documentclass[10pt]{article} \usepackage{fontspec} \usepackage[...
0
votes
1answer
39 views

Adjusting Value Range on x-axis in pgfplots

The value range on the x-axis is not using the values from my data. How can I adjust the range data to let's say 2000' steps, i.e. 0, 2000, 4000, ..., etc.? \documentclass{standalone} \usepackage{...
1
vote
2answers
95 views

Latex: Two bar charts, the same legend

I have two bar charts side by side, and they share the same legend, I have tried to use \addlegendentry{}, but I find my self with a repeated legend! Here is the code, what should I do (I tried two ...
1
vote
1answer
207 views

Add legend to tikz boxplot

I have major problems adding a proper legend to my tikz boxplot graph. Either the legend did not show at all or scrambled the whole boxplot layout. I would be happy with a basic legend inside or ...
1
vote
1answer
273 views

tikz pgf place legend pie chart

I am very happy with the solution to Pie chart labels, but I wonder how I can place the legend to the right of the pie. For that, I like the idea of Pie chart with joined legend position - to add, in ...
1
vote
1answer
38 views

External pgfplots Legend Using Default Colormap

I have a series of pgfplots bar charts all of which use the default colormap to define the bar colors. Because of space concerns, I need to use a separate tikzpicture for the legend (see MWE). ...
0
votes
1answer
112 views

Legend text missing when compiling with eps figure

The upper is the original figure(eps format), the lower is the figure shown in pdf. I don't know why. Any help is appreciated, thank you in advance. The tex file is below. \documentclass{article} \...
0
votes
1answer
134 views

Fill between area legend

I have a problem with a legend of filled area between curves. I want to have a legend item with a small square which represent a filled with fill between function. When I used "area legend" in /...
1
vote
1answer
34 views

Why is legend style not being applied?

I produce the following chart: As per my code (in legend style for the primary axis), the legend should be in 4 columns in the centre of the axis (at height 1.3). Why is this not working? Code to ...
2
votes
1answer
97 views

How to have displaystyle in pgfplots' legend?

I want the legend of my plot to display a fraction the same way it would be done using \displaystyle. When using \displaystyle, the border of the legend gets cut (see picture below). How can I proceed ...

1
2 3 4 5
9