{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

4
votes
0answers
2k views

Set ticks precision with pgfplotsset [closed]

First, this forum has been a great resource for me for some time now. I recently started using pgfplots and tikz, so some things I still need to figure out. I hope my question will be clear and the ...
2
votes
2answers
1k views

Using pgfplots, is there a way to overlay multiple stacked plots with different ranges?

I am using the accepted answer to the question “Is there an easy way of using line thickness as an error indicator in a plot?” to draw error bands around my regular line plots. However, I find myself ...
13
votes
1answer
789 views

Is there a workaround against loss of precision in pgfplots axis?

I am generating a bunch of plots automatically using pgfplots. For some datasets the span of data in one axis (y) is relatively small (relative to the absolute value) and therefore pgfplots when ...
6
votes
1answer
1k views

Pgfplot barplot with cluster of stackedbars

How can I create a pgfplot that have two stacked ybar for each "point in x axis" ? I wan't something like this: I already have a graph that have one stacked bar for each x point. Some hint on how ...
2
votes
1answer
700 views

PGFPlots \addplot cannot read regression column [closed]

I am trying to plot a small dataset and a regression line for it. Here is my MWE: \documentclass{article} \usepackage[T1]{fontenc} \usepackage{tikz} \usepackage{pgfplots} \usepackage{filecontents} ...
1
vote
0answers
57 views

pgfplots: function with a filled confidence band [duplicate]

Possible Duplicate: Is there an easy way of using line thickness as error indicator in a plot? How can I plot a function with a filled confidence band using pgfplots? I have table data in ...
3
votes
0answers
93 views

width=\textwidth yet plots overlaps with margin [duplicate]

Possible Duplicate: pgfplots: how can I scale to text width? Without using such command as trim axis=left or scale only axis, I would expect the following plots to be contained in the text ...
6
votes
1answer
1k views

Manually add legend symbols in text (without \label and \ref)

I would like to add legend symbols from pgfplots in my text. I am aware of the possibility to use the \label and \ref commands but my setup is complicated and I fear that making it work will more time ...
1
vote
1answer
450 views

Vertically aligned legend to PGFPlots subplots

What I want to do is to have 3 PGFPlots subplots and the legend arranged in four equally sized boxes. However, when I use the following code, in the output the legend is not vertically aligned with ...
6
votes
1answer
2k views

Create custom colored PGFPlots ybar with consistent spacing

I am trying to create a ybar graph that has consistent spacing between a set of columns. I have obtained the color scheme I need in the following example, based off guidance from this question on ...
8
votes
1answer
955 views

Custom legend for intensity plot

I created an intensity-plot (x and y axes are positions, the color of the point gives the intensity) in an external program (igor pro) and included the "bare" plot via the \addplot graphics command ...
9
votes
3answers
2k views

Improved Unit Circle Animation

I'm trying to improve the sine/cosine animation provided on texample.net to suite my needs. I wanted to add a plot of the sine and cosine part and tried using pgfplots for this, as it can evaluate and ...
10
votes
1answer
4k views

Disable scientific notation for Y-axis and data in pgfplots?

I've been trying to figure out how to change the chart from scientific notation to just show the 5 digit numbers. I've tried scale and scale ticks with not success. How can I change the y-axis and ...
1
vote
1answer
506 views

pgf stacked bar graph with line plot

I want to draw a stacked bar graph plot with one parameter as a line plot. Here is my code below - \begin{tikzpicture} \pgfplotstableread{Figures/measurements.dat} \datatable ...
2
votes
1answer
657 views

pgfplots: x-axes do not align due to different labels

This is my first post, so I hope I do everything right :) I have the following problem: Using pgfplots I create two graphs next to each other which have identical y-axes, but different x-axes. I want ...
2
votes
0answers
683 views

How to plot a data from excel file with multiple sheets [closed]

I am really new in latex. I have a data from excel file, which contains different sheet. I need to plot these data on latex, any one have an idea?? I need it urgently please.
7
votes
1answer
2k views

Draw outside axis with pgfplots

I have the following diagram, and would like to extend the red line so it crosses the axes and goes on for a bit at the start and the end like in the second picture, but I would like the red and blue ...
3
votes
1answer
151 views

y axis mark disconnected from axis after shifting upwards

as you can see I have shifted up the second axis. However I would like to fix the zero as it has been disconnected from the y axis. \begin{tikzpicture}[scale=1.5] \begin{axis}[ date coordinates ...
8
votes
3answers
1k views

Bar chart given minimum and maximum values

I want to create a bar chart that looks like the one in the picture. For each x value I have the minimum and maximum value that represent the height that each bar should have. My problem though is: ...
5
votes
1answer
1k views

Drawing a trend line on a bar chart

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] ...
11
votes
1answer
3k views

pgfplot pin length

Consider the following example from the pgfplot manual. \begin{tikzpicture} \tikzset{ every pin/.style={fill=yellow!50!white,rectangle,rounded corners=3pt,font=\tiny}, small ...
2
votes
1answer
652 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
822 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] ...
3
votes
1answer
398 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
760 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
539 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
256 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
3k 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 ...
5
votes
1answer
2k 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
321 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
542 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
310 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
588 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
1k 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
403 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
1k 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
584 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
677 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
1k 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 ...
3
votes
1answer
659 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 ...
9
votes
1answer
3k 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
232 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} ...
6
votes
1answer
651 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
696 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} ...
13
votes
2answers
3k 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
202 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
860 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 ...
10
votes
1answer
9k 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
654 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 ...