{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
0answers
774 views

Plotting a histogram from a dat file using pgfplot [closed]

I want to create a histogram from a dat file with two columns, error and frequency. It also has a large amount of bins, 501. I have followed instructions provided elsewhere on this site but the data ...
2
votes
1answer
147 views

How to tell pgfplots to keep empty “series”?

I have a plot with xticklabels defined as symbolic. In a modified version of my plot, I want to set ymin value. When doing this, my plot is automatically updated: all x series having only points ...
4
votes
1answer
733 views

Changing the default file path for \addplot table {myfile}

Is there a way to add a file path prefix (ideally defined by a key) to the "argument" of \addplot table. Something like \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{% table file ...
2
votes
1answer
197 views

ticks disappearing for diverging (out of range) plots

my xticks disappear for some plots even though I explicitly ask for them. Here is my MWE. The function goes to -infinity at the right border of the interval. \documentclass{article} ...
3
votes
1answer
608 views

tikz plot change one value of x axis

I'm not so familiar with tikz plot. The plot looks actually like it should, but I would like to change the last position value 300 to n in the plot. Is this possible ? \documentclass[]{article} ...
3
votes
2answers
689 views

LaTeX - PGF groupplot - polar axis

I can't find the answer anywhere, is it [and how] possible to make a group plot of multiple polar graphs? For grouping, I use pgf.groupplot library, for polar axis, I use \begin{polaraxis} from pgf ...
11
votes
2answers
8k views

How to modify the image of an legend entry

I have the following code \documentclass[tikz,convert={size=640}]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ legend entries={simulation sample 1, ...
5
votes
1answer
637 views

TikZ/PGF \closedcycle to y axis

Consider the following MWE: \documentclass{article} \usepackage{tikz, pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} \addplot [domain=0.7:1.6,samples=20, fill=red!50!white] ...
8
votes
1answer
981 views

Pgfplots: Drawing Arrows Along Contour Plots

I would like to draw "stealth" arrows in place of the "0" labels along the trajectory in the phase portrait pictured below. I decided to draw the trajectory using the contour functionality of ...
6
votes
1answer
1k views

Is it possible to shift ticks position in a graph to match APA style ?

I have been looking for a while for a way to shift ticks on a graph. I found many options regarding ticks positions, labels or size but I could not find a way to move them orthogonally to the axis ...
2
votes
1answer
713 views

pgfplots: Scatter plot with multiple series side-by-side

I have multiple machines on which I did benchmarks. Now I wan to use pgfplots to show multiple y values (the variance in the measurement) for a single x value (a benchmark parameter) within a single ...
1
vote
0answers
285 views

A workaround for visualization depends on and ybar stacked [closed]

Are there any workarounds for the bug? The "visualization depends on" function causes an error with stacked plots. With "ybar stacked", the minimal example generates the error message ...
7
votes
1answer
4k views

How to change xticklabel or yticklabel style to Percentage?

When using tikzpicture in the pgfplots package, how can I change use PERCENTAGE for xticklabel or yticklabel. Here is a simple example: \documentclass[a4paper]{article} \usepackage{pgfplots} ...
5
votes
2answers
1k views

pgfplots: Displaying a bar graph and a table from the same input file

I try to display on one Beamer slide a bar graph and a table with numbers taken from the same input file (to avoid repetition when copying the data). For now, I am stuck on this error message: ...
1
vote
1answer
360 views

Set xstep and ystep pgfplots

I have this MWE. My question is how can set xsep and ystep in the axis so that they will properly appear, and without have to know in prior the range of values: xtick={0,0.1,...,1}, ...
3
votes
1answer
2k 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 ...
5
votes
1answer
2k views

Adjusting width of ybar interval separator to width of histogram bars

I have an array of numbers for which I want to create a histogram for the first 22 entries. I want to show both the first few entries of the array as a bar plot as well as the histogram in two ...
8
votes
1answer
3k views

Lining up angled tick labels on a pgfplots bar plot

I'm trying to produce a bar chart for publication with math text in the tick labels. The most readable layout would be to angle them, but when I do they clash with the axis and are difficult to relate ...
2
votes
1answer
455 views

tikzpicture and pdf - x axis partially disappears

I would like to know why the x axis partially disappears, given the following code. Is it a PDF problem? Also, is there any option to connect the midpoints automatically but not in a smooth fashion? ...
8
votes
1answer
614 views

Align pinned nodes in PGFplots

I'm working with plots generated from matlab2tikz and I have several plot lines close to each other. Labeling them is proving difficult, but I believe a good looking solution could be to list the ...
7
votes
1answer
3k views

Global legend for multiple figures

Similar to this question, I need output as follows but in a neat way. My solution code is not neat any more: I added a dummy axis to use its legend. Also the legend must be at top of the page. Here ...
5
votes
1answer
606 views

How can I make logarithmic axes through the origin?

I have this graph: The x-axis looks like it should look like: arrow head at its end label near the arrow head it goes through the origin But the y-axis does strange things: It does not go ...
1
vote
0answers
109 views

Issue with PGFPlots text [closed]

I'm trying to generate some plots using TikZ, with the following code: It's not about babel, fontenc, or inputenc; I've tried removing them to no avail. \documentclass[a4paper]{article} ...
1
vote
1answer
552 views

Debugging TikZ and PGFPlots compatibility issue

I just tried to compile an old TikZ code (which as far as I recall compiled perfectly in the past and was not changed in the meanwhile) and I faced some serious compilation issues related to TikZ. ...
4
votes
2answers
1k views

How to shift x ticks in pgfplots having multiple stacked bars

My goal is to generate this bar chart: I was able to achieve this chart as my MWE: \documentclass[parskip]{scrartcl} \usepackage[margin=15mm]{geometry} \usepackage{pgfplots} ...
2
votes
1answer
584 views

Pgfplot figure off-center

I create a tikzpicture in standalone mode (see code below). Then import the resultant .pdf file into my document via \includegraphics (see pic). However the axis labels are cut off and part of the ...
5
votes
1answer
1k views

How to increase/fit the width of x-axis to fit all points in pgfplots?

This is my code: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[scale only axis, symbolic x ...
4
votes
3answers
4k views

Change white-space border in pgfplot, or crop PDF figure?

I am toying a bit with the pgfplot way of presenting data. It makes pretty nice plots, but unfortunately it is not very economical with my space. This is a problem when using a multi-column layout. ...
5
votes
0answers
153 views

Pgfplots closes plot cycle when it should not [closed]

I experience a strange behaviour with pgfplots. I plot a series of datasets with no problems, but suddenly when I plot my last set of data, a line is drawn from the last point back to the first ...
3
votes
1answer
746 views

How to increase numbers precision in TikZ histogram

I entered fixed point numbers in the following code: \begin{tikzpicture} \centering \begin{axis}[xbar,bar width=0.2cm,legend style={at={(0.5,-0.15)}, xmin=0,xmax=0.8,anchor=north,legend ...
9
votes
3answers
7k views

Easiest way to plot matrix image

Is there an easier way to create this in pgfplots than plotting the matrix image externally and using addplot graphics (as on p.42 of the pgfplots manual)? A mesh plot (as suggested for plotting ...
2
votes
2answers
2k views

How do I add a marker to TikZ plot for specific x coordinate? [duplicate]

Please take a look at my code. I am plotting values from a file and I want to add a marker at the x coordinate of 100 GHz. \documentclass[convert={density=400,outext=.png}]{standalone} ...
4
votes
1answer
194 views

pgfplots Axis-Subsections on X-Axis on a bargraph?

I am trying to get pgfplots to draw some bargraph like this: but I cannot figure out how to get pgfplots to add the second X-axis-labeling so I could actually draw the data in a way that would be ...
23
votes
3answers
3k views

How can I make plots with TikZ which look like the new Mathematica 9 plots

The new Mathematica 9 is out! I would love to know how to make similar plots to the one's advertized, particularly the following: and Here is a simple plot to get started. %& -shell-escape ...
4
votes
1answer
641 views

Grid lines in top-view surface plot

I'm almost satisfied with my graphs, only grid lines are missing. What I'm basically doing is a sort of density plot / color plot by letting pgfplots generate a surface and viewing it from the top: ...
5
votes
1answer
2k views

pgfplots: Positioning “node near coord” at the bottom of the bar

I would like to position nodes near coords at the bottom of the corresponding bar, right by the X axis. Here's what I've got now: \documentclass{report} \usepackage{pgfplots} \begin{document} ...
2
votes
0answers
31 views

node at sloped path and/or not respecting every path/.style [duplicate]

I'm producing a schematic Nyquist plot, and I want to create an arc between the x-axis and a straight line, which should be denoted PM (phase margin). I use the intersections library to find the ...
16
votes
1answer
2k views

Tikz: intersection of line and plane

I am struggling with drawing a plane and a intersecting line. I would like to have the line C,P',P in the image, disappear if it is "behind" the plane and have it reappear if it is not behind the ...
4
votes
1answer
360 views

Increasing error bar in Pgfplots?

I read data from a table to create a plot in Pgfplots: x y sigma 1 2 0.3 2 4.1 0.4 where sigma is the standard error associated with y. Since y and sigma together are are standard ...
5
votes
1answer
332 views

question about pgf-blur package in xelatex

Here is my code: \documentclass{article} \usepackage{pgfplots} \usetikzlibrary{shadows.blur} \begin{document} \tikzfading[name=fade down, top color=transparent!30, bottom ...
4
votes
1answer
237 views

Skip specific string in a numeric column while using pgfplots

In this question, NaN string is omitted as mentioned in the manual of pgfplots package. My input data contains UnDf and I want to omit/skip this value. Here is sample code from the question I have ...
6
votes
2answers
577 views

Align pgfplotstabletypeset and plot left and right

I can't get the plot and the pgfplotstabletypeset to align so that they are right next to each other. Is this possible at all? Please help me. This is what it looks like at the moment: This is my ...
1
vote
0answers
105 views

error generating separate pdf from pgfplots [closed]

When I followed the chapter 7pgfplots manual (Revision 1.8) to generate seperate pdf files from the pgfplots figure I could not get the required pdf files. MY file name is test.tex Here is the ...
17
votes
3answers
4k views

\pgfmathsetmacro - dimension too large (biggest value allowed?)

I want to import some data with parameters to parametrize some plots. After importing a table, I assign specific variables of the table to a placeholder by using \pgfplotstablegetelem. And it works ...
5
votes
2answers
874 views

TikZ Function Number Too Big

I want to draw two beta distributions comparing a prior and posterior distribution but it seems that the coefficients are too large for LaTeX? How do I fix it without changing the function? It has a ...
7
votes
1answer
244 views

Strange interaction between fontspec, lua and pgfplots

While trying to combine some Lua code with plots written in pgfplots something went completely wrong. I have no idea what causes the problem, as the error message is a bit opaque to me. Here is the ...
2
votes
1answer
533 views

read strings from csv file for usage as figure meta data

I got the following problem, I use pgfplots(table) to generate plots and tables in my latex document from generated data. I would like to read additional information from a metadata file. The reason ...
5
votes
1answer
824 views

Counting points from csv file pgfplots

I am importing data from a .csv file to obtain a scatter plot, here's the MWE: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{ jitter/.style={ x ...
5
votes
1answer
825 views

Small x axis range in pgfplots

I try to plot data in pgfplots. My data file has 1001 points in a range (x axis) from 2499999500 to 2500000500, so I have steps of 1. I get the message “Package pgfplots Warning: Axis range for axis x ...
7
votes
1answer
1k views

Compiling CircuiTikZ with -shell-escape (pdflatex)

I'm trying to use both CircuiTikZ and pgfplots. In order not to overflow LaTeX memory, I use the TikZ externalize library with -shell-escape command in pdfLaTeX. It compiles the pgfplots nicely, but ...