{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

7
votes
1answer
635 views

How to change format of xticklabel when loaded from table

I have the following code \documentclass[tikz]{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{filecontents} \begin{filecontents}{testdata.dat} 6.3e-05 0.8767984145412976 ...
5
votes
1answer
117 views

Wrong plot in pfgplots

I want to plot a function in a LaTeX document. Usually I use either Mathematica, Matlab or Root. At this point I want to use pgfplots in order to keep my document in a complete LaTeX layout. The thing ...
5
votes
1answer
1k views

pgfplots - barplot with multiple bars on same coordinate, but labelled differently

I'm showing several data sets next to each other using multiple \addplot commands within a pgfplots axis environment. These are then further grouped into categories. The output of the graph per se is ...
6
votes
2answers
2k views

pgfplots markers and lines on different layers

When I draw some measured data with the tikzpicture and axis environment of pgfplots I have the problem that the lines and markers are not on the same layer. E.g. line 2 is drawn over line 1 but the ...
9
votes
1answer
385 views

Speed up the compilation of a document with a lot of tikzpictures made with pgfplots [duplicate]

I have a document with a lot of tikzpicture made with pgfplots, most of them take data from files so the compilation may be very long. In order to have only a draft I would like to have blank images ...
18
votes
1answer
259 views

Elements that looks different when printed with colours or in BW

Is there the possibility with LaTeX of having some element that change if it is printed with colours or in black and white? I was thinking about the rectangles around links with hyperref that are ...
4
votes
1answer
2k views

pgfplots: plotting data with gnuplot

I try to plot a data file (test2) which contains a header and 2 columns. My pdfLaTeX (argument: --enable-write18) gives me not the result I get with executing gnuplot.exe. This is the code: ...
2
votes
1answer
110 views

StrSubstitute not working nicely with pgfplots

This question is related to my older question here, but now slightly different. I now have a function that is supposed to take two multivalued arguments. One contains the columns i want to plot. If i ...
0
votes
1answer
627 views

pgfplots ybar glued to the y axis

My ybars are glued to my yaxis. How can I increase the horizontal space between the axis and the first bar, making them more condensed? I already tried setting x = 5cm for instance, but I just want ...
1
vote
0answers
61 views

multiple labels in pgf plots [closed]

I have a box plot with 8 entries. Now I'd like to group them a little. The first four belong to Test1 and the last four to Test2. What I'd like is to Have two xlabels one with 2 ticks (Test 1 ; Test ...
5
votes
2answers
3k views

raw gnuplot in pgfplots

I have a problem with the gnuplot environment in pgfplots. I already set "--enable-write18" in the argument of pdfLaTeX and added the path of gnuplot.exe to the PATH-variable in the advanced system ...
1
vote
1answer
444 views

Including a tikz figure with a reference to a table on file, problems with folder structure

I am trying to include a tikz figure in the chapter 6 of my thesis. I am using separate folders and .tex files for each chapter, as you may notice in the example. This means that in my main document I ...
2
votes
1answer
140 views

Footnote label in pgfplot

I can't find an answer to this problem. My problem is similar to this Footnote on graph title but I would like to have a footnote netxt to one of my x axis labels. Like this symbolic x ...
8
votes
1answer
623 views

Smooth pgfplots

I'm trying to draw the function $f(x,y) = -\log(x)-\log(y)$ as a surface with pgfplots. In order to get smooth level curves, I use a patch plot with patch type=biquadratic. \documentclass{standalone} ...
2
votes
1answer
579 views

Circuitikz works with ground but does not work for rground

If I try to plot the following circuitikz schematic it works: \begin{figure}[bth] \myfloatalign \begin{center} \begin{circuitikz}[american voltages] \draw (0,0) node[ground] ...
4
votes
1answer
1k views

Dimension too large after exporting box plot with matlab2tikz

When exporting a box plot with matlab2tikz I get no errors, but when running pdflatex I get a "dimension too large" error. This only happens with box plots. Still the box plot shows up as it should, ...
9
votes
1answer
1k views

Drawing a ring around a torus (doughnut) using TikZ

I was trying to draw a 2-torus (a doughnut) using TikZ, based on the answer to my previous question Moebius Strip using Tikz, and got the following The result is impressive! However, the vertical ...
4
votes
1answer
2k views

Is there any good and complete tutorial for pgfplots

I'm working on converting matlab files to TiKz, and I wanted to do it as cute as possible... Can anybody help me to find a good and complete tutorial for "pgfplots" ?
4
votes
1answer
2k views

Label and ticks using pgfplots

I am using pgfplots to plot simple functions. For example, \begin{tikzpicture} \begin{axis}[grid=major,xmin=0,xmax=1,ymin=0,ymax=0.5] \addplot[color=black] coordinates { (0,0.2) (0.5,0.2) (1,0) }; ...
3
votes
1answer
159 views

Persistent “hanging” tick label

I have sort of a strange problem. I produced a 3x2 plot array in Matlab, and removed all of the y-axis tick labels. The relevant code (for the problematic plot) is below \begin{tikzpicture} ...
9
votes
1answer
1k 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} ...
3
votes
1answer
808 views

Addplot3 with graphics / Image Offset to Axis

I'm currently working with tikz and pgfplots to set a few plots. It works marvelously for a lot of applications, add I have set a number of plots (especially surfaces from matlab) with help of the ...
4
votes
1answer
227 views

Shading a strip between two intersection points of the curve with the axis

I wish to shade a small strip along the x-axis where the graph of a curve intersects the axis. I have used the following code \documentclass[12pt]{standalone} \usepackage{pgfplots} ...
9
votes
1answer
998 views

Adding several labels (year/month) to a graph in pgfplots

I would like to add several labels to a plot in pgfplots: one label for the month and one for the year, just like in this graph: I tried to use the extra tick label, but I don't know how it is ...
5
votes
1answer
865 views

Combine pgfplots on common background

This image is two tikzpictures side by side, each with a newsprint background (thanks to Background image for pgfplots chart). I want them combined, so they appear on the same torn sheet of ...
3
votes
2answers
207 views

alignment of pgfplot's figures

I'm trying to put to put 2 graphs aligned, here is my MWE: \documentclass[11pt, letterpaper]{article} \usepackage{pgfplots} \usepackage{tikz} \usepackage{caption} \usepackage{subcaption} ...
3
votes
1answer
286 views

Cant scale x-Axis to textwidth

I want to plot some measured values. The y-axis contains the the voltage and the x-axis time stamps. I used matlab2tikz to create this plot: If I want to plot the graph, the x-axis is not scaled to ...
5
votes
2answers
691 views

Gradient colour in tikz pgfplot marker

I'm trying to replicate the dual colours of the circles in this graph: \documentclass[tikz,border={40pt 12pt}]{standalone} \usepackage{pgfplots} \usetikzlibrary{plotmarks} \begin{document} ...
7
votes
1answer
2k views

Fitting a curve from a table! (Tikz/Pgfplots)

I ploted the data from the table below (first vs. fourth column), 3000 1.2970e+00 0.198956 0.258046 3100 8.6050e-01 0.18747 0.161318 3200 5.7970e-01 ...
12
votes
1answer
2k views

locally disable automatic ylabel rotation

Ordinate axis labels are rotated by default. This is not useful in case of short, single letter labels such as $\phi$. How can I suppress rotation easily in a given plot? I couldn't find anything ...
5
votes
1answer
430 views

pgfplots pins in front of the axes

I wish to draw two pins on a plot: \documentclass{standalone} \usepackage{pgfplots,tikz} \begin{document} \begin{tikzpicture} \begin{axis} \addplot {x^2} node[pos=1,pin={[pin distance=0.5em, ...
10
votes
1answer
552 views

pgfplots dollar sign in node, adjust space between bars

I'd like to format the nodes in this bar chart with $ signs (e.g $275). (The sets of bars could also be closer together; perhaps that should be another question.) The answer is probably out there ...
3
votes
1answer
2k views

Undefined control sequence \text when importing Matlab figures

I'm following a tutorial to import Matlab figures through tikz, however after trying to compile the .tex file I get the following error: ABD: EveryShipout initializing macros (./mysphere.tikz ! ...
7
votes
1answer
704 views

Exact scaling with TiKZ-scale

I am using tikzscale to scale all my figures to the same size. This works quite nicely, but sometimes there is a difference in the scaled width. I can manually tweak the scale parameter (using pdfcrop ...
6
votes
2answers
652 views

Plot basic complex transformation in LaTeX

I want to first draw a shaded region on a xy-plane: 0≤x 0≤y≤π and then the image of the above region mapped onto a uv-plane by the transformation f=exp(z), i.e. the shaded region: ...
17
votes
1answer
5k views

Remove the scientific notation which is unreasonable

From the original data, we know that they are nearly 0.087 rather that 0.087 x 10^-2. Why is there scientific notation (10^-2)? It looks ridiculous. Please help me figure it out. Thanks very much! ...
4
votes
1answer
2k views

PGFplots axis with arrow tips at the end

By using the following code: \begin{tikzpicture} \begin{axis}[xmin=0,xmax=40,ymin=0, ymax=42, xlabel=Φρούτα,ylabel=Γάλα] \addplot [color=Blue] coordinates { (0 ,40) (20, 30) (30, ...
4
votes
1answer
731 views

Changing the format to a plot ticks (using pgfplots)

Dera all: I'm using pgfplots to plot the data from the table below (forst vs. fourth column), 3000 1.2970e+00 0.198956 0.258046 3100 8.6050e-01 0.18747 0.161318 3200 ...
4
votes
2answers
5k views

Placing text inside graphs using pgfplot

My node markers disappear using this code. Is there a better way to do this? \documentclass{article} \usepackage{amsmath} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[domain=0:3] ...
9
votes
2answers
315 views

Adding jitter to a straight line

I have found a post about: How to add a jitter to a scatter plot with pgfplots. I'd like to add jitter to a straight green line to recreate this graph.. Would this be the best way do you think? Also ...
15
votes
1answer
2k views

Modified pattern does not see the pattern color option

I have modified the north east lines pattern to accept a \LineSpace option that sets the density of the pattern (see the question Can I control the density of a pattern in TikZ?). The code works very ...
4
votes
1answer
595 views

Multiple Y-axis plot (4 Ys YY-YY)?

Can someone help me creat a figure like the attached one which is generated by Origin Lab? According to Jack's suggestion, I made my tex code as follows. The last thing I have to complish is the ...
6
votes
1answer
238 views

Bug with smooth style and \closedcycle in PGFPlots

Could you please confirm the bug? \documentclass{standalone} \usepackage{tikz,pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[axis lines=middle,xmin=0,ymin=0] ...
9
votes
2answers
859 views

how can I change the exponential value to decimal?

I want to make my plot completely in decimal. I used the function \pgfkeys{ /pgf/number format/precision=1, /pgf/number format/fixed zerofill=true } to make my decimal like 2.0 instead of ...
3
votes
0answers
442 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 ...
2
votes
1answer
198 views

Strange behavior with \draw within axis environment

Consider the following snippet of code: \documentclass{standalone} \begin{document} \begin{tikzpicture} \begin{axis} \draw[-latex,cyan] (axis cs:0,0) -- (axis cs:1,1); \addplot coordinates ...
4
votes
1answer
987 views

Adjusting the distance between label and axis in pgfplots

The single label of following plot is intersected by the curve. How can I make it a little far from axis and point to axis by a dashed line? \documentclass[border=5mm]{standalone} ...
7
votes
1answer
246 views

How to change the scale between ticks

Is it possible to change the spacing between two ticks? 4000-3000 = 3000-2000 = 2000-1500 = 1500-1000 \begin{tikzpicture} \begin{groupplot}[ group style={ group name=my plots, ...
4
votes
1answer
618 views

Consistent distance between bar plot groups of different sizes

I'm trying to make a bar plot where i always have one single bar paired against multiple bars. Two problems arise -- first, the first bar is assumed to have 6 other bar buddies and gets pushed to the ...
27
votes
1answer
2k views

How to add a regression line to randomly generated points using pgfplots in Tikz?

\documentclass{article} \usepackage{tikz} \usepackage{color} \usepackage[active,pdftex,tightpage]{preview} \usepackage{pgfplots} \usepackage{pgfplotstable} \begin{document} \begin{tikzpicture} ...