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
1answer
26 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
23 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
105 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
50 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
25 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
92 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
14 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
39 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
20 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} \...
1
vote
1answer
45 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
50 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
36 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
47 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
35 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
95 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
44 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
80 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
83 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
80 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
102 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
46 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
93 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
144 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
38 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{...
0
votes
0answers
16 views

Problem with \psfragfig

In order to import a graph from MATLAB into pdflatex, I used \matlabfrag and \psfragfig. The pic shown below is what I get. The Font size is good enough, but the plot size is small. How to make the ...
1
vote
2answers
68 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
127 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
149 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
33 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
62 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
93 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
33 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 ...
1
vote
0answers
61 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
vote
1answer
77 views

Creating custom legend markers in pgfplots

Is it possible to customize the style of legend keys (the part of legend which indicates the line type being solid, dashed, dotted etc.)? \documentclass{standalone} \usepackage{tikz} \usepackage{...
1
vote
1answer
33 views

PGF: How to customise legend style for stacked area?

I produce the following chart: I would like the legend entries to be symbolised by filled squares (like you would get with ybar). In the code below, I have already defined the style I'd like in new ...
2
votes
1answer
33 views

PGF - How to align different legend types?

I produce the following chart: As you can see, the second column of legend entries looks very ugly because the two bar legends (Private consumption, GFCF) are too far from the text. How do I get ...
0
votes
1answer
78 views

Bug on legend of scatter plot with pgfplots

I have a problem with the legend in a scatter plot using pgfkeys. The color of the halfsquare sybol in the legend is different from the color defined in the plot, as show in the MWE bellow. How can ...
0
votes
0answers
89 views

How to Change the position, style and font size of legend in latex? [duplicate]

I plot a graph using pgfplots package. I want to change the location and size of the legends in the plotted graph. The code and graph are attached. \begin{figure} \begin{tikzpicture} \begin{axis}[ ...
2
votes
1answer
59 views

Two y-axis graph problem with ylabel and legend - PGFplots

I have problems with using a two y-axis graph. \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ axis y line*=right, ...
4
votes
2answers
98 views

How to position legend at corner of tikxpicture bounding box?

I've created a block diagram and want to add a legend to it which should be positioned in the very top left corner. I've setup a custom environment for the legend according to the answer to this ...
0
votes
1answer
36 views

how can we have one \addlegendentry for two superposed sets (a hatched pattern with a orange background)?

I am writing to ask for your help, please. I would like to add a colour (orange for example) to the background of an initial Pattern (see below). Is there an option to do that: to have a legend that ...
1
vote
1answer
54 views

Legend with tikz

This is a legend that I need to make but I can't make the space between the columns work. They need to be evenly spaced without going into margin. I'm also interested to know how to make this in the ...
2
votes
1answer
88 views

Adding a legend with tikz

I'd like to place the following text in a horizontal legend in a box under these two plots (replacing the text on the left side of (:) with the corresponding shape): right or down arrow: go forward; ...
0
votes
2answers
225 views

How do I draw a legend with arrows in it?

I have the following picture and I'm looking to draw a legend that contains arrows in it and labels for each of the blue and orange arrows. Can somebody give me pointers on how I should go about ...
0
votes
0answers
53 views

Modifying a sunburst chart with % symbols and joint legend

I copied a code from this post to make a sunburst chart, but I need to make 2 modifications that I haven't been able to work out: is to add % into the text, and is to create a joined legend for both ...
1
vote
1answer
83 views

2 pies in one figure with same legend and separate chart labels

I'm trying to create 2 pie charts within the same figure. The problem is I want them both to have the same legend, but I cannot manage that. The package seems to assume that each individual pie needs ...
0
votes
1answer
48 views

Common legend for groupplots involving plots generated by forloop

I'm trying to adapt the solution given here (this is also relevant) where legend entries can be added via a loop. For instance if we have a collection of N curves depending on more than one parameter ...
2
votes
1answer
77 views

Problem in adding legend and space in a tikzpicture plot in latex

I have tried different ways to put colour legend for this chart but failed or not aligned. Can you please advise. So \legend{} did not provide anything and \addlegendry{} is not alleged. I just want ...
1
vote
2answers
63 views

Align legend text along a certain character within tikzpicture environment

Suppose we have the following: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepackage{pgfplotstable} \pgfplotsset{compat=1.16} \usepgfplotslibrary{external} \tikzexternalize \...

1
2 3 4 5
8