{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
1answer
56 views

pgfplot dateplot discrete dates on axis

With pgfplot using dateplot when plotting data over a small date range, some dates are shown multiple times to "fill" the horizontal axis. I wonder if it is possible to show only discrete dates. Since ...
1
vote
1answer
64 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/] ...
0
votes
1answer
102 views

Large datafile for pgfplots table gives out of memory

I have a problem with 3D plots (surf, contours, ...) when loading "large" tables of data. I get the error ! TeX capacity exceeded, sorry [main memory size=3000000].. I found an aswer here, in ...
3
votes
0answers
441 views

Free space in bar-chart with empty entries

I would like to plot some data set with the ybar option of pgfplot. But not all entries are nonzero. The zero entries waste space between the bars and when the plot gets crowed it is not clear anymore ...
3
votes
1answer
105 views

pgfplots: Externalize file name - use figure reference (e. g. Figure 2)

Introduction I have a document with many pgfplots diagrams embedded in figures. I want to generate a separate file for every diagram by using the externalize feature. Is it possible to name the ...
2
votes
2answers
44 views

annotate plot with linear line

In my code below, I wanted to add a linear dashed line like this: Here is my code: \documentclass[varwidth]{standalone} \usepackage{filecontents} \usepackage{graphicx} \usepackage{tikz} ...
5
votes
3answers
297 views

Plot a transfer function in latex

I wanted to know how I can go about plotting a simple bode magnitude transfer function in LaTeX. This is the function that I would like to have the Magnitude response plotted: Be aware that the ...
12
votes
1answer
450 views

nodes near coords with logarithmic axis: Wrong values

I created a horizontal bar plot to compare benchmark times. Since one of the tested components is really slow, I need a logarithmic y axis for the other values to be distinguishable. Combined with ...
1
vote
0answers
32 views

y-label shows up twice in pgfplot when the bm package is used?

Can you tell me if it is possible to remove this extra y-label so that it looks cleaner? In my code below, I get the y-label showing up twice like: Here is my code: ...
4
votes
1answer
42 views

justify legend enteries in pgfplots

I wanted to know how I can go about left aligning the legend enteries in my pgfplot. This is the effect I would like to have: Here is my code: \documentclass[tikz]{standalone} ...
7
votes
2answers
244 views

How do I color in two different colors one square function?

I need to color every other line of this same function in orange and make it dashed, but this is only one square function, so can anyone help me?
3
votes
1answer
37 views

restrict y to domain “cuts” up plot

In my code below, my plot shows up like: It is not a continuous plot as the restrict y to domain=-500:500 deletes some of the points to cause the plot to look like the way is does. Is there a work ...
2
votes
1answer
29 views

How to align subscripted annotations with axis labels in pgfplots?

This question is a follow-up to my earlier question about how to align annotations with axis labels in pgfplots. The accepted solution works perfectly, but I've run into a further alignment problem ...
2
votes
1answer
41 views

Undefined control sequence. \end{axis}

I am using TikZ to draw plots in LaTeX \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} %\usepackage{pgfplotstable} \pgfplotsset{compat=1.12} \begin{document} \begin{tikzpicture} ...
7
votes
2answers
379 views

TikZ binomial distribution plus Gaussian approximation

My intention is to draw the probability function of a binomial distribution with trials = 20 and probability = 0,4. Then i wanna add the curve of an approximate gaussian curve in the same plot. How ...
2
votes
1answer
33 views

Place arrow and text at specific point in a pgfplot

This code is building off the solution posted here. How do I go about adding an arrow and text like this to the second plot: Here is the code: \documentclass{book} ...
74
votes
4answers
32k views

How to expand TeX's “main memory size”? (pgfplots memory overload)

I'm compiling one pretty simple LaTeX file with few dozen of pgfplots. Now, I can compile part by part, but am unable to compile it all at once. I really need good precision for all those plots (noise ...
2
votes
1answer
23 views

Fill area above and below lines in pgfplots

In the code below, when I try to implement the soft clip command \addplot [red, fill opacity=0.1] fill between[of=C and D,soft clip={domain=0:0.6336}], my output file comes out blank showing just the ...
1
vote
1answer
58 views

How to highlight a region in a Pgfplots graph based on an axis' values?

I want to highlight the region where the two measures below, represented with dots and error bars, agree: This is the code I'm using: \documentclass[a4paper,10pt]{book} \usepackage{tikz} ...
2
votes
1answer
2k views

PGFplots - single legend in a group plot [duplicate]

I have a group plot and when I try to add a legend it repeats on all subgraphs. I want a single common legend line at the top of the whole graph. \documentclass{standalone} \usepackage{graphicx} ...
1
vote
1answer
172 views

PGFplots multiple ylabels

I want to have multiple y labels in a group plot. Now I have 4 different values for ylabels:Range1, Range2, Range3 and Range4. I want to add a common ylabel say "throughput". How do I do that? ...
5
votes
1answer
39 views

Move position of y-axis label and legend in pgfplots

I would like to move one of the y-labels to the second group of plots on the right and legend more to the center of the plots as shown here: Here is the code: \documentclass[11pt]{book} ...
3
votes
1answer
60 views

pgfplots legend with two ordinates (lines and bar chart)

In the legend, I would like to have a line for the red and orange lines (as it is the case), and ybar legend style for the rest. I just can't figure out the easiest/best/any way to do it. MWE: ...
4
votes
1answer
110 views

Change thousands separator in pfgplots' ticklabels to space

I am sure that I am repeating an old question, but I couldn't find it in the Tex Exchange browser. I am using french mathematics nomenclature and thousand separation is a space like this 1 000 and ...
2
votes
1answer
39 views

Insert border to area under plot part 2

This question builds from the question posted here. How can I get the plot to show up in red in the region between the shaded region like this: Here is the original code: \documentclass{book} ...
3
votes
1answer
62 views

use tike markers outside of plot operation / use math symbols as markers

I ask this question more to have suggestions than to solve a real problem. When I have to plot data I use pgfplots. On the other hand, in order to keep the code smaller, I use tikz in other ...
3
votes
1answer
35 views

Insert border to area under plot

This post is building from the post found here. How do I go about adding a border to the shaded area under the curve to look like this: \documentclass{book} \usepackage{tikz} \usepackage{pgfplots} ...
0
votes
1answer
19 views

Change y-axis limits in pgf groupplots

This post is building from the post found here. How do I go about changing the y-limits of all the right hand side plots to a ymin of -160? Here is my code: \documentclass[11pt]{book} \usepackage[% ...
7
votes
1answer
188 views

What's the relation between packages PGFplots and TikZ?

I've constated that I can use tikzpicture even if I comment \usepackage{tikz} out, as long as I keep \usepackage{pgfplots}. Isn't tikzpicture provided by package tikz? In which situation should I load ...
6
votes
3answers
88 views

Pgfplot coordinates in another pgfplot

How can I transform coordinates from the first axis plot to the second axis plot with a different scale? One way is to repeat all function calls. But if I've got a random function how can I get the ...
4
votes
1answer
47 views

Removing blank space in y axis legend in pgfplots package

I am making a French science baccalaureate project and I am using the pgfplots package to create graphs from experimentation datas. The only problem is that there's a little blank space between the y ...
6
votes
1answer
321 views

How to glue these cubes together to form one big cube?

\documentclass[tikz]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis}[ view={110}{45}, hide x axis, hide z axis, hide ...
1
vote
1answer
32 views

Pgfplots: Tick coords are being ignored

Working on a bar chart currently and I cannot seem to get the ticks of the y axis to work correctly. More precisely the ytick = \empty (and also ytick = {0,5,10,15,20} ) parameter seems to be ignored. ...
1
vote
0answers
15 views

Pgfplots: Draw angle besides coordinate line and plot [duplicate]

Good day, I want to show in my plot angle between coordinate line and plot like this: Сan anybody help me with it?
3
votes
1answer
54 views

Plot hex numbers in pgfplot

I want to draw a graph from external text file which contains hex numbers (representing integers) like 0x8210 in 4 columns. It seems pgfplot does not automatically recognize the hex numbers. I know ...
4
votes
1answer
165 views

Change line style of contour lines in pgfplots

I have a problem regarding the contour lines that pgfplots can add to 3D plots. I want the contour lines to be dashed instead of solid. I've attached a small example from the pgfplots manual where I ...
2
votes
0answers
34 views

Little problem ploting edge with mesh, pgplots

I'm ploting the function z=1+|x²-y| making \documentclass{article} \usepackage{pgfplots,tikz} \pgfplotsset{compat=1.12} \begin{document} \section{Introduction} \begin{figure}[h!] \centering ...
4
votes
1answer
96 views

How to add legend to pgfplots “contour prepared” plot?

I want to add a legend to a pgfplots contour plot that is generated using the contour prepared option. The legend should contain the colors of the various levels and show the value associated with a ...
3
votes
2answers
51 views

pgfplots: Line style differs between graph and legend

I have a simple example where the line styles in the diagram don't match the line styles in the key. The latter is correct. Using Texlive 2015 just installed. tlmgr says no updates of pgfplots avail. ...
1
vote
1answer
53 views

Manual control over placement of contour labels in pgfplots?

Sometimes the automatic placement of pgfplots's contour labels is not satisfactory. For example, consider this example from the manual (with minor changes), \documentclass{standalone} ...
5
votes
1answer
100 views

Linear regression - trend line with pgfplots 2

Happy new year. I have fitted a trend line of a population-year data with pgfplots. But I get wrong values of slope m and intercept b. By LibreOffice Calc, I got the values: f(x) = 4,478.87 x – ...
14
votes
1answer
243 views

Let ymin be at most 0

I would like to make a graph of some points, where ymin is at most 0. By default, ymin is the value of the lowest point in the graph. I would like to let ymin be the value of the lowest point or 0 if ...
6
votes
1answer
124 views

pgfplots skip hours

For my current project, I need to display a series of percentage changes in a plot. This is the code I have so far \documentclass[a4paper]{article} \usepackage{pgfplots} \pgfplotsset{compat=1.11} ...
9
votes
2answers
166 views

How can I use the \input command in pgfplots?

I have to create a set of groupplots with pgfplots and want to use one centralized definition of the plot style (width, height, x-axis label, etc.). It seemed to me that this should be easily done by ...
9
votes
1answer
2k views

Pgfplots and arithmetic with data files

I have a file (table) with a lot of columns. In the first column I have a time variable and the next three columns represent the vector components of position. Now I want to plot the vector magnitude ...
3
votes
1answer
75 views

All but one ticklabel are showing up in polar plot

I have a problem using custom xticklabels in my polar plot. I need the exact xtick sequence specified by xticklabels but no matter what I do, the first label for 120° is not displayed. ...
13
votes
2answers
1k views

Not recompile unchanged pgfplots graph

I'm writing a document with many graphs containing a lot of data points. Many graphs are finished and I don't need to change them anymore. Since I am improving and correcting the text, I need to ...
9
votes
1answer
2k views

Pgfplots: title covers scientific notation

I have a problem with pgfplots. As you can see by compiling my MWE, the title of the plot covers the scientific notation of the y axis. Is there any way to fix this (move the title or the scientific ...
8
votes
1answer
395 views

Pgfplots: link different single-points graphs

I created the following image using the following code \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{% compat=newest,% /pgf/number format/use comma,% ...
11
votes
1answer
3k views

pgfplots and errorbars

I have a file containing data points that I plot using gnuplot. The file looks as follows: 0.1 0.2 0.001 0.2 0.4 0.001 0.3 0.6 0.001 The first column represent the x axis, the second column ...