{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

3
votes
2answers
169 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, ...
3
votes
1answer
128 views

Problem with plotting 3d plot in Latex, I have a sample Matlab plot

I have a Matlab plot shown below which I want to replicate in Latex. The data for Matlab is: i_whole=[ 0 0 0 0 0 3.7000 3.8000 3.8000 4.2000 3.7000 ...
3
votes
1answer
38 views

PGFplots: Tweak two plots to achieve equal heights

The heights of the plots in the following example are slightly differ. Can one get them to equal heights without \resizebox (would mess with fontsize) or setting the height in absolute quantities. ...
3
votes
1answer
98 views

Error message: Dimension too large

I am graphing the restriction of a cubic function on the domain [0, 20]. The function has a maximum value of about 3,079 at about 11.5. To get some view of it, I use the specification unit vector ...
3
votes
1answer
109 views

Custom labels for ybar plot?

I'd like to make a plot where data is arranged in bars, but each bar has a custom label if it is greater than a thousand. For instance, instead of 18,000 the label would read "18k" and for 50 million ...
3
votes
1answer
127 views

Tikz: Position dodge on the x axis?

For my 2x2 factorial data, I want to create a line plot with confidence intervals in Tikz. The x-axis ticks are supposed to have a small offset so that the confidence intervals of the two plots do not ...
3
votes
1answer
239 views

How do I make a Bezier curve with control points in pgfplots

I would like to create a Bezier curve with control points. I'm having no success finding what I want in the pgfplots manual. I was hoping someone could help me. What I would like to do is create a ...
3
votes
1answer
47 views

plot data with pgfplots if meta column meets criteria

I have a data file with many columns, and I want to plot bwgstar vs servers for n=2. So n is the meta column, servers is on the x-axis, and bwgstar is on the y-axis. I want to do this within the ...
3
votes
1answer
118 views

Missing something obvious with tick label styles in pgfplots [duplicate]

Why does this not produce y tick labels in fixed number format? (pgfplots version 1.9 produces y tick labels in scientific format) \documentclass[12pt]{article} \usepackage{pgfplots} ...
3
votes
1answer
179 views

Axis rotation and alignment

I have a problem to rotate an axis. Here is the code I use where the problem occurs : the two axis origins are not aligned. \documentclass[a4paper,11pt,twoside]{article} \usepackage[pdftex, active, ...
3
votes
1answer
93 views

Setting zmin/zmax in groupplot confuses colorbar creation (colorbar is 3d)

When using groupplots and setting zmin and/or zmax in the groupplot environment manually, pgfplots generates a (broken) 3d legend: I assume the issue is that groupplot passes the zmin/zmax settings ...
3
votes
1answer
187 views

two variables foreach loop problem

I want to draw a pulse train on which I write some information like the corresponding angle, etc... But I think I've got a problem with the two variables foreach loop because I can't even compile ...
3
votes
1answer
175 views

Graphing each trigonometric function and its inverse

May I have the code for graphing each trigonometric function and its inverse on the same Cartesian plane? I have the following code for only graphing the sine function, and I got the following error: ...
3
votes
1answer
119 views

Polar pgfplots diagram adds additional whitespace with units library loaded

When doing polar plots in pgfplots (v1.10) I get additional whitespace when loading the units library. How can I get rid of that? I did not observe this before since it is related to the direction of ...
3
votes
1answer
118 views

changing the 3D tick style of pgfplots

Consider this 3D plot: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} \addplot3[surf,domain=-4.5:4.5]{(x^2)-(y^2)}; \end{axis} ...
3
votes
1answer
112 views

Align bar charts from different sources with one xlabel each

I have a pgfplot that reads from two files. I want a bar chart where the values (bars) of one file appear over one xlabel and the values from another file over another (A and B in this example). My ...
3
votes
1answer
79 views

Problematic rendering of mark=+ in pgfplots

Consider the following MWE: \documentclass{article} \usepackage{pgfplots} \usepackage{tikz} \pgfplotsset{compat=1.5.1} \xdef\doPlotCoords{} \foreach \r in {0,1,...,10}{% \xdef\tempCoords{} % ...
3
votes
1answer
172 views

Problem when using pgfplots and pgfornament

I am trying to solve a peculiar problem, but until now no success. Here is the issue: I am writing a long document (a thesis) which consists of plots, decorations, and tables. When I plot the graph ...
3
votes
1answer
94 views

PGFplots: no mark is showing up

I have standard deviation bars but there is no symbol mark. How can I get one to appear? I took the statistical code from TikZ: How to pass a specific table to \pgfplotstableset if used for ...
3
votes
1answer
138 views

Extracted coordinates have wrong value

I am unable to get the right coordinate values for (A) and (B) in the following axis. Did I misunderstand some conversion step or is it because of the data? Picture MWE \documentclass[ a4paper ...
3
votes
1answer
646 views

Using MATLAB area() to shade graph error in matlab2tikz

I generate a graph in MATLAB and want to shade regions. So I use the area() command and set it to display in the right order. MATLAB code for the graph: hold on x = 0:1:5; y = sin(x); plot(x,y); ...
3
votes
1answer
146 views

Automatic pin position on pgfplot when using custom axis

I'm trying to put automatically label several plots. For this purpose, I just discover the pin option to add it to the plots. This solution works rather well, and semi-automatically. However, when ...
3
votes
1answer
364 views

Peculiar tikz-external, pgfplots, tikzscale combination problem

I want to use \tikzexternalize and tikzscale with pgfplots' \addplot graphics command and \clip=false option. I am using three files: A.png, A.tikz and A.tex. A.png can be any graphics file. A.tikz ...
3
votes
1answer
186 views

Draw a surface from scattered curves

I have a few curves determined by some points. I need to plot the surface that they determine. That is, I have this \begin{tikzpicture}[scale=0.8] \begin{axis}[% width=12cm,height=12cm, xmin=0, ...
3
votes
1answer
160 views

Convert PGFplot to html?

I'd like to convert a simple piece of LaTeX code which is basically some text with some centered graphs in between. This is a dummy version of the code I'd like to convert to HTML: ...
3
votes
1answer
292 views

Unable to read in text labels for pgfplots bar chart

I've started using pgfplots and can plot scatter plots where all data is numeric, but I'm having no luck at all with bar charts where the xlabel is text. I've tried to find a solution in the manual ...
3
votes
1answer
393 views

Pgfplots not plotting bar graph with all symbolic coordinates?

I am trying to create a bar graph using pgfplots. Specifically, I have 8 different bins of varying signal length against some computational time. I have set the x axis signal lengths to symbolic ...
3
votes
1answer
139 views

Place several plots on one page

I have 4 plots that should be placed on the same page. Does anyone know how to do it? I need to have a caption/title under each plot (and I cannot place it above the plot as there are numbers), a ...
3
votes
1answer
264 views

\newcommand Tikz argument problem

I have this two commands to read x from y or y from x on a plot. The problem is that the label is 180:#3 with above position instread of #3 east position. The wish (less important) : how to merge ...
3
votes
1answer
564 views

pgfplots: how to load distinct symbolic ticks/labels from file?

I want to plot a matrix of color-values from a csv file. Inspired by this website, I set out to write my MWE below, to which I added this way of dynamically loading symbolic ticks/labels from my data ...
3
votes
1answer
183 views

pgfplots: `nan` in `meta expr` causes “Missing number” error

I want to draw a table/matrix of color-values, where some of the values are missing. Despite having tried using unbounded coords=jump (see this answer), I get the following error: ! Missing number, ...
3
votes
1answer
152 views

Markers (xtick) in PGFplots with higher precision

Graphic The following MWE shows a figure with all identical axis markers (because the scale is too narrow). The option xtick has not "high enough precision". MWE Code I did not find a suiting ...
3
votes
1answer
133 views

Groupplots become misaligned with axis equal image

I have several images I want to align in a groupplot environment. All of the images have the same width, whereas the images fall into two categories when it comes to height, one with "small height" ...
3
votes
1answer
215 views

Marking (multiple) intersection points sinus function and constant function

The intersection of a sinus and a constant function, has multiple results. So my question is how to mark these points. My code \documentclass[11pt,a4paper]{article} \usepackage{geometry} ...
3
votes
1answer
887 views

Collapse range in x-axis with pgfplots? (break x-axis)

I want to plot data from a table file. The data has quite big gaps in the x-axis, making the actual data barely readable. Is it possible to tell pgfplots to kind of collapse the x-axis in a given ...
3
votes
1answer
170 views

Pgfplots label not appearing

\documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepackage{tkz-euclide} \begin{document} \begin{tikzpicture} \begin{axis}[ticks=none, xtick={-10,-9,...,10}, ...
3
votes
1answer
274 views

addplot data frame

Square one: I have about 8 hours of experience. I want to make a barplot in pgfplots and see many great, creative solutions on this blog. All I want at this stage is not to specify coordinates and not ...
3
votes
1answer
298 views

pgfplotsforeachungrouped in groupplot

I want to create a grid of plots with groupplots, where every plot is taken from an external file and included via pgfplots. Due to the fact, that foreach doesn't work nicely in a axis environment, ...
3
votes
1answer
172 views

Gnuplot invisible

I'm trying to plot two implicit curves (using pgfplots and raw gnuplot) but they don't appear in the document. In gnuplot it works just fine so I guess it has something to do with pgfplots but i can't ...
3
votes
1answer
502 views

curious xticklabel style error

I'm receiving the strangest error when trying to plot a simple graph. Let me show you - this works: \documentclass{standalone} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{pgfplots} ...
3
votes
1answer
947 views

Modify the legend-style in pgfplots

I have a question concerning pgfplots. I made a minimal example which is related to the example in the pgfplots manual (page 182): \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} ...
3
votes
1answer
320 views

Omit overlapping xtick labels

So right now I have something like this: As you can see, the xticks on the second (smaller) plot are a complete mess. Is it possible to just show 3 values (the first, midpoint and last ones)? ...
3
votes
1answer
230 views

pgfplots memory overload

I want to plot 5x9000+ data points. I am already using: \usepgfplotslibrary{external} \tikzexternalize and -shell-escape -enable-write18 in PDFLatex. However, I still get the memory error. I ...
3
votes
1answer
532 views

How to use `ybar interval` without skipping the last value

I have the following code \documentclass[tikz]{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{filecontents} \begin{filecontents}{testdata.dat} -3.316988309367815e-07 ...
3
votes
1answer
610 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 ...
3
votes
1answer
1k 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 ! ...
3
votes
1answer
525 views

Adding extra ticks inside the axis environment

I am wondering if it is possible to add extra ticks to a plot without declaring them in the options of \begin{axis}. Consider the following example, where I would like to have the coordinates of the ...
3
votes
1answer
900 views

pgfplots grouped bar chart from file

I am trying to create a grouped bar chart with pgfplots from a file that contains a data table. However in the resulting picture the bars are not grouped but on top of each other. Every working ...
3
votes
1answer
128 views

Force re-reading a data file

I have a data file from which I want to plot odd/even rows seperately, in the same axis. But the table options seem to apply only once, when reading in the data, which only happens once per axis (i.e. ...
3
votes
1answer
672 views

get max/min value in a table column with pgfplot

I'd like to get the max/min value from a specific column table via function \findmax and \findmin in order to use it in ymin and ymax. I really dont get how \pgfplotstablesort function works. What ...