Tagged Questions

{pgfplots} is a package for creating 2D and 3D plots of mathematical functions and numerical data, using the PGF graphics framework. For questions about the inbuilt plotting functionality of TikZ/PGF, use {tikz-pgf} instead.

learn more… | top users | synonyms

11
votes
1answer
7k views

Legend in tikzpicture

I am looking for a way to create a legend in a regular tikzpicture. I found this Using a pgfplots-style legend in a plain-old tikzpicture but I don't know how to put the legend at the wanted ...
4
votes
1answer
446 views

How to add axes in a magnified part of a graph using spy?

My problem is the following. I would like to draw the (magnified) axes on the magnified area of spy. For instance, take the following example (from pgfplots.pdf, p.121): % Preamble: ...
4
votes
0answers
2k views

pgfplots legend: how can I set the column/row order of legend entries? [closed]

By default, pgfplots seems to add legend entries row-wise. However, I've plot where I'd like a two-column legend (16 curves) and the first 8 entries to be added to the first column before starting ...
4
votes
1answer
1k views

Box plots with symbolic x coords

I'd like to use box plots with pgfplots. As an additional feature, I'd want my x coordinates to be symbolic. Currently, only the last line from the file data/gp.dat is plotted. It works fine, if I use ...
5
votes
1answer
556 views

Missing values in pgfplots with error bars

pgfplots can deal with missing values in table inputs by either skipping or jumping over any values which are given as nan in the input table file, as discussed here. I want to do a similar thing with ...
7
votes
1answer
627 views

Aligned pgfplots in beamer frames

I would like to reproduce the design represented in the following picture with Beamer an Pgfplots. Namely, I want the size of plotting area to be always the same size and have the same position ...
8
votes
1answer
450 views

Tikz / pgfplot: plot Alternating Sequence

Is there any possibility to plot an alternating sequence? Picture: Alternating sequence: I don't need exacly the same output as above. I tried the following: \begin{tikzpicture} \begin{axis}[ ...
18
votes
2answers
3k views

how to keep a 1:1 scale with x and y axis

I have been searching for hours now on how to fix these small problems, and I am finally admitting defeat and humbly ask for help. Lately I have been going over some of my badly drawn figures, trying ...
12
votes
1answer
1k views

Plot x y data from different files/tables

I have two data files (xxxx.txt and yyyy.txt), each only containing one column of x and y data respectively. Now I want to plot these two data together in a simple 2D diagram. Has anybody an idea how ...
4
votes
1answer
242 views

PGFPlot two \pgfplotstableregressiona

Hi i have two plot with two linear regression but the legend show the same equation for the straight line... I haven't made a MWE because I thought it isn't needed---Is it? \pgfplotstableread{ X Y 97 ...
19
votes
2answers
1k views

How can I draw a vector field (quiver plot) on a surface in 3D?

I'd like to draw a vector field on a torus using PGFPlots and/or TikZ. I managed to do it using ePiX, based on the file decorate.xp from the example gallery, but then I have to do z-sorting by hand, ...
4
votes
2answers
822 views

PGFPLots remove the plot line in the legend

How can remove the plot line in the legend? \documentclass[border=0.5mm,12pt]{standalone} \usepackage{siunitx} % SI Package \sisetup{% output-decimal-marker={,}, ...
5
votes
2answers
533 views

PGFPlots convert the decimal separator

Hi the decimal separator of the xticks is a point i would the comma how can i do? \documentclass[border=0.5mm,12pt]{standalone} \usepackage{siunitx} % SI Package \sisetup{% ...
4
votes
1answer
552 views

pgfplots: Draw area of summed up percentages (like 'ybar stacked', but area style)

Sorry for the title, but I didn't know, how to explain my problem properly. I want to have a filled area plot, like in chapter 4.4.9 (Area Plots) of the pgfplots manual, but with summed up ...
13
votes
1answer
2k views

TikZ, 3d library and circle fading

I'm using the 3d library to put a circle on the z=0 plane, and other things. I'd like to fade this circle radially, but the result isn't as I would expect because the fading is not proportional to the ...
2
votes
1answer
371 views

Pgfplots label get repeated by tikz spy library

My question is very similar to this question. I label a certain curve in my plot and magnify a part of that. The \spy command repeats the \label which causes multiply defined label warnings which are ...
6
votes
1answer
1k views

TikZ plot: centering and units on axis

I have the following. I'm trying to center the plot and putting \begin{center} around the TikZ image does not work. Also I'm trying to change the units of the x-axis. The x-axis is used to ...
3
votes
1answer
1k views

TikZ: bars width and size of plot

This is a followup on my previous question. I have tried to plot my data and I see the following now. Would it be possible to define the size of the area that is used for the plot? I have tried to ...
3
votes
1answer
545 views

TikZ: plot datapoints with bars

I'm currently generating data files which have points as follows 5 1 3 2 2 1.4 ... Each line 2 values of which the first is indicating the time and the second some value. I'm currently (as I'm ...
2
votes
1answer
339 views

How can I add another plot to the \addplot command in PGFPlots?

My goal is to add another plot to the \addplot command and this small example hopefully shows what I'm trying to do: \documentclass{standalone} \usepackage{pgfplotstable} \begin{document} ...
20
votes
3answers
1k views

Draft mode for pgfplots

I'm working on a fairly big document that has a lot of graphs of functions- so far it has around 200, by the end it will have around 1500. I use pgfplots for each graphic, and the functions are pretty ...
14
votes
1answer
2k views

How to use a string column with pgfplotstable to label datapoints in a pgfplot?

I have a comma-separated list of data points. They should be plotted as a scatter plot, and should be labeled using data from the .csv file. Having specified the first column of my file as string ...
7
votes
1answer
1k views

How do I draw an arc between two lines in pgfplots using axis cs

I would like to draw an arc between to lines in a pgfplots picture using axis cs. My first attempt is as follows: \documentclass[12pt,a4paper]{article} \usepackage{pgfplots} ...
7
votes
2answers
501 views

Transforming “rel axis cs” to absolute coordinates?

I've got two plots arranged vertically using \matrix. I'd like to draw a vertical line, that spans over both plots with a margin of 1cm at the top and at the bottom. The starting point of the line ...
9
votes
1answer
2k views

Set x tick label position to bottom of the axis

I have finally managed to center my data with axis x line*=center, but I haven't found a way to get my x tick labels at the bottom of the figure. I have already drawn some major grid lines and now I ...
6
votes
1answer
995 views

Set axis x line to other origin than 0

I am trying to make a ybar axis that averages from the middle, but I cannot find a way to change the origin of the x axis. This is what I want: This is what I have: As you can see, I am trying ...
4
votes
1answer
2k views

How to get the pgfplots external tutorial to work in TeXnicCenter?

In 7.1.1 of the PGFPLOTS library the following example of externalization is given. Whatever I try, I cannot get it to work in TeXniccenter, running MiKTeX 2.8. \documentclass{article} ...
9
votes
1answer
687 views

How to prevent small values from being plotted with nodes near coords?

I'm trying to finalize my first pgfplots chart. I've managed to get is almost the way I would like it to be with thanks to all examples I found here. The last thing I can't seem to figure out is how ...
1
vote
0answers
340 views

Nested axis: several concatenated axis with different ticks

I'm trying to convert a so called "dotplot" into latex. This plots are used in biology to compare sequences. Each axis represents a sequence and the coordinates of a dot are the actual X and Y ...
6
votes
2answers
1k views

Pgfplots: how do I fill an area over a curve?

I'm working with pgfplots, and I have a curve on a graph which is basically a rect. I would like to color the part on top of it, not the part under it. I have this code: ...
5
votes
1answer
972 views

Using value of a table as color indicator for \addplot like a colormap

I am trying to use a relative value (percentage) extracted of a table to define the color of several 2D plots like this: At the moment I'm using addplot[mesh] together with a self defined colormap ...
10
votes
1answer
1k views

TIKZ drawing vector field from external file

I would like to draw a vector field from a data file. I tried to adapt code from Manual for Package pgfplots but this doesn't work \documentclass{standalone} \usepackage{pgfplots} ...
1
vote
0answers
2k views

! I can't find file `pgflibrarytikz*.code.tex' [closed]

I can compile the following LaTeX: \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows,backgrounds,plotmarks} \begin{document} Lorem ipsum dolor sit amet, consectetur adipiscing ...
9
votes
2answers
4k views

matlab2tikz - TeX out of memory

I am using matlab2tikz to import figures from MATLAB to tex. However I quickly get the message TeX capacity exceeded, sorry [main memory size = 3000000]. I have tried expand main memory using ...
7
votes
1answer
300 views

PGFPlots: synchronize the filling of the bars with the colorbar

How i can synchronize the filling of the bars with the color of the color bar to the right? they are a little shifted... \documentclass[border=0.5mm,12pt]{standalone} ...
3
votes
1answer
235 views

PGFPlots: convert the filling of the bars

How can convert the filling of the bars from horizontal to vertical ? \documentclass[border=0.5mm,12pt]{standalone} \usepackage{pgfplots,pgfplotstable} % Grafici \pgfplotsset{% ...
1
vote
1answer
1k views

PGFPlots: symbolic x coords + extra ticks

how can i add in this plot the extra x and y ticks ? \documentclass[border=0.5mm,12pt]{standalone} \usepackage{pgfplots,pgfplotstable} % Grafici \pgfplotsset{% mesh line ...
4
votes
1answer
1k views

Problem with pgf-plots and \pgfplotsset

Sorry for the somewhat long code, this is as minimal as I could make it. The first code is for typesetting pictures to indicate how a function increases and decreases. It is taken from a previous ...
1
vote
1answer
720 views

TikZ externalize option causes error in compilation

As the title says, the externalize option causes some strange errors I can't figure out of. It works for some figures (e.g. figures for which the code I've found in the pgfplots manual), but for some ...
5
votes
1answer
646 views

Counting points from csv file pgfplots

I am importing data from a .csv file to obtain a scatter plot, here's the MWE: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{ jitter/.style={ x ...
6
votes
1answer
536 views

Pgfplots remove darker borders on marks

Hi is possible remove the darker borders on marks indicated from the arrow ? Thanks \documentclass[a4paper,12pt]{article} \usepackage{pgfplots,pgfplotstable} % Grafici ...
7
votes
2answers
535 views

PGFPlots colored regression legend

how can i have this legend? in this plot: \documentclass[a4paper,12pt]{article} \usepackage{pgfplots,pgfplotstable} % Grafici \pgfplotsset{/pgf/number format/use comma,compat=newest,% ...
3
votes
1answer
321 views

Tikz : column header in groupplot legend with a loop

I'm trying to plot some data using loops, but i've some issues when I try to extract the column header and have it as a sub legend. Does anyone have any idea to fix it up ? \documentclass{minimal} ...
10
votes
1answer
2k views

pgfplots how to nicely place nodes

The picture produced by code blow, there are two problems I have. (1) the number above point overlapped (2) the precision of number is not right, eg. I want 0.913, not 0.91 For the first problem ...
6
votes
1answer
1k views

plotting a line in a barchart

Problem: line stops at given coordinates, ymax is not obeyed. \documentclass[a4paper,10pt]{report} \usepackage[left=1.5cm,top=2cm,right=1.5cm,bottom=1.5cm]{geometry} ...
3
votes
1answer
694 views

How to scale y axis and position labels in xbar plot

I have the following xbar plot. I have two problems: 1) to see all the bars I have to do "enlarge y limits = X", where X is found by trial and error. This seems to result in the bars not being ...
10
votes
1answer
2k views

How can legend entries be obtained from different plots in a groupplot?

I would like to place a legend outside an axis using symbols from multiple plots within a groupplot. Trying it the way I show below doesn't seem to work, just the last entry is shown. How can this ...
5
votes
1answer
326 views

PGFPlots - shift marks

I'm plotting two lines, more or less on top of each other. This is fine when you can see the colors, but not on a black and white print. I have added marks, but due to the data points being take ...
1
vote
1answer
183 views

PGFPlots: strange behaviour

Look at the differences between the following two plots. I would like to have in plot "1" the same distances between the colorbar, axis labels and the ticks labels that I get in plot "2". How can ...
6
votes
1answer
3k views

Logarithmic y-axis and restrict y to domain fails

I'm trying to plot data with a logarithmic y-axis and restricting the y-data to a specified domain, but compilation fails for a reason I don't understand. This is the code: \documentclass{standalone} ...