{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

1
vote
0answers
30 views

How to plot boolean (digital) variables using pgfplots?

I work with electrical power systems and always I need to plot voltage and current signals. Sometimes I need to plot boolean signals. I'm using pgfplots and groupplots specifically to do this work as ...
1
vote
0answers
31 views

pgfplot: 2D with line color depending on another value

I would like to create a 2 dimensional plot with several lines. One of the lines depends on additional values in third dimension. Now i'd like to make the line color of this "3d-line" depending on ...
13
votes
1answer
4k views

How can I filter/select data from a table and plot it?

I have a table with data from a file and before anything, I sort the data. Then I would like to filter only the rows that have a specific value. There has been a similar question which almost contains ...
3
votes
0answers
41 views

Plot 2D slice of a 3D field using pgfplots

I have a CSV data file like the following X Y Z T 0 0 0 12420 0 0 1 2154 0 0 2 54565 0 0 3 54640 . . 0 0 10 53565 0 1 0 12420 . . 0 1 10 53565 . . 0 10 10 53565 1 0 0 2454535 . ...
11
votes
2answers
2k 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} \pgfplotstableread{...
1
vote
1answer
19 views

Problems with bar chart - color, doesn't appear all, format numbers

I'm trying to do a bar chart and I'm facing some problems: I would like the colors to be white and black!10 The first bar doesn't appear, already tried to change the code but it didn't change I ...
1
vote
1answer
35 views

Producing an a transducer directivity pattern with dB scale

Edit: Question updated to address comments from Willie Wong. The directiviy pattern now plots as I've added 90 to each value. I need the y-axis to read from -N to 0 dB where N will vary, however when ...
2
votes
1answer
227 views

TeX capacity exceeded using pgfplots with/without externalization

The following MWE compiles (for me) \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usetikzlibrary{external} \tikzexternalize[prefix=figures/externalized/] \begin{...
0
votes
0answers
35 views

Exponential numbers on a graph

I'm writing a document and I want know how can I set the X axis numbers using a scientific notation. I have this table: \begin{tikzpicture}[scale = 1] \begin{axis}[ xmode=log, log ticks with ...
0
votes
0answers
21 views

Trying to make a scatter plot for the first time; pgfplots [on hold]

I am trying to make two scatter plots for my physics lab report. I keep getting errors and I keep referring to the pgfplots manual but to no avail. \documentclass[12pt]{article} \usepackage[margin=...
2
votes
1answer
21 views

Changing the axis xmax/domain in a step plot

Consider the MWE below. This example is from the PGF Plot galery with added 1 outlier (1000,50) resulting in the first (wrong) screenshot below. I want to limit the domain/axis, so I get something ...
0
votes
1answer
37 views

Plot problem with tikz and data from matlab

I extracted data from matlab figures, with the command "dlmwrite('heat.txt',[x',u],'delimiter', '\t')". It gives me a text file with 3 columns of numbers (the first is the abscisse x, and the other ...
2
votes
1answer
51 views

TikZ / PGF : why use \addplot instead of \plot?

I cannot understand the difference between addplot and a simple draw plot. Can someone explain why it is generally preferred on forums to do the second thing on this MWE ? \setuppapersize[A4][A4] \...
0
votes
0answers
58 views

How to draw in tikz with label in radians

I want to draw in TikZ the graph of the next image:
1
vote
0answers
28 views

PGF Plot: Different Graphs/Plots in one file

I want to plot my benchmark results from Celero (C++ benchmarking library) in latex, via PGF Plot: I get a csv file with all data in the form of (here with example data): Now I want to plot the ...
0
votes
0answers
34 views

“Missing \endcsname inserted” when using pgfplots

I encountered the problem while trying to export figures from Matlab using matlab2tikz. However, while troubleshooting I discovered that even simple pgfplots examples did not work. For example, the ...
1
vote
0answers
20 views

Is it possible in pgfplot to label with integers a logaritmic axis?

I already posted a message that pgfplot makes wrong log scaling but it looks like my statement was not clear enough. I am using pgfplot to make a double logarithmic diagram. The relevant part of the ...
1
vote
1answer
35 views

Pgfplots ignoring domain

I'm trying to use pgfplots to plot -3ln(x-2): \documentclass[border=10pt]{standalone} \usepackage[margin=1in]{geometry} \usepackage{amsmath,amsthm,amssymb} \usepackage{pgfplots} \pgfplotsset{...
0
votes
1answer
18 views

Inserting multiple legends in a pgfplot with one \addplot graphics

I would like to have the legends match the line plots from the diagram. I have referred to a lot of legend questions, but I couldn't find one where they were trying to make multiple legends for a ...
2
votes
1answer
32 views

PGFPlot: Newcommand argument Color not respected

I created a new command which prints a graph from a file. So far so good. Now I want to add (to the command) an additional argument color. This is what I have so far: \newcommand{\plotvtf}[4]{% \...
3
votes
1answer
32 views

Independent control of node fontsize in pgfplot

I am making several figures in my paper using pgfplot. I want to independently change the fontsize of tick labels, axis labels, legend and some other notes/labels in the figure. Say, 8 pt for axis ...
1
vote
0answers
26 views

I'm a newers for pgfplots, why the code with differ charts in my two computers, but the lines look so differ?

I try to generate my chart in latex using the same code(named glauber-thickness2.tex) in my Laptop after I tpye "pdflatex -shell-escape glauber-thickness2.tex" in cmd.exe, it generate glauber-...
0
votes
1answer
17 views

Texmaker freezes when iterating over an array and plotting with pgfplots

I have written a latex piece that iterates over two arrays and creates a plot for each entry of the array. However, my Texmaker gets surprised and freezes (I just gets fully processing power of my CPU ...
2
votes
1answer
35 views

Can I get \addlegendimage to print a custom legend draw/line style?

Problem I've created a figure where I plot a line and add a node at the beginning of the line and a diamond at the end of the line by using nodes in my \addplot command like so: \addplot[red,no ...
1
vote
1answer
36 views

Merge two .csv files and add missing rows?

I have two files. A.csv: date,colA 2016-01-01,1 2016-01-02,4 2016-01-03,2 And B.csv: date,colB 2016-01-01,2 2016-01-03,4 I'd like to combine these to get equivalent of: date,colA,colB 2016-01-...
2
votes
1answer
30 views

pgfplots package, error bars, moved when second series is added

I have got a problem. When I add the second series to my plot 1, the error bars from the first series moved from their original position 2. I use pgfplots package. Plot 1: Plot 2: Thanks for ...
2
votes
1answer
25 views

Using a pgfplots style for error bars

The following MWE shows two bar plots with error bars. \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \pgfplotstableread{ ...
3
votes
1answer
32 views

Set upper bound for pgfplots axis width?

Is there anything like \pgfplotsset{ every axis/.append style={ width = 0.9\linewidth, max width = 4in }} Suppose I have a document with hundreds of tikzpicture environments, each having plots ...
1
vote
1answer
30 views

Disable transparency warning when using ctable with pgfplots?

I'm using ctable package for tables with footnotes. IMO it looks better than using booktabs with threeparttable package. I also use pgfplots (which I guess uses tikz package, in turn). Everything ...
1
vote
1answer
43 views

2D Parametric plots in pgf

I am trying to plot a parametric parabola given by x(t)=125cos(30)t and y(t)=3+125sin(30)t-16t^2 Here is my code \begin{center} \begin{tikzpicture} \begin{axis} \addplot[blue, samples=40, variable=\...
1
vote
0answers
65 views

How do I place table below plot so that category matches axis ranges?

Here is something that I'm trying to do is to align my table with x-axis category or range so that column below the x range is corresponding of the data So As example is shown, I want to create ...
0
votes
0answers
19 views

Error using pdflatex and tikzexternalize to compile with PGFPlots

I'm having issues getting tikzexternalize to work with pdflatex in TexWorks with MikTeX. MiKTeX 2.9, TeXworks v0.4.5, PGFPlots v1.13 here is my MWE: \documentclass{report} \usepackage{pgfplots} \...
2
votes
1answer
65 views

TikZ - Black Dot/Diamond in Center of All Diamond Shapes

I am making a flow chart and in the standalone TikZ file everything looks fine, but when I use \input into my thesis all of the diamonds have a small black diamond in the dead center of the shape. ...
2
votes
0answers
20 views

Including high-density vectorial images in pgfplots [closed]

A lot of the figures that I'm creating for work include audio signals at high sampling frequencies and, thus, characterized by a lot of data points. Therefore, in most of the cases, I cannot simply ...
3
votes
0answers
51 views

Make border colour depend on the position in pgfplots

I have the following figure: I want to make the colour of the border depend on the position. Specifically, for x < 5 the border of the top triangle should be black, and for x >= 5 the border ...
1
vote
1answer
20 views

Vertical bar chart with level indicator

I need a vertical bar chart indicating the noise allowed levels. I wrote this MWE: \documentclass{article} \usepackage{pgfplots} \usepackage{tikz} \begin{document} \begin{tikzpicture}[scale=1] \...
18
votes
2answers
2k views

Use first row of a table as legend entry in pgfplot graph?

I'm using pgfplots extensively and I'd like to avoid having to write legends every time, since all the text files I want to plot have explicit headers. As a comparison, \pgfplotstabletypeset makes a ...
1
vote
1answer
45 views

Positioning of Bar plot in Latex

I try to have two bar plots side by side in using tikzpicture in subfigure. In my document, it looks like this: This does not look good. Problems are: It covers partly the text. The 2 bar plots ...
3
votes
1answer
1k views

Warning for TeX main capacity exceeded when loading files with \pgfplotstableread

I am loading quite a few data files via \pgfplotstableread, but do not further use them via pgfplots. I just kept them in the preamble and switched to plotting them in a standalone document. But now I'...
4
votes
1answer
27 views

Append slopes of linear regressions to a pgfplotstable column

Suppose I have one pgfplots-axis with multiple data series. Now I loop over this and calculate a linear regression of each series. How can I store the slopes of the regression lines to a pgfplots ...
4
votes
1answer
25 views

PGFPlots — avoiding cropping and scaling of the plot

Here is my code: \documentclass[12pt, border=0.5mm]{standalone} \usepackage[T1]{fontenc} \usepackage[sc]{mathpazo} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \...
2
votes
1answer
15 views

How to set column width and space between columns with pgfplots

This code is working fine, but I would like to make the columns larger and have less space between them, how can I do this using pgfplots? \begin{tikzpicture} \begin{axis}[ ybar, legend style=...
0
votes
1answer
49 views

Layout of bar charts in Latex

I created a bar chart, but it does not look good: Problems: the values above the bars does not look good. I want to have it on top of the bars and with slightly smaller font size. 2. The lay-out ...
10
votes
3answers
1k views

Filling in the area under a normal distribution curve [duplicate]

I'm trying to fill the area between the two $z$-scores but I'm not having any luck. Could someone please help me with this? \begin{tikzpicture} \begin{axis}[ no markers, domain=0:6, samples=...
3
votes
1answer
30 views

Alignment of subfigures using pgfplots with clip=false

I am using TikZ/pgfplots with clip=false so that the diagonal line in my "sketch" goes outside the axes' ranges. The problem is that this produces subfigures that are not correctly aligned: \...
2
votes
1answer
40 views

pgfplots fill between with table data creates strange x shapes

I'm trying to fill the area between my data and the x-axis using pgfplots and fill between. My two attempts are shown here: \documentclass[a4paper,11pt]{article} \usepackage{pgfplots} \...
3
votes
1answer
51 views

Pgfplots with GNUplot - data from CSV file - Current plot has no coordinates

I have a following code: \documentclass[a4paper, landscape]{article} \usepackage{amsmath} \usepackage{pgfplots} \usepackage{graphicx} \usepackage{underscore} \usepackage{adjustbox} \usepackage{...
2
votes
1answer
40 views

Connect coordinates in tikzpictures

I use a "parent" tikzpicture to realize a more flexible positioning of pgfplots than what is possible with groupplots i.e. I put the pgfplots in nodes as in the following MWE: \documentclass{article} ...
11
votes
3answers
542 views

Plot large data

As you all know, TikZ has to face the limits in terms of memory, that is given by the TeX compiler. For most of my plots, I have a maximum time step of around 1us and I record several waveforms over ...
0
votes
1answer
43 views

Can't include a global variable in domain of a plot in pgfplots

Consider the following piece of code to be include in a \begin{axis} ... \end{axis} of pgfplots package: \newcommand{\lineasVolumen}[3]{% % #1,2 Volumen inicial, volumen final, #3 paso. ...