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
50 views

How to produce graph with pgfplots [closed]

I was wondering how one would produce a graph that looks like the one attached in pgfplots with that type of legend. Any help would be appreciated!
2
votes
0answers
44 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
33 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
44 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
32 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
49 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
37 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
44 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
68 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
42 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
74 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
63 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
33 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
45 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
109 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
34 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
13 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
55 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
69 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
64 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
28 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
38 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
53 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
32 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
51 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
28 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
28 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
30 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
50 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
40 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
51 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
90 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
32 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
52 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
63 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
157 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
46 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
52 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
40 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
52 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
48 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
vote
1answer
43 views

problems with histogram labels and legend

I am having problems adding labels aligned to axis x and y. When I implement xlabel/ylable in the code they do not show. Furthermore, I would like the legend font to be smaller and the command \...
0
votes
1answer
151 views

move legend in tikzpicture

I need to move the legend in the south east, now is in the north east. I'd like to move it in the south east. It doesn't move from there, whatever I write. \begin{figure}[!ht] \centering \begin{...
0
votes
0answers
21 views

Legend failed to show correct things

I am trying to draw a graph with some legends. I have two questions: If I use \legend, then it has to give legends for all the plots above. If I use \addlegendentry, it cannot give correct graph (the ...
1
vote
1answer
50 views

Automatically reading pgfplots table column for legend with math mode / latex commands

This is a follow up question to How can multiple pgfplotstable columns be used in a legend? I tried the minimal working example from there and replaced one of the Column names with {$R_0 = \SI{10}...
0
votes
0answers
19 views

Setting Legendmark color in \addplot

following Code: \begin{tikzpicture} \centering \begin{axis}[minor tick num=1, xlabel=Duty-Cycle $\delta$,ylabel={$\uC{2}$ in $V$}, ylabel near ticks, yticklabel pos=right, legend pos=north west]...
0
votes
0answers
14 views

How to mix legend plots

Hello I am stuck at this point were the legend plot is separated I dont know why, do I have to separate it from the actual plot? \begin{tikzpicture} \begin{groupplot}[ group style={ ...
0
votes
1answer
273 views

PGFPLOTS transposed legend with empty legend entries

I am having problems to correctly place the legend entries in a 3x3 shaped, transposed legend matrix with empty (skipped) entries for the following MWE: \documentclass{standalone} \usepackage{...
1
vote
1answer
56 views

Legend not working for TikZ/PGFplots

I am using the answer in this post, to generate a heatmap of a matrix stored in a data.dat file. The matrix stored in data.dat file looks like this: 1.083 0.329 0 -0.139 0.329 -0.683 0....
0
votes
1answer
57 views

legend={text={ multi line

I want legend = {text = {} in multi lines The text of the legend is very long and I want to divide it into multi lines \tikz \datavisualization [scientific axes=clean] [ visualize as smooth line=...

1
2 3 4 5
8