a legend in a graph helps the reader determine the correspondence between line style and data values

learn more… | top users | synonyms

5
votes
1answer
32 views

Split line in `legend` with `pgfplots`

In the following plot, how can I split the red line of the caption into a red line and a blue dashed line (so that the total length of the red-blue segment is that of the green one)? MWE: ...
3
votes
1answer
23 views

pgfplots legend disappearing with externalization

I have an issue with a combination of a special legend I am doing in a pgfplot, and with using tikz externalization. See the MWE below. The legend will not appear if I use externalization, but if I ...
6
votes
1answer
116 views

How to increase legend lines lengths in PGFplots

I want to know how I can make PGFplots to draw longer segments in the legend. I looked at couple of previously asked questions and none seemed to work for me. In this question: "adjust the legend ...
0
votes
1answer
36 views

How to only show legend in pgf plot?

I have created with matlab2tikz a standalone picture, saved in myfile.tikz Here is the code: % This file was created by matlab2tikz v0.5.0 running on MATLAB 8.4. %Copyright (c) 2008--2014, Nico ...
2
votes
0answers
22 views

Colorbar for lineplot using pgfplots [duplicate]

I am doing a lineplot with pgfplots. However, instead of the usual legend, I would prefer a colorbar, as I am basically trying to visualize a transition, and for that I chose colors in a gradient like ...
2
votes
1answer
74 views

Resize font in legend below \tiny

I have small graph in my presentation (I have to). To adjust the size of the legend, I have to use very small legend. But \tiny is not enought. Here is a MWE : \documentclass{beamer} ...
1
vote
1answer
38 views

clear me the doubt in positioning legend option

\begin{tikzpicture} \begin{axis}[ axis lines=middle, samples=100, ymax=5,legend pos=north east ] \addplot[cyan,domain=0.001:8] {abs(log10(x))}; \addplot[red!70!black,domain=-2:4] ...
4
votes
1answer
69 views

Why can't I move the legend position with PGFPlots?

I am trying to use PGFPlots to draw some graphics into my document, but I didn't manage to move the legend to the desired position. Here is the minimal code that I made: \documentclass{article} ...
1
vote
1answer
62 views

Background color of legend in graphics made with tikzpicture/pgfplots

I'm using tikzpicture and pgfplots to make graphics. And, I'm wanting a beamer presentation with black font and white writing. When I'm plotting the graph, the legend box is just a white box and I ...
3
votes
1answer
58 views

Showing legend for boxplot in pgfplots

I am trying to display a legend for a boxplot created in pgfplots. However the size of the legend is almost as large as the plot and covers up all of my plot, how do I fix this? ...
4
votes
1answer
108 views

pgfplot legend on top of grid but below graphs in axis as well as groupplot

Is there a way to specify the order of layers of elements in a pgfplots-axis? In my certain case I'd like to have the legend on top of the grid, but below the actual graphs: I know for this ...
2
votes
1answer
41 views

Adding a legend with connector to a picture with overpic and tikz lead to a misspositioning of the bottom left corner of the tikz picture box

I try desperately to make a macro which allows me to simply add a circled number with connector on a figure. To do that, I try to use into the command \put of overpic a tikz function which makes the ...
1
vote
1answer
44 views

Shared legend below a group of horizontally aligned figures in pgfplots [duplicate]

How should I run the following example code using /pgfplots/legend to name={<name>} to put a shared legend below a group of horizontally aligned figures? The example code using ...
2
votes
1answer
47 views

Legend entry not showing correct image

I don't know why the legend does not reflect the correct image for its respective entry. I want the last two entries to just show the marker and not the line (dashed line). I set the last two to just ...
4
votes
1answer
96 views

How to make a nice legend for a histogram with pgfplots

I am trying to make a histogram with the fitted curve plotted on it. Here's the mwe: \documentclass[a4paper]{scrartcl} \usepackage{tikz} \usepackage{pgfplots,pgfplotstable} ...
0
votes
0answers
56 views

matlab2tikz does not produce the legend

I am using matlab2tikz to convert a matlab figure to .tex format. However, I am experiencing some problems when I try to include a legend. I use the following matlab code hor=1:30; x=hor.^3; ...
3
votes
2answers
47 views

latex - colorbox in caption as legend - how to center or alternative solution?

I have an image of a diagramm that I want to use as a source in my work. I have no possibility to create this diagram. So, I want to add colorboxes in the caption as a legend. here is my actual code. ...
3
votes
1answer
72 views

Changing arrow style between graph and legend

I want to have the arrows on the ends of the graph but have the legend just show straight lines (without arrows). MWE: \documentclass[12pt]{article} \usepackage{amsmath, amssymb} ...
1
vote
1answer
89 views

multi-Figure with pgfplots with one legend and rotation

I would like to have in a page two figures like the one the code below at the same page using subcaption and sidewaysfigure. The first problem is that probably there is a mistake at the position of ...
5
votes
1answer
207 views

Vertical spacing and item separation between entries in pgfplots' legend

One could find a lot of questions on how to change the horizontal spacing between legend entries in pgfplots, but I can't find anything on the vertical spacing between the entries. For example, when ...
2
votes
0answers
96 views

Legend entry for each point in scatter plot with matching color

I have a file with multiple columns, of which I create scatter plots where positions are given from column 1 vs column 2, while the mark color is based on column 3. I now wish to automatically create ...
6
votes
0answers
104 views

Add break node to plot in pgfplots

I was able to 'break' the vertical axis using pgfplots, but some issues came along with it: Most importantly, I can't find how to add the 'break sign' (the two parallel lines) to my plot as well, ...
6
votes
1answer
90 views

Custom area legend image not working

I'm trying to use the result from a fill between as a legend entry, but I can't get it to work: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} ...
2
votes
1answer
111 views

Am I properly inserting legends in groupplots? Labels “multiply defined”

I have a few places in my document where I use groupplot to insert several figures, but I only want one legend as it's common to them all. I've done this using legend to name=foo and then, after the ...
5
votes
2answers
215 views

Setting all nodes to use \sffamily without overriding font size

In my document, I want all labels in tikz and pgfplots graphics to use sans-serif, so I use \tikzset{every node/.append style={font=\sffamily}}. This works. However, when I use this, inside my axis ...
2
votes
1answer
112 views

Bar Chart Patterns in Legend

I have a groupplot with three bar charts using a common legend. This worked great when I was using color, but now I have to prep for publication in black and white. I'm not well versed at all in ...
1
vote
2answers
97 views

Different space between nodes for Tikz legend

I want to add a legend to my graph, explaining what different arrows mean. I thought I might be able to do it using coordinates, but the spaces between them are the same as spaces between the nodes ...
2
votes
0answers
106 views

Legend image arguments for the command `\addlegendimage`, 3d legend image

In the 3d plot I want to modify the third legend entry to only show the marks and not the line. From http://tex.stackexchange.com/a/113765/28093 I understood that I'm supposed to use something ...
1
vote
0answers
57 views

Selectively add legend entries to plot on large CSV

I have a plot with 63 lines, only some of which I would like legend entries for. The full legend takes up half a page, and using the \ref method does not give me consistency with the surrounding ...
1
vote
0answers
43 views

Add one legend to several subcaptionfigures

I have the following problem: I have several pgf plots in one figure (see screenshot). I make it with \subcaptionbox. Now i want to add one legend for all 6 plots, since in all plots the same signals ...
3
votes
1answer
103 views

How to add one single legend entry for several plots?

How can I create a single legend entry for 4 plots at the bottom of the group of plots?. Something like this: Title Title -------------- ---------------- - ...
3
votes
1answer
138 views

How to draw a bubble column chart with a legend?

I am very new to plot in Latex, and am trying to piece together a bubble column chart with a legend and labelled axes. So far, I have a working chart, but can only get the legend or a labeled x-axis. ...
1
vote
1answer
224 views

PGFplots axis legend with multiple columns/rows of different lengths

I have an axis environment in PGFplots with multiple graphs which correspond to certain group of data types. I want to stress this distinction by grouping the legend entries. In particular, using a ...
4
votes
1answer
131 views

Generating pgfplots legend from gnuplot data

I’m having trouble getting pgfplots to typeset very small numbers, e.g. 6.82e-08. I don’t know if the problem lies in it being a very small number, or if it’s because of the interaction with reading ...
2
votes
2answers
120 views

How to make a legend entry image consist of line, pattern and markers in pgfplots

I'm trying to make the legend entry image look like a chunk from the "whole" of the following plot (so it has a line, pattern lines and marker). Is it really possible? I'm after an unsuccessful ...
3
votes
1answer
62 views

Align legend label to text

I have this MWE. \documentclass{article} \usepackage{pgfplots} \usetikzlibrary{patterns} \definecolor{nrgray}{HTML}{F0F0F0} \newcommand{\graphTripleData}[4]{ \begin{tikzpicture} \begin{axis}[ ...
2
votes
1answer
115 views

Problem with legend on a 2 y-axis line & ybar figure

I cannot seem to figure out a way to switch the legend symbol to the ybar symbol in a two y-axis plot. Here is a minimal working example of my problem Which yields this: So the only problem with ...
2
votes
1answer
102 views

Pgfplots: Placing legends individually to the end of lines

I have a few days of experience with LaTeX. It seems almost everything is possible if you just find out how. So, here is a challenge... If a plot has many lines it is much more readable to have ...
3
votes
0answers
154 views

Automatically positioning a legend relative to multiple plots in groupplots

This question deals with centered legend placement in a set of plots aligned with groupplots. However, as the OP stated in a comment, the (accepted) solution requires some hand tweaking. I suspect ...
1
vote
1answer
73 views

How to make a custom legend with a squared box followed by a text?

I'm trying to make one of that legends that we can find in some graphics such as bar plots. Just to clarify, I'm not displaying a plot. I have to present a schedule, which is defined trough a ...
3
votes
1answer
94 views

Display mark instead of line in tikz legend

When using \addplot[color=black, mark=o, draw=none] table [y=Y, x=X]{Data/bottoms.dat}; \addlegendimage{New record}; \addplot[color=black, mark=x, draw=none] table [y=Y, ...
0
votes
0answers
250 views

Matlab2Tikz legend changes position

I have a matlab output figure with subplots where the legend is just at the right spot (fig. 1). I used legend({'Country 1','Country 2'},'Orientation','horizontal','Position', [0.25 0.95 0.5 0.05]); ...
5
votes
1answer
143 views

pgfplots: Dual axis

I want to display a dual axis as pictured in Fig.1. But When i write the file .Tex I obtained a different presentation. I want also to display all the numbers between 1-12 in the x-axis. Any help ...
3
votes
1answer
283 views

pgfplots : Row title in legend

I would like to add a title to each row of my legend in pgfplots. I achieved this with this example : \documentclass{article} \usepackage[pdftex, active, floats, tightpage]{preview} ...
3
votes
1answer
61 views

Providing legend for pre-rasterized data

I have a plot containing several million data points (real-time sensor, 50 samples/s, multiple channels, 5 hours). To keep the file size of my document down, I made a bare PNG with the line graph in ...
3
votes
1answer
491 views

How to adjust the legend line length in pgfplots

I have a plot using pgfplots but I need to adjust the length of each legend. I can modify the width of each legend line, but I don't know how to modify the length of them. Is there any option to ...
2
votes
1answer
497 views

Add legend to pgf plot results in \end{axis} error

I exported a Matlab figure to tikz, using matlab2tikz. It is a simple plot of some lines and I need to label them. matlab2tikz did not add the legend entries automatically for the first time, so I ...
2
votes
1answer
211 views

pgfplots legend nested in matrix

I'm using a \matrix to arrange subplots, each created using pgfplots. When I tried to use \legend to add a legend to individual plots, lualatex tells me Package pgf Error: You cannot nest ...
0
votes
1answer
63 views

table legend - wrong reference

I'm using these commands to create a table with a legend, but the problem is that when I make a reference to it, it appears as "Table IIIB" instead of "Table III". Can you help me please ? ...
1
vote
1answer
109 views

How to have a color square in a text caption

Just like the figure on the right hand. The small squares in green color.