{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

9
votes
1answer
6k views

How to show the “data-does-not-start-at-zero” symbol on a pgfplot graph?

I have a graph and it doesn't start at zero. How do I add the symbol (my vague description is mentioned in the title) to the y axis of the graph? If it helps, my graph is a scatterplot.
-2
votes
1answer
92 views

Create graph in LaTeX writer [closed]

How I can to create this graph in LaTeX writer? Please send me code of this graph for LaTeX. Thank you.
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} ...
2
votes
1answer
31 views

Missing folder paths in tikz picture when loaded with tikzscale/standalone

I have a standalone mytikz.tikz picture which loads test.png. Both reside in the folder pics/. My main.tex, which uses tikzscale to load mytikz.tikz, is in the parent folder. Loading the test.png ...
3
votes
1answer
113 views

controlling pgfplots axis labels

I prepare Multiple Y-axis plot -4 Ys YY-YY But I have only one problem, I want my x number only show 0,4,8,12,20 time But when I write commander show me all from 0 to 20 How I will do this? ...
6
votes
2answers
395 views

pgfplots: how to display a label next to my plot when the option clip = true cuts out a part of the graph?

Question I want to attach a label to the curves I draw. My current solution is to add a node after the plot of my function (see the code below). But, when I explicitly cut out a part of my graph, ...
2
votes
0answers
57 views

pgf plots, barplot, irregular spacing between bars/columns

I've created a (grouped) bar plot with three groups of bars/columns, but it would be great if the space between the first and the second group would be a bit larger than the space between the second ...
1
vote
1answer
33 views

Erroneous graph, values are different but the plot is same, what to do?

Trying to plot some data from text file, the values are different but the plots overlap in the end result. The code is this: \documentclass{article} \usepackage{geometry} \usepackage{amsmath} ...
0
votes
1answer
39 views

Draw ellipse axis

I would like to plot an ellipse and its axis in a pgfplots axis. I tried using cross out but then it is diagonally crossed instead of horizontally and vertically. The axis I want are just straight ...
8
votes
1answer
3k views

Boxplot in LaTeX

I am new to LaTeX. How can I draw a boxplot in LaTeX. My data set is as below index median box_top box_bottom whisker_top whisker_bottom 0 1 1.2 0.4 1.5 0.2 1 2 2.3 1.5 2.7 1 2 0.7 1.4 0.5 1.9 0.1 ...
0
votes
0answers
51 views

Can I plot an average-line plot like this with PGFPlots?

I would like to create a plot like this (maybe a bit better looking - this is my attempt): Here is how the data for the plot looks: x,min,max,avg 0,800,3600,2628.571429 1.5,2000,3600,2942.857143 ...
5
votes
3answers
809 views

Alignment of colorbar with colorbar to name

I am trying to make a group of plots with groupplots sharing the same colorbar and the same y axis. An example: \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{groupplots} ...
1
vote
0answers
34 views

What exactly are the 'unsuitable tick labels' mentioned in pgfplots' compatibility warning?

When I use pgfplots, I get the following warning: Package pgfplots Warning: running in backwards compatibility mode (unsuitable tick labels; missing features). Consider writing ...
0
votes
1answer
18 views

How to extract coordinate values from intersections in one \begin{axis} environment to use in a second \begin{axis}.. environment in pgfplots

I would like to plot two graphs, side by side, in two separate \begin{axis}...\end{axis} environments using pgfplots. In one graph I want to plot the n curves y1=x^2, y2=2x^2,..., yn=nx^2. I then want ...
0
votes
0answers
18 views

Lines plotted in front of others, though they should behind in a 3d plot

After converting a figure to TeX using matlab2tikz, I figured there's a little problem. The figure consists of many lines, but there are two different sets of lines a cloud set, forming a stream ...
0
votes
1answer
127 views

Matlab2tikz, alignment of subplot ylabel (large distance from plot)

Matlab2tikz came to my attention in the past month and have been using the simple tutorial from HowToTeX. It has worked great so far only one issue remains, I am unable to anchor the ylabel to the ...
2
votes
0answers
32 views

pgfplots plot only odd 3d segments

Given a table of 3d coordinates like this: x1 y1 z1 x2 y2 z2 x3 y3 z3 x4 y4 z4 I would like in a single \addplot3 command print the the segments that go from the 1st point to the 2nd point, ...
1
vote
1answer
47 views

How to label subfigures in Tikz package?

Making labeled subfigures is a bit tricky using the tikz package. Could someone please show me how to provide each subfigure its own letter (A for the left subfigure, B for the middle figure, and C ...
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 ...
5
votes
2answers
70 views

Enable a default static frame for incompatible browsers with the animate package

I am working on a document where I want to embed animations using the animate package. A minimal compilable example of such would be the following: \documentclass{article} \usepackage{pgfplots} ...
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} ...
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 ...
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} ...
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={ ...
17
votes
1answer
5k views

Option clash for package xcolor

I'm writing a report, and have a rather large table in my appendix. I'd like to emphasize some specific values by coloring some single cells. I'm trying to do it with xcolor. But receiving the error: ...
2
votes
1answer
51 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
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, ...
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 ...
8
votes
1answer
696 views

Plot the probability density function of the gamma distribution

I want to draw gamma distribution with different shape and scale parameters. The following MWE displayed error. The error information is : Here is MWE: \documentclass[border=5mm]{standalone} ...
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 ...
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... ...
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={}, ...
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} ...
8
votes
1answer
204 views

Multi-Line/Wave Generator Package for LaTeX?

I'm looking at my professors slides now: http://www.math.ucla.edu/~virtanen/40a.1.14s/schedule/lec1.pdf The first slides always have these intricate wave lines. If you Google search for "wave ...
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 ...
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 ...
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
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 ...
4
votes
1answer
57 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 ...
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
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, ...
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} ...
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. ...