{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

7
votes
1answer
576 views

Why does pgfplots plot functions only until x = 5 and y = 5?

Why does pgfplots plot functions only until x = 5 and y = 5, but not any further? \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} %%%< \usepackage[active,tightpage]{preview} ...
7
votes
1answer
606 views

weibull plot with arbitrary y axis scale

I want to draw a function in a weibull plot. The x axis is log, the y axis however goes with log(-log(1-y)) (as far as I understood it from this site). The y axis looks similar to a log scale but ...
7
votes
1answer
2k views

tikz spy library with pgfplots: opacity and grid

When I use the tikz.spy library in order to magnify a part of my pgfplots plot with the use of grids, there are both the original grid and the magnified grid in the magnified area. screenshot: . a ...
6
votes
1answer
242 views

scaling multi column groupplot while maintaining font size and node placement

This is a follow-up to two previous questions: 1: font size scaling and node placement issues using pgfplots and tikzscale 2: Scaling a multi-column TikZ/pgfplots groupplot to page width I would ...
6
votes
1answer
746 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
3k views

3D surface plots in TikZ

I need to plot a surface plot using TikZ. I have the (x,y) coordinate and the corresponding function value in a table form. I have not done 3D plots before in TikZ and hence I would appreciate any ...
6
votes
1answer
853 views

How to make a pgfplots stacked xbar plot with bar-“explicit meta” labels computed from input table data

I am making a pgfplots stacked xbar plot where each bar has a distinct label, in addition to a numeric bar length. Each pair of bars also has a common label. I would like to mark each bar with its ...
5
votes
1answer
186 views

Draw group line error

How draw group line works? I tryed to use this example, but when chaged the index it gives me an error: Undefined control sequence \end{axis} CODE: \documentclass[conference]{IEEEtran} ...
5
votes
1answer
190 views

Automatically choosing preset color schemes in pgfplots based on number of entries

This is really more of a question to satisfy personal curiosity than to solve a real problem. When choosing the colour schemes for my plots, I try to select colours that will work well with the ...
5
votes
1answer
764 views

Is there any way to remove mesh lines completely in a pgfplots faceted 3d plot?

I can not seem to find the way to remove the lines in the surface mesh in a 3d faceted plot. I need a solution that does not use the "shader=interp" (i.e. gradient filling) so that the faces are ...
4
votes
1answer
66 views

Positioning of decorations on parallel lines

I'm displayed three lines on a pgfplot. I want to show a marker for the slope of each line and the difference in height between lines. I'm showing the slopes by adding triangles under the lines ...
4
votes
1answer
157 views

How to skip ticks in pgfplots plot?

I have frequently the problem that too many data points are available for the x axis, I want to show them all in the actual plot, but I would like to show only a subset of the ticks. For instance, if ...
4
votes
1answer
334 views

How to draw density estimate on histogram by pgfplots?

I know how to draw a density histogram using pgfplots from this answer: Is it possible to "transform" a histogram into a density plot in pgfplots?. But how can I draw an estimate line on ...
4
votes
0answers
96 views

Axis labels according to DIN461 [closed]

DIN461 requires to put the unit of the axis between the last two ticks of an axis, see http://de.wikipedia.org/wiki/DIN_461 (sorry only in german, but the lower two images make it clear, I think) Is ...
4
votes
2answers
405 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? ...
4
votes
1answer
2k views

Plot and label data from file with PGFPlots

Given some data from a file, I would like to use the first two columns as coordinates, and the second two columns as label for every point. The data is given in this form: x y ...
4
votes
2answers
2k views

How to make an xbar plot, with pgfplots, having different y tick labels on the left and right side y axis?

I am making an xbar plot with pgfplots. I want this plot to show the results from a test, where people in different age classes are given scores. For each of these age classes a single person is the ...
3
votes
1answer
220 views

Settting PGFplots axis environment options by means of \newcommand and {\newlength,\setlength}

Because I often use the same options for multiple axes in my LaTeX documents, I use the following code to simplify my life. \documentclass{article} \usepackage{pgfplots} ...
2
votes
1answer
102 views

How to plot stacked bar plot inside table?

I have following code in Latex. Which plots only one data series (data2). I would like to plot staked bar plot inside table for both data1 and data2 with different colours. Any ideas.? Many thanks. ...
2
votes
4answers
588 views

Pgfplots: how to fill bounded area under a curve using addplot and fill?

I am looking shade the bounded area under the graph of f(x)=x^2 from 0 to 1. For my other plots I was fine using the shading with coordinates because they were all polygons. I've come across a bunch ...
11
votes
1answer
323 views

Place point on helix

Pasted below is a helix created with PGFPlots package and now I need to add points to a helix. What I was able to get so far is pasted below. I also included a figure depicting desired output I ...
10
votes
1answer
155 views

Adding a “passive” plot in pgfplots

I would like to add a plot to a pgfplots figure, but such that it doesn't change the automatically computed limits. for example: \documentclass{article} \usepackage{tikz,pgfplots} \begin{document} ...
9
votes
1answer
399 views

Recreate plot when data file changes

Is it possible to use the TikZ/external library and have pgfplots recreate a figure when a data file that is plotted changes? Say I have something like the following: file.tex: ...
8
votes
1answer
465 views

dashed line in pgfplots legend results in incomplete marks

When defining the pgfplots legend entries myself, I have a problem when using dashed lines in combination with marks. The mark is also dashed (or dotted, etc.), just as the accompanying line is. Is ...
8
votes
1answer
539 views

Problem: tikz, pgfplots and external coordinates using overlay

I need to draw arrows from text to a pgfplots graph using TikZ. For some reason, the arrow coordinates are not where I want them to be in the pgfplots graph. Here is an example: ...
8
votes
1answer
407 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 ...
7
votes
1answer
785 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 ...
7
votes
1answer
256 views

PGFPlots: synchronize the filling of the bars with the colorbar

How i can synchronize the filling of the bars with the color of the color bar to the right? they are a little shifted... \documentclass[border=0.5mm,12pt]{standalone} ...
7
votes
1answer
2k views

Zero space between bars in pgfplots bar graph

I want to draw a bar graph with the bars touching, like in a histogram, using pgfplots. This is basically what I'm aiming for: That plot is generated with this code: \documentclass{article} ...
7
votes
2answers
599 views

How to maintain the ratio between two axis in pgfplots

I have two axis environments both containing different plots. I do however want to maintain comparability between both, i.e. I want both plots to consume the same space on the paper for a coordinate ...
6
votes
1answer
428 views

Tikz Stacked Bar Chart with Text

I have the following stacked bar chart and want to put some text behind each bar element and some text into each of the colored areas. Do you have some ideas, how I could achieve that? The ...
6
votes
1answer
2k views

change color of pgfplot bar plot

I want to plot two bar plots next to each other. This works without a problem. However both use the first color defined in a pre or selfdefined colorseries. I tried to modify the color manually in the ...
6
votes
1answer
896 views

2D colors above 3D surface plot

I would like to draw a 2D, colored plot of a function above its surface plot. I tried copying the surface plot and setting z filter/.code={\def\pgfmathresult{1.4}}, but then everything is the same ...
6
votes
2answers
1k views

Force “axis on top” for plotmarks in pgfplots

The pgfplots manual says that axis on top=true won't affect the plot if using plotmarks as this usually doesn't make sense, which I agree with. However, in this case I'd prefer both the axis and tick ...
6
votes
1answer
908 views

import input pgfplots with relative paths

The package import makes it posible to \input (and \include) a .tex document which itself \input (or \includegraphics etc.) stuff using relative paths. I was hoping that this also would work with the ...
5
votes
2answers
250 views

pgfplots: Clipping Everything Outside a Specific Area

I want to add information to each column of a histogram. every node near coord is probably the best approach. It works well with bar plots but not with the histogram: \documentclass{article} ...
5
votes
1answer
234 views

How to move axis multiplier in a polar plot in pgfplot

How can I move the axis multiplier in a polar plot? In the following MWE, the axis multiplier is over the ticks and prevent the plot to be nice and readable. ...
5
votes
1answer
498 views

tikz/pgfplot unstacked ybar with “switched” overlay

So, i'm trying to make a nice ybar plot using pgfplot, but i have some issues i want to solve, hope you can help me. 1) the ybar are not centered on the x value as they should, i mean, the bar for x ...
5
votes
1answer
792 views

Multiple different meta for marker color and marker size

How do I set the color of a marker with one meta column in a table AND its size with another meta column? So in this minimal working example, how can I set the marker size with 'w1' and the color ...
5
votes
1answer
1k views

TikZ plot: centering and units on axis

I have the following. I'm trying to center the plot and putting \begin{center} around the TikZ image does not work. Also I'm trying to change the units of the x-axis. The x-axis is used to ...
5
votes
1answer
357 views

pgfplots: using path names created with foreach in pgfplotsextra

This is a follow-up to naming paths inside a TikZ foreach loop I want to plot a series of plots with names generated for each plot (usingname path global) in a foreach loop and place a coordinate at ...
5
votes
1answer
2k views

Date plot using pgfplots with odd tick label

How do I make the time label in the following image appear as "10:00" (i.e. 10 o'clock) rather than the unexpected and unwelcome "09:60"? Here's the code that I am using: \documentclass{beamer} ...
4
votes
1answer
112 views

pgfplots and using axis cs to add points

I am trying to mark two inflection points using a foreach loop in a pgfplot, but it isn't working. \documentclass[tikz]{standalone} \usepackage{pgfplots} \pgfplotsset{compat = 1.10} \begin{document} ...
4
votes
1answer
142 views

Plotting a function defined with \pgfmathdeclarefunction

I've got a few macros that perform floating point lookups and calculations for me and I'm interesting in plotting their results. They're the kind of calculation which requires if/else, so they can't ...
4
votes
1answer
381 views

How to automatically align subfloat captions to xlabel of PGFplots?

Subfloat captions are not usually aligned with their corresponding xlable in PGFplots. One way is to manually move the captions horizontally to align them. For example, (copied from here) ...
4
votes
1answer
209 views

PGFPlot two \pgfplotstableregressiona

Hi i have two plot with two linear regression but the legend show the same equation for the straight line... I haven't made a MWE because I thought it isn't needed---Is it? \pgfplotstableread{ X Y 97 ...
4
votes
2answers
2k views

How can I change format of number's axis on pgfplots

I want to change format of x or y number in green box of below graph .
4
votes
1answer
793 views

References in externalized pgfplots

I was writing on an document with a lot of pgfplots in it. Because of the memory limitation in LaTeX and in order to save some compiling time I tried out the externalize command. With most of the ...
4
votes
2answers
3k views

Bar plot labels and grids

\documentclass[a4paper,11pt]{report} \usepackage{tikz} \usepackage{verbatim} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ title = {Optimalization based upon co-occurences}, ...
4
votes
1answer
594 views

pgfplots: “nodes near coords” on xbar chart is off

I am trying to make an xbar chart using pgfplots, and I'd like to add the bar's value to the bar. Simply using "nodes near coords" positions the value for a ybar chart, which isn't correct here. ...