{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

2
votes
1answer
286 views

x-axis values are very close to each other

For the MWE below: \documentclass{report} \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[T1]{fontenc} \usepackage{pgfplots} \begin{document} \begin{figure}[H] ...
6
votes
1answer
571 views

Making the y-axis range of a plot have more values in some parts

For the MWE below: \documentclass{report} \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[T1]{fontenc} \usepackage{pgfplots} \begin{document} \begin{figure}[H] ...
2
votes
1answer
216 views

Plots with only a few scattered marks and correct legend

I would like to draw several plots with lines and only a few marks. The markes are irregularely spaced, so I used a method alluded to in the pgfplots manual, section 4.8.5 (Legend appearance), page ...
6
votes
1answer
439 views

Plotting a straight line to the peak point of a graph

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

Problem with x filter when trying to filter points according to x value

I am trying to filter points according to its x values. The data may be from a table-formatted text file, or directly typed in coordinates{...}. I tried to use x filter/.code, but for data from text ...
3
votes
1answer
203 views

enlarge axes limits by fixed distance

According to pgfplots manual it is possible to enlarge axes limits using enlarge x limits and enlarge y limits properties. One can specify relative and absolute values, but they are in units of the ...
8
votes
1answer
794 views

Using pgfplots, why do I get “undefined control sequence” when trying to use a foreach variable as a parameter to addplot?

Since I have multiple plots with error bars, I would like to shift the error bars slightly to make the overall plot more readable. However, when I try to do this using the variable of a \foreach as ...
4
votes
1answer
788 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
282 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
331 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
684 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
232 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
444 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
569 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
193 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
674 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 ...
5
votes
1answer
370 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
371 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 ...
5
votes
1answer
568 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
344 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 ...
7
votes
1answer
1k 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
174 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
355 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
357 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} ...
6
votes
2answers
1k 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
164 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
531 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 ...
8
votes
1answer
5k 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
484 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 ...
22
votes
2answers
1k 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
230 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: ...
5
votes
1answer
1k 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
413 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 ...
2
votes
1answer
689 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 ...
10
votes
2answers
407 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
541 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
137 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
433 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
898 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
288 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
722 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 ...
9
votes
1answer
884 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 ...
4
votes
0answers
717 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 ...
10
votes
2answers
635 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
889 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 ...
10
votes
1answer
579 views

TikZ datavisualization or pgfplots?

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
376 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
37 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} ...
7
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
270 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 ...