{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

5
votes
1answer
66 views

Single year interval on dateplot x axis

I am plotting a time series with weekly resolution. Minimal example: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \begin{document} ...
3
votes
0answers
39 views

Pgfplots: 3D plot with shader=interp and opacity

I have a rather simple question : is there a way to use shader=interp with an opacity factor in a surf mesh ? Here is an example that does not work: \documentclass{standalone} \usepackage{pgfplots} ...
4
votes
1answer
52 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 ...
8
votes
1answer
121 views

Tikz path with changing color and arrow decorations

How does one draw a path that is changing color as a function of the path length and is decorated with arrows at the same time? Basically, I want to combine these to figure into one: The code for ...
2
votes
1answer
40 views

Only one xlabel for matrix of plots in pgfplots

I am looking for a way to make only one xlabel for a matrix of plots with pgfplots. My current plot looks like this and would like a xlabel where the red circle is drawn. The code for the plot is ...
3
votes
2answers
181 views

How to cut the upper part of the plot?

\begin{tikzpicture} \draw[->] (-1,0) -- (5,0) node[right] {$x$}; \draw[->] (0,-1) -- (0,8) node[left] {$y$}; \foreach \a in {0,...,5} \draw[scale=1,domain=1:3,smooth,variable=\x,purple] ...
2
votes
0answers
30 views

PGFplots 3D: Axis labels are placed “in the middle” of axis instead at the tip

I would like to use the "center"-style for axis and place the label of the axis near the arrow tip. It works in 2D but in 3D the labels for the x and y axis are placed at very weird places. See the ...
2
votes
0answers
36 views

Custom column intervals in a PGFPlots histogram

Is is possible to give columns in a PGFPlots histogram custom interval of different sizes? Eg. I would like my histogram to have five columns over these intervals: [-100,-50[ [-50,0[ [0,1[ [1,50[ ...
2
votes
1answer
25 views

Inputenc error pgfplotsset

When I try to compile my code throw me an error between inputenc and pgfplots. I compile the following code: \documentclass[11pt]{article} \usepackage{amsmath} \usepackage[utf8]{inputenc} ...
3
votes
1answer
36 views

pgfplots, how to select only certain classes to plot

I started to use this fantastic package pgfplots, and I would need a little help. In this example taken from the manual (page 106) \begin{tikzpicture} \begin{axis}[scatter/classes={ ...
1
vote
1answer
74 views

Get pre-defined colors into table in TikZ

I'm doing some plots in TikZ via matlab2tikz, which gave me the following output: \documentclass[a4paper]{article} \usepackage[dvipsnames]{xcolor} \usepackage{pgfplots} \usepackage{tikz} ...
2
votes
1answer
50 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} ...
2
votes
1answer
39 views

How to center a pgfplot? [duplicate]

I am trying to center a graph made with pgfplots with \centering. If I put \centering within a group to limit its scope, the graph does not get centered. If I don't limit the scope of \centering, then ...
0
votes
0answers
49 views

How to change x-axis label position only horizontally keeping the default vertical value using pgfplots

I have two plots of different width next to each other. I want them to share one x-axis label. For this I take the x-axis label of the left plot and shift it to the right so that it is perfectly ...
3
votes
2answers
150 views

Effective potential with tikz

How I can draw a perfect picture of an effective Newtonian potential? I tryed, but it is not so good as I want. \begin{tikzpicture} \begin{axis}[ xmin=0, ] \addplot[ red, smooth, domain=-5:1, ...
5
votes
1answer
236 views

Putting coordinate axes on a TikZ picture

I get the following error: Package pgf Error: No shape named Q is known. Without the \begin{axis} ... \end{axis}, the code is compiled but the images depicted is a jumbled mess. I intended to get a ...
2
votes
1answer
20 views

Disable automatic subticks on semilogyaxis plot with pgfplots

I found many questions regarding why subtics do not appear on a semilogyaxis plot. But I actually would like to not have those subticks as this adds too many ticks so that my plot looks pretty full. ...
1
vote
1answer
62 views

Drawing Vertical Plots

is there any quick way to draw vertical plots with pgf-plots? I need to draw successive vertical lines for the plot below: \begin{center} \begin{tikzpicture} \begin{axis}[ clip=false, ylabel={}, ...
4
votes
0answers
44 views

About the actual meaning of \pgfplotsunitxlength macro from the pgfplots package

From the pgfplots manual (sec. 8.4): \pgfplotsunitxlength,\pgfplotsunitylength,\pgfplotsunitzlength,... Macros which expand to the vector length ||xi|| of the respective unit vector xi... ...
0
votes
0answers
47 views

font size with tikzset and tikzscale not working

I want to set the font family and size for all pgf/tikz figures in my preamble. But when I use tikzscale, then this is ignored. Can anyone help? \documentclass[a4paper,12pt]{scrbook} ...
1
vote
0answers
61 views

How to get two data series in tikz plot?

How do I create a second data series from the code below? I have tried separating the two curves with curly brackets but it was not the correct code. \begin{figure}[h!tp] \centering ...
1
vote
1answer
62 views

How to make this bar plot visible?

I am trying to visualize about 21 data points, each which gives a different value for 3 different tasks, so there are 63 unique values to plot. I have tried using pgfplots colored bar plot, but I ...
1
vote
2answers
78 views

pgfplots mistake with label

i have a problem with my graph. i can't figure out why latex puts this into my description. i had to specify the xticklabels manually. but latex still gives me that number on that position. i'd like ...
4
votes
1answer
56 views

Exclude from fill. It works, but WHY?

I need to create a plot with an area filled outside a circle. Because the filled area has to be colored with 2 different colors, simply applying the odd-even rule did not work. This, it worked for one ...
1
vote
1answer
48 views

Printing a title below the y-axis

I have a graph of two lines. Below the y-axis and centered about the y-axis, I would like to put "Graph of lines in the case $e=f=1$" in a box. "Graph of lines" above "in the case $e=f=1$." Here is ...
3
votes
2answers
73 views

Adding label to a pgfplot

How can one include a label on the x-axis of a pgfplot. Below is a MWE. What I desire is simply to have the label -0.7 indicated on the x axis. \documentclass{article} \usepackage{tikz} ...
4
votes
1answer
99 views

Clipping 3D plots using pgfplots

This is a follow-up question to Plotting a function on a triangular domain using tikz. I am interested in plotting three functions on a triangular domain, specifically x*y ...
0
votes
0answers
38 views

Linear Regression with symbolic x-coordinates

I have been having difficulty with this problem for a few days now so I'm hoping you can come to my aid. I am trying to create a line of linear regression for a very small chart using pgfplots. ...
3
votes
1answer
52 views

Reverse Axes of pgfplots Ternary Plot

I am trying to make a ternary plot, however the default axis is opposite of what I need to accomplish. Here is an example: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} ...
1
vote
1answer
52 views

pgfplots tikzpicture node to the right of axis is cut

I have a piecewise-defined function and would like a describing node to the right end of it. Unfortunately the node is cut and not visible using this code: \begin{tikzpicture} \begin{axis}[ ...
3
votes
0answers
50 views

Labeling only one tick mark but having other tick marks on x-axis

The code provided has pgfplots mark 5 tick marks on the x-axis (at increments of 5 starting at 5). I would like to have only one extra tick mark labeled - the one at 2. \documentclass[10pt]{amsart} ...
4
votes
1answer
148 views

Plotting a function on a triangular domain using pgfplots

I would like to draw a function on a triangular domain using tikz. For example, I would like to draw the function x*y on (-1, -1) -- (-1, 1) -- (1, -1). This is a MWE for the rectangular domain (-1, ...
1
vote
1answer
43 views

Externalizing figures in consistent size

I'm using pgfplots to plot figures, then I'm using the externalize library to output standalone pdfs, which I include in another document. The problem is that the outputted standalone figures have ...
3
votes
1answer
36 views

Moving one tick mark on y-axis to the right of the y-axis while keeping others to the left of y-axis

I have a plot for the function y = 15x - (1/4)x^{3}. I am labeling the local maximum value of the function with 20\sqrt{5} on the y-axis. I also have other tick marks on the y-axis. I want the ...
2
votes
0answers
40 views

Centre plot inside a node (Sigmoid Neural Node) [closed]

Essentially I want to make a graph topology of a neural network. Since I have different type of nodes (rbf, sigmoid, linear) I want them to have in the node a shape of the function, something almost ...
2
votes
1answer
47 views

pgfplots very small Y values

I need to plot the following function: ...
3
votes
1answer
46 views

pgfplots “every quiver plot” style key?

I would like to add the same set of options to every pgfplots “quiver plot”. PGFPlots provides style like every axis plot to add to every plot, but quiver plots are created inside a quiver={...} ...
4
votes
1answer
43 views

pgfplots cannot read file

I am trying to use package pgfplots to read data from a file. This code is compiled on MacTeX 2014 under OSX 10.8. Here is a snippet from the file in question: etotal.dat T Y 0.7618 0.060 ...
6
votes
3answers
173 views

Text projection onto plane in 3D pgf plots

I'd like to have text that appears as though it's written "on" one of the walls of a 3D tikz plot. MWE: \documentclass{standalone} \usepackage{tikz,pgfplots} \usetikzlibrary{positioning,3d} ...
0
votes
2answers
104 views

Rectangular Approximation Method (Riemann Sums) Diagrams

Does anyone know how to make relatively simple diagrams like the images below? Is there a some sort of "template" I could use perhaps? I'd like to code my Calculus notes but I'm not sure how to make ...
7
votes
3answers
218 views

cannot combine \foreach and \draw

I just cannot debug this code. After typesetting it keeps on giving the error of: "Undefined Control Sequence" When individually coding rectangles for each set of coordinates the code works though, ...
0
votes
0answers
47 views

Pgfplots externalizing figures: (inconsistent) white borders

I'm using the external library \usepgfplotslibrary{external} \tikzexternalize[prefix=tikz_figures/] to externalize my figures from one document and include them in another. The problem is that the ...
10
votes
1answer
175 views

Draw closed section of sphere using pgfplots

I want to draw a section of a sphere to represent its volume. I have currently got the following: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.11} \begin{document} ...
3
votes
1answer
79 views

How can I add a reasonable padding to this bar chart?

I’m trying to add a uniform padding to all sides of this bar chart. In a different answer on tex.SE I have found the following code, however, I wasn’t able to find values for xmin and enlarge x to ...
2
votes
0answers
32 views

pfgplots: customize annotation for one point

I have the following scatter plot: \documentclass[class=elsarticle]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ enlargelimits=0.2, xlabel=Depth, ...
2
votes
2answers
47 views

Reducing space between annotation text and the line in a pin (PGFplots)

I need to reduce the distance between annotation text and the line which together form a conventional pin in pgfplots, see the figure below. Could anybody help me with this, please? MWE: ...
2
votes
1answer
32 views

pgfplots is skipping first ytickslabel from file

Rendering the MWE below pgfplots skips the first 'Adiff' label of the CSV. I'm sure this is a no-brainer and easy karma points for experienced pgfplots users, but I am stomped. ...
1
vote
1answer
31 views

Removing multiple scaling factors in pgfplots

I would like to place a single scaling factor in the top left corner, which seems to be default normally, instead of having factors of 10^n at every y axis tick. In other words, I would like to ...
1
vote
0answers
45 views

How to group box plots in pgf / tikz?

Grouping bar charts is easily done using pgf / tikz, e.g., \begin{tikzpicture} \begin{axis}[ width = 0.85*\textwidth, height = 4cm, major x tick style = transparent, ...
4
votes
2answers
148 views

Draw cosine and sine function with periods 1?

I want to draw $\sin(2\pi x) and $\cos 2 \pi x$ $\in [3/4, 5/4]$ in the same coordinate system. How do I do this ? \begin{tikzpicture} \begin{axis}[domain=3/4:5/4,legend pos=outer north east] ...