{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
1k views

Making chart grids be finer grained

For the MWE below: \documentclass{report} \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[T1]{fontenc} \usepackage{tikz,pgf} \usepackage{pgfplots} \usepackage{slashbox} ...
3
votes
1answer
314 views

Bringing the parts of a bar chart closer

In the MWE below: \documentclass{report} \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[T1]{fontenc} \usepackage{tikz,pgf} \usepackage{pgfplots} \usepackage{slashbox} ...
4
votes
1answer
478 views

Broken text on bottom of pgfplots

I am using code below to create a graph. On the bottom there are two braces denoted $t_1$ and $t_2$. However numbers 1 and 2 are broken (lower part is not displayed). What is wrong with my code? I ...
4
votes
1answer
1k views

How to include arrows in a .tikz file, which is generated with matlab2tikz?

I made a plot with matlab. Then I generated a .tikz file with matlab2tikz. Now i want to insert arrows in the .tikz file and also write something left of the arrow. I can make arrows and text in the ...
2
votes
1answer
293 views

How to use listings inside pgfplots captions?

I need to add a (general) listings code in a plot caption. For some reason listings (inline) doesn't interact well with \addlegendentry, what can I do to make the same code work outside and inside an ...
2
votes
1answer
525 views

pgfplot barchart moving x-axis up

For the MWE below: \documentclass{report} \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[T1]{fontenc} \usepackage{tikz,pgf} \usepackage{pgfplots} \usepackage{slashbox} ...
7
votes
1answer
890 views

Extend axis outside boxed area in pgfplots

I prefer the look of the second graph but want the functionality of the first. That is, define the equation by its name rather then transforming points. How can I extend the axis outside the boxed ...
3
votes
1answer
306 views

pgfplots discarding xtick coordinates

I'm creating a several graphs with pgfplots. The problem I'm coming across is that some graphs do not have a value for the last coordinate as per the example below (and I want to keep the ticks on ...
6
votes
1answer
992 views

How to expand linear regression fit to the full x-axis range while using semilogyaxis

Since I was asked in another post: Trend line or line of best fit in pgfplots to ask this question explicitly, I'm now doing so: How can I expand the linear regression fit, generated with for ...
6
votes
1answer
510 views

Filter table rows for regression

I have a table containing a flag and x and y values. I'd like to have a regression for all rows with 1 in the first column. How can I do this? \documentclass{article} \usepackage{array} ...
8
votes
1answer
555 views

Single double-logarithmic axis

I'm trying to make a plot which has a double logarithmic y-axis. Is this possible? This should change the distance of each logarithmic increment, for I want to plot so called Bit-error rates. To have ...
6
votes
1answer
985 views

How to fill an area bounded by grid lines and axes?

With pgfplots one can for axis use the options minor xtick and minor ytick together with grid=minor to manually produce grid lines. If one use such grid lines one may want to emphasize a certain ...
2
votes
1answer
529 views

PgfPlots duplicate x-axis labels

I have some repeated numbers on my X-Axis. Here is my code- \begin{tikzpicture} \pgfplotstableread{Figures/measurements.dat} \datatable \begin{axis}[symbolic x ...
8
votes
1answer
2k views

Using \addplot+ and \foreach in pgfplot

I have four text files with each 21 columns, and I want to plot, for each file, the first column as x, and then the 20 next columns as y. For each file, then put it all together on the same graph. ...
3
votes
2answers
213 views

Adding a x tick but not the corresponding y tick

I'm generating pgf plots on the fly and I would like to avoid adding non integer y ticks on my plots, while keeping all the x ticks. Here is a MWE: \documentclass[10pt]{article} \usepackage{tikz} ...
5
votes
1answer
545 views

Plot a square grid with a subset of squares marked using pgfplots

Recently I have discovered pgfplots and I am impressed by the capabilities of this package. There is however one type of plots which I cannot figure out how to define conveniently using pgfplots. ...
1
vote
1answer
607 views

Using pgfplots, why do minor ticks disappear when I change the base in logarithmic plots?

Plotting the same thing, just with different values for log basis y, the minor ticks disappear. \documentclass{article} \usepackage{fullpage} \usepackage{tikz} \usepackage{pgfplots} \begin{document} ...
11
votes
2answers
2k views

Compiling a document with PGFplots processing only every x-th data point? [duplicate]

Possible Duplicate: How to select a finite number of samples from the file when plotting using pgfplot Compiling my document with many PGF Plots, each containing thousands of data points ...
3
votes
1answer
189 views

Interconnected graphs in pgfplots

Is it possible to create interconnected graphs in pgfplots (e.g. common grids), like the picture below? And, related to the question above, if you have one tikzpicture environment with two axis ...
3
votes
1answer
752 views

How to only draw grid lines for ticks with labels in pgfplots?

I'm using the dynamic dict from mail-archive.com It generates automatically the data for the x axis. I want only every second (or every third, ...) tick and grid line. I've already managed to omit ...
9
votes
1answer
7k views

Axes label positions

I am using pgfplots to create simple theoretical graphs, so I use middle axis line style. What bothers me is that x axis label is above instead of below or right of x axis and y axis label is ...
2
votes
2answers
587 views

Strategies to visualize multiple two-dimensional regressions?

Hopefully I can describe my question more clear here in the content than in the title. It might be more about visualization strategy than specific pgfplots techniques. The problem is about regressions ...
27
votes
3answers
2k views

Is there an easy way of using line thickness as error indicator in a plot?

I have several curves/datasets (obtained from Monte Carlo simulations) with x-dependent y errors I would like to plot with the errors somehow indicated. Since each curve consists of quite a large ...
6
votes
1answer
364 views

How to use the = sign in captions

I'd like my axis to be labeled $s(t)=\delta(t)$, but this does not work because of the = sign (key-value separator). I had a look into the "Comprehensive Symbols Guide" referenced here: ...
6
votes
1answer
2k views

pgfplots: minor ticks starting at 1.5, not 0.5

The following code is used to produce the plot below. \pgfplotsset{ axis equal image, xtick={1,2,3,4}, ytick={1}, minor y tick num={1}, minor x tick num={1}, xmin=-0.3, ...
4
votes
0answers
597 views

How can I display negative error bars in a logarithmic plot using pgfplots?

I have error bars representing 95% confidence intervals in a logarithmic plot. Some of the error bars extend to negative numbers for which the logarithm is undefined, so pgfplots simply drops the bar ...
4
votes
1answer
1k views

Tikz overlay with subfig, axis & externalize

I am trying to draw lines between two different tikz-drawings, placed in subfig-environments, for example the corners of the small blue rectangle in the left image and the corners of the axis ...
11
votes
2answers
715 views

How can I plot two lines in the same style (using cycle lists) with pgfplots?

I am using cycle lists and the \addplot+ command to plot lines in different styles. I would like to plot several things using each style, however, like this: % Plot using style 1 \addplot+ ...
3
votes
1answer
636 views

How to plot coordinate between two xticks?

I want to plot some data using pgfplot. Here is a code I have written: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat = 1.3} \begin{document} \begin{tikzpicture} \begin{axis}[ ...
3
votes
1answer
179 views

Use BPchem Numbering As Labels in a PGFPlot

So, I yanked this example right from the manual on pgfplots, because this looks highly complex. The graph is exactly what I want to have, except instead of the custom labels it provided, I want to be ...
2
votes
1answer
683 views

How can I add a legend in aligned subplots

I want to have two subplots with the same x axis aligned above one another. In the manual I read, that I should use \matrix{} to achieve this. Now I want to have legends in both plots. But since the ...
3
votes
1answer
1k views

tikz externalization and multiple axis using \ref and \label for legendentry

I have a plot consisting of two y-axis. When I'm adding the legendentries in each axis environment, the first legendentry will be plotted "behind" the plot of the second axis. Thus I thought a ...
2
votes
1answer
354 views

pgfplots: how to check if addplot filters all data

is there an easy way to check if a \addplot(+) table [...] command in PGFPLOTS has any drawn any points? The reason is that I want to process the data dynamically, and if the plot is empty, the legend ...
3
votes
1answer
1k views

edit x-y data from different files/tables

I've two one column data files (A.txt and B.txt). To plot them together first I load dataA with \pgfplotstableset{ create on use/dataA/.style={create col/copy column from table={A.txt}{0}} } Then I ...
10
votes
1answer
1k views

How can I filter/select data (float, text) from a table and plot it?

Note I post this question in addition to a recent question (see below) with a more detailed description of the problem: This was the original question: How can I filter/select data from a table and ...
5
votes
0answers
1k views

pgfplot vs gnuplot [closed]

I am writing a document containing many plots. I have used gnuplot in the past and I love it. It's powerful and you can do anything you want. But when I import a graph generated from gnuplot, the ...
11
votes
2answers
1k views

pgfplots quadrics

I wonder whether it is possible to draw the three following quadric surfaces (cone, hyperboloids) x^2+y^2-z^2=0 x^2+y^2-z^2=1 x^2+y^2-z^2=-1 (and the axis) using pgfplots 3d or TikZ as it is ...
4
votes
2answers
1k views

using math symbol \times in symbolic x coords

I need to use the math symbol \times on the x axis because the x axis represents image dimensions. But latex doesnt allow me to proceed with this. It gives me hundreds missing \endgroup inserted ...
16
votes
1answer
929 views

TikZ datavisualization or pgfplots? [duplicate]

I want to create a few plots that should have the same style as my main document and it seems tikz is more than capable of achieving that. Now while browsing the current tikz documentation (2.10 ...
4
votes
2answers
461 views

Why do I fail to import external 3D plots with pgfplots?

I have tried to import external 3D plots from Matlab et.al, but to no avail. To show what I managed to accomplish, I present a minimum non-working example below. Any ideas of what I'm doing wrong? ...
1
vote
0answers
38 views

Extract x and y coordinates when using intersectionlibary [duplicate]

Possible Duplicate: Coordinates of intersections I have the following minimal plot \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{intersections} ...
9
votes
1answer
2k views

How can I filter/select data from a table and plot it?

I have a table with data from a file and before anything, I sort the data. Then I would like to filter only the rows that have a specific value. There has been a similar question which almost contains ...
4
votes
1answer
340 views

How to have extra row of tick labels appear only once per row of plots?

This is a follow up to How to add another row of tick labels? I currently have another row of tick labels for every plot in a group of plots. What I want to do is to have the descriptions for the ...
2
votes
1answer
183 views

Error when there are plotting macros before \pgfplotsinvokeforeach

Why does \pgfplotsinvokeforeach produce ERROR: Undefined control sequence. when there are plotting macros before it inside a groupplot? \documentclass{article} \usepackage{pgfplots} ...
6
votes
1answer
606 views

How to add another row of tick labels?

Rather than adding a second x axis by putting it on the other side of the plot I would like to add one implicitly simply by adding another row of tick labels to an existing axis. What I am after is ...
5
votes
2answers
234 views

How to draw a plot with an axis that resets?

To show the properties of a function with two variables two-dimensionally I want to fix one variable but let it increase between plots that are placed horizontally next to each other, e.g. plot the ...
1
vote
1answer
769 views

pgfplots: plot smaller range of table and still use enlargelimits=true

I am using pgfplots to plot two simple (x,y)-plots of the same data from a table file. The first plot shows all of the data points and in the second plot I want to zoom in on some specific range of ...
1
vote
0answers
43 views

pgfplots: How to change the alignment of one single node [duplicate]

Possible Duplicate: How to display labels on points of a tikz plot I plot a scatter plot using pgfplots and automatically label every single mark with its description. When two marks are ...
5
votes
2answers
1k views

PGFPlots: line opacity gradient?

Imagine a very simple PGFPlot, e.g.: \begin{tikzpicture} \begin{axis} \addplot+[no marks]{x^2}; \end{axis} \end{tikzpicture} How can I have the line "fade out" from the left to the right of the ...
8
votes
1answer
1k views

pgfplots black and white line graph

hi refered the pgfplots user manual but found no instructions as to how one can proceed with creating a black and white line graph. My graph is as follows \begin{figure}[H] \begin{tikzpicture} ...