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

Free space in bar-chart with empty entries

I would like to plot some data set with the ybar option of pgfplot. But not all entries are nonzero. The zero entries waste space between the bars and when the plot gets crowed it is not clear anymore ...
2
votes
1answer
160 views

Strange behavior with \draw within axis environment

Consider the following snippet of code: \documentclass{standalone} \begin{document} \begin{tikzpicture} \begin{axis} \draw[-latex,cyan] (axis cs:0,0) -- (axis cs:1,1); \addplot coordinates ...
4
votes
1answer
750 views

Adjusting the distance between label and axis in pgfplots

The single label of following plot is intersected by the curve. How can I make it a little far from axis and point to axis by a dashed line? \documentclass[border=5mm]{standalone} ...
7
votes
1answer
229 views

How to change the scale between ticks

Is it possible to change the spacing between two ticks? 4000-3000 = 3000-2000 = 2000-1500 = 1500-1000 \begin{tikzpicture} \begin{groupplot}[ group style={ group name=my plots, ...
4
votes
1answer
521 views

Consistent distance between bar plot groups of different sizes

I'm trying to make a bar plot where i always have one single bar paired against multiple bars. Two problems arise -- first, the first bar is assumed to have 6 other bar buddies and gets pushed to the ...
27
votes
1answer
1k views

How to add a regression line to randomly generated points using pgfplots in Tikz?

\documentclass{article} \usepackage{tikz} \usepackage{color} \usepackage[active,pdftex,tightpage]{preview} \usepackage{pgfplots} \usepackage{pgfplotstable} \begin{document} \begin{tikzpicture} ...
24
votes
1answer
2k views

Pre-defined color cycles à la RColorBrewer?

When I have multiple line plots in pgfplots, the colors of the lines cycle through a few colors (my guess is the colors are blue, red, black and dark khaki) before repeating with different marks. See ...
4
votes
1answer
252 views

Problem importing a table containing dollar signs in pgfplots

I use pgfplot for plotting (obviously). I load a table from a file, but I have the problem that my columns can have a dollar sign in them and then LaTeX complains: ! Extra }, or forgotten $. ...
1
vote
1answer
234 views

Gap between xaxis and bars in tikzpicture

I am adding a bar chart with tikzpicture and I am getting a strange gap between the bars and the y axis. Am I doing something obviously wrong? Because my other bar charts works fine... Should I ...
4
votes
2answers
187 views

Add text around the X label

Fig 1 is generated by Matlab, and the following code is created using Matlab matlab2tikz package. The different between Fig. 1 and Fig.2 is the position of % symbol. Fig.2 is produced by the converted ...
1
vote
1answer
223 views

Legend entry with curve fits

I am plotting two data sets with curve fits added manually (by defining two functions). How can I edit my legend entry to combine the data points and lines into one icon? So instead of having four ...
1
vote
0answers
56 views

How to turn off the axis in tikz plot? [duplicate]

Anyone knows how to let the axis disappear from my plot. \begin{tikzpicture} \begin{axis}[colorbar] \addplot3 [surf,faceted color=blue, samples=15, domain=0:1,y ...
6
votes
1answer
315 views

Display problems when plotting large datasets (unwanted spikes)

I have a problem concerning pgfplots and large datasets. I have the following minimal example: \documentclass{scrartcl} \usepackage{tikz} \usepackage{pgf} \usepackage{pgfplots} ...
11
votes
1answer
805 views

Unsung Heros - PSTricks, TikZ, pgfplots,

While watching presentations (mostly made with beamer) at my university I noticed, most people here use LaTeX to create there presentations which is really nice. (not just for the health of my eyes) ...
4
votes
0answers
263 views

pgfplots: percentages and endvalues in stacked ybar

I have two questions regarding the pgfplots package. I have attached the source code I worked on. There are two features I am not able to realize: I would like to put the total value (sum of the ...
4
votes
0answers
391 views

Using `external` selective for TikZ-pictures [closed]

For the following example: \documentclass{beamer} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{calc,external} \usepackage{pgfplots} \tikzexternalize \begin{document} ...
8
votes
1answer
2k views

Change font family in pgfplots (followup)

The MWE below shows that the solution at How can I change the font family in pgfplots? does not cover all the cases. The digits in the plot itself and the subscript in math mode in the title need ...
4
votes
1answer
278 views

Increasing dateplot's resolution to seconds

These three dots should be spread out over a period of 50 seconds, but for some reason they all appear at 13:00:30. \documentclass{minimal} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} ...
6
votes
1answer
976 views

Scaling a multi-column TikZ/pgfplots groupplot to page width

I am trying to scale a pgfplots groupplot with multiple (and variable numbers of) subplots to match the \textwidth of a document. What I found is that there seems to be no direct relationship between ...
5
votes
2answers
380 views

colored dotplot with pgfplots

How can I control the color of a dotplot created with pgfplots? I tried the point meta key, but apparently I did not get it right, since it is not respected. \begin{edit} I would also like to have ...
3
votes
1answer
331 views

! Dimension too large

I keep getting the error Dimension too large when i make my \Desktops{80} and my \DTUnits{20} however if I change my \DTUnits{14} it works, can someone help me please? ...
9
votes
1answer
414 views

externalize pgfplots, and only pgfplots

I would like to externalize the plots in my document (using pgplots), but not other inline stuff, such as bonds automatically drawn by chemmacros. That is, in the following test document: ...
3
votes
1answer
580 views

Adding extra ticks inside the axis environment

I am wondering if it is possible to add extra ticks to a plot without declaring them in the options of \begin{axis}. Consider the following example, where I would like to have the coordinates of the ...
10
votes
1answer
2k views

How to Graph Floor/Ceiling Functions in LaTeX (PGFPlots)

I am trying to make a graph of some floor/ceiling functions for examplep the floor of 3x+2 like this: http://www.wolframalpha.com/input/?i=graph+of+floor%283x%2B2%29#=. However, I searched through ...
4
votes
1answer
679 views

Stretch y-axis in pgfplots

I'm using pgfplots for simple plotting 2-dimensional data from a plain datatable file. What i try is to "stretch" the y-axis by a factor (say currently i have stretched it by factor '1' which is the ...
8
votes
1answer
2k views

Background image for pgfplots chart

Following up on the answer to proper tool for charts in tex I've built this picture to simulate/replace a scanned image from a newspaper: I've tried several ways to put the background newsprint ...
18
votes
3answers
7k views

How to plot a surface from a set of data?

Disclaimer: I already read questions like 2D surface on a 3D surface plot external data in a file and 3D surface plots in TikZ but these did not solve my problem. I have this set of data: x y ...
6
votes
1answer
392 views

Reverse xaxis on polar plot

I'm tring to obtain a clockwise polar plot, keeping the zero in north direction. The plot is correctly displayed but I can't fix the xtick style. \documentclass[10pt,border=10pt]{standalone} ...
1
vote
0answers
457 views

pgfplots: Plotting one data set with label and the other without label [closed]

I am trying to generate a plot using two data series and have the labels just on one of the series, but not the other. In the following example I would like to see the labels on first \addplot, but ...
4
votes
1answer
364 views

pgfplots: using macro for tick label

I would like to use a macro to define the label of an extra tick in a pgfplots picture. When the macro uses a greek character it generates an error: ! Missing \endcsname inserted. Here is my MWE: ...
4
votes
1answer
475 views

Missing mark at legend for tikz bar chart

I have the following code: \begin{tikzpicture} \pgfplotstableread{ % Read the data into a table macro Label First Second Third test 30 30 40 }\datatable \begin{axis}[ xbar ...
2
votes
1answer
292 views

pgfplots “dimension too large” with 3D graphic from external source

I want to include a 3D plot that I created in R. The plot is prepared according to the example given for Matlab in the pgfplots manual. I cropped the whitespace around the saved png, added ...
9
votes
1answer
792 views

Group together two and two bars in pgfplots

I have a bar plot and i would like to emphasize that two and two pairs belong together. So i need some padding between Cornell Box and Conference Room, and Conference Room and Sponza. Also maybe a ...
2
votes
1answer
473 views

Externalize pgfplotstable with csv file

This is a direct follow-up question to this: Adding units to pgfplotstable header After fixing the output I tried outsourcing the table. After figuring out that standalone does not work with ...
16
votes
2answers
1k views

Create x and y label which overlaps for multiple plots

I have a groupplot of 5x3. Now I want to be able to 'overlap', so to speak, the ylabel over all the plots vica versa for the xlabel. This enables me namely to make the groupplot smaller. Currently I ...
11
votes
1answer
395 views

Presumed error of pgfplots in the “cutting” of a surface

I'm struggling with a 3D representation through the use of the package pgfplots. I'm faced with an alleged error in pgfplots (from my point of view). Consider the txt file (which is attached here) and ...
5
votes
1answer
389 views

Draw box around plot or fill plot area in tikz/pgfplots

I want to create a plot in tikz/pgfplots with a number of \addplot table commands. Each of the tables is the result of a simulation. I need to add a box around each simulation's result or fill the ...
2
votes
1answer
1k views

Create 2x2 groupplot with +1 plot to the side?

I want to create a 2x2 + 1 plot like... ---------------------------| | Plot 1 | Plot 2 | | ------------------- Plot 5 | | Plot 3 | Plot 4 | | ---------------------------| How can I ...
4
votes
1answer
609 views

Expanding tick marks and labels beyond data set

I am looking to expand the y- and x-axis values beyond the data for visual reasons. I tried to force the ticks and labels, but it did not work. I wish the two axis to start at zero and end beyond the ...
5
votes
1answer
622 views

Undefined control sequence on \frac?

I'd like to generate PDF's for some ad hoc screenshots, but I'm getting an undefined control error. I tried \usepackage{amsmath} after the line \usepackage{pgfplots} but that didn't work. I thought ...
3
votes
1answer
112 views

Hiding Decimal Results from PGF Output

I have this \foreach statement which results in even numbers with decimals. I would like to omit or hide the decimal from the results. How can this be done simply? I have seen a few answers to much ...
7
votes
1answer
709 views

Read boxplot prepared values from a table

Update: Is there any possibility of drawing two box plots this way using a single datatable as in the updated MWE below? I'm trying to use pgfplots 1.8's shiny new boxplot feature. As I am also ...
7
votes
2answers
4k views

Linear regression - trend line with pgfplots

I am trying to display a trend line with pgfplots. I followed the instruction in the manual and looked around. I though I had implemented it correctly, but there is no regression line, and although ...
5
votes
1answer
268 views

using symmetry of axis / point in pgfplot?

Is there a way to use symmetry of axis or a point in pgfplot? So that you have only to define half numbers of the coordinates or only one quarter? e.g. for doing things like this: with less ...
5
votes
2answers
737 views

pgfplots - draw boxplot without outliers

I am creating a boxplot with pgfplots, using the builtin statistics library. I load the input data from a table file. \usepackage{pgfplots} \usepgfplotslibrary{statistics} ... \begin{tikzpicture} ...
9
votes
3answers
1k views

draw Fourier Series Expansion with tikz/pgfplots

This is a MATLAB code T=0.3; A=0.3; t=0:0.01:4*T; n1=length(t); N=100; s=0; signal=0; for i=1:n1 s=0; for n=1:N s=s+A*4/(pi*(2*n-1))*sin(2*pi*(2*n-1)/T*t(i)); end signal(i)=s; end plot(t,signal); ...
9
votes
1answer
524 views

Generic point labels in pgfplots

I have loads of pgfplots which have one thing in common, they all containt one or two addplot with four points that I want to label with the same labels, namely: \tau_c= n \theta. Lets for simplicity ...
4
votes
0answers
623 views

PGFPlots pattern bug [closed]

I tried to compile the example in How to combine fill and pattern in a pgfplot bar plot? to answer the question here PGFplots ybar patterns not showing and the pattern doesn't appear when I use ...
4
votes
1answer
331 views

PGFplots calculations at coordinates and rescale the axis

I need to redraw some plots using PGFplots. For those plots I only have the eps file. With Inkscape I could generate a tex code and grab the points listed in the MWE. However, in the plot, the x-axis ...
8
votes
1answer
357 views

proper tool for charts in tex

I have scanned data graphics in a large ms written in TeX (of course). For copyright reasons I need to redraw these. My publisher may (sadly) decide not to use my source directly, so will need access ...