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

pgfplots and backgrounds library

When I use framed option from backgrounds tikz library for axis environment, this example works ok: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{pgfplots} ...
2
votes
2answers
863 views

pgfplots: setlength inside foreach

I have the following code, where the size of the cube marks is set to \x inside a foreach loop: \begin{tikzpicture} \begin{axis}[axis lines=none] \newlength{\mylen} \foreach \x in {1,2,...,10} ...
2
votes
2answers
54 views

Compilation problem with pgfplots

The following code does not produce the figure expected. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \usepackage{amssymb,amsmath} ...
2
votes
1answer
69 views

How to draw a graph from CSV with TeX?

I am a complete beginner with TeX, I would like to draw JMH benchmark graph using TeX. Since I have output results in CSV format. This is my actual code: \documentclass{article} \usepackage{pgfplots} ...
2
votes
1answer
38 views

Why am I getting those pgfkeys errors?

Suddenly, most of the figures don't appear in the document and the first error is ! package pgfkeys error: choice '1.8' unknown in key '/pgfplots/compat/anchors' Another error: ! package pgfkeys ...
2
votes
1answer
50 views

get caption/subcaption every plot using groupplot pgf tikz

Hello I want to have Under each plot (subgroup plot) its caption or label, so I can also reference it in my document. Here in my example I used (a), (b), (c) I can keep them but they are not well ...
2
votes
1answer
83 views

How to add subtitles to a group of plots?

I have the following group of plots: \documentclass{article} \usepackage{fullpage} \usepackage{pgfplots} \usepgfplotslibrary{groupplots} \pgfplotsset{compat=1.12} \begin{document} ...
2
votes
1answer
63 views

How to avoid that stacked bars overlaps error bars?

I have a stacked bar chart with error bars that sometimes dips below the top part, which hides the remaining part of the error bar. (see both blue and red for x=5 and the red for all others). I want ...
2
votes
1answer
55 views

Problems plotting histograms as a line graph?

I would like to plot some percentages as a line graph, so I tried this: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=2.12} \begin{document} \begin{tikzpicture} ...
2
votes
2answers
58 views

How to make a legend entry image consist of line, pattern and markers in pgfplots

I'm trying to make the legend entry image look like a chunk from the "whole" of the following plot (so it has a line, pattern lines and marker). Is it really possible? I'm after an unsuccessful ...
2
votes
1answer
150 views

Trouble updating pgfplots on Windows/MikTeX

I'm trying to update to a newer version of pgfplots, preferably v1.12. I'm currently using v1.7. First, I opened Update (admin mode) with MikTeX and it didn't have any updates for pgfplots. Then I ...
2
votes
1answer
110 views

A very simple positionning problem using pgfplots standalone geometry and tikz package

I try to find information in the big list of pgfplots question on tex, without success, so this is "one more question" from a beginner about pgfplots, standalone, geometry, tikz combo package. I need ...
2
votes
1answer
113 views

plot with tikz/pgf from external txt file with one X axis and several Y axis

I am a very beginner of Tikz/pgf. I have searched quite long but didn't found the answer. How could I plot from an external txt or dat file that with one X value and several Y values? For example, the ...
2
votes
1answer
133 views

Reason for multiple bars in Legend entries

I am have a similar Grouped Bar Chart as shown in this question and wish to know why there are multiple bars in the legend entry. Is it possible to modify the legend so as to consolidate these bars? ...
2
votes
1answer
125 views

pgfplots significant figures

I'm trying to work out how to change the number of sig figs in the axis labels. I.e., I want the graph to display 0.0, 1.0, etc. Any ideas? \documentclass{memoir} \usepackage{pgfplots} ...
2
votes
1answer
160 views

Legend and caption label of graph

I add 4 legend to my graph and different types of mark. Also, I want the legends to be under the X axis and in one line to each other. Position of legend Also How I can to write caption of this graph: ...
2
votes
1answer
85 views

How to center a pgfplot? [duplicate]

I am trying to center a graph made with pgfplots with \centering. If I put \centering within a group to limit its scope, the graph does not get centered. If I don't limit the scope of \centering, then ...
2
votes
1answer
92 views

pgfplots very small Y values

I need to plot the following function: ...
2
votes
1answer
300 views

How to adjust the legend line length in pgfplots

I have a plot using pgfplots but I need to adjust the length of each legend. I can modify the width of each legend line, but I don't know how to modify the length of them. Is there any option to ...
2
votes
1answer
48 views

TikZ with multi colum datas

I have a data file containing 3 columns, X, Y and Z. X Y Z # datas from the natural movement of a robot 0.0000000e+00 3.3891017e-01 -1.3249598e-01 ...
2
votes
1answer
183 views

Shaded area in graph behind axes and plot, plot in front of axes

I want part of the graph shaded. The problem is of course that shade is above axis and grid, like in MWE below. Of course, I also tried axis on top option, but the problem is that in this case plot ...
2
votes
1answer
169 views

Scatter plot with a grid and axis lines going through the origin

I want to make a scatter plot with error bars (using pgfplots or tikz) with two characteristics; I need the two axes to meet at (0,0), and a grid in the background. I tried to google this a number of ...
2
votes
1answer
307 views

Is it possible to assign to two extra x-tick labels different colors?

I think the question says it all. I'd like to have two extra x tick labels with different colors. I thought of using a cycle command, but I couldn't figure out how it should work. I changed the color ...
2
votes
1answer
536 views

x tick label style issue, anchor=east and text width command not working together

I have a figure where one of my labels is very long. I would like this label to be split to two rows. Currently my code is like this \documentclass{article} \usepackage{pgfplots} ...
2
votes
2answers
268 views

Aligning ticklabels in secondary y-axis in pgfplot

I want to right align the ticklabels in secondary y-axiz in pgfplot. Here is my output and MWE. Thanks in advance for your help. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat ...
2
votes
1answer
462 views

How to reuse data from one addplot table for plotting in another axis?

Is there anyway to reuse the data of a \addplot table for plotting in another axis environment? I would like to avoid putting the data into a separate file. Is there any way to refer to the data in a ...
2
votes
2answers
964 views

y minor ticks not showing with pgfplots

I want some minor ticks on the y axis, but it doesn't work. I already tried minor y ticks num but it didn't help. Thank you in advance. \documentclass[11pt,a4paper,oneside ]{article} ...
2
votes
1answer
162 views

How can I set the width of a pgfplot to fit that of a tikz matrix?

I'd like to be able to control the width of a pgfplots plot to that of a matrix. The plot should be below the matrix. Ideally the plot's dimension will depend only on the size of the matrix (so if the ...
2
votes
1answer
261 views

How can several boxplots be combined into a single figure as groups?

Currently I have the following MWE: \documentclass[a4paper]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{external,colormaps,groupplots,statistics} \pgfplotsset{compat=1.8} \usepackage{tikz} ...
2
votes
1answer
450 views

Pgfplots 1.10 boxplot style options

I have been trying to add boxplots to my barcharts and I've finally got some where. After many hours of tearing through these forums and their examples and exhausting the PGFPLOTS 1.10 Manual I got ...
2
votes
1answer
95 views

Marking axis in pgfplot

Welcome, I have this \documentclass[11pt,a4paper]{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \newcommand\two[2]{#2*exp(#1)} \begin{document} \begin{tikzpicture} \begin{axis}[ ...
2
votes
1answer
142 views

pgfplots: how to add a label to a graph with the option clip=true?

Question I would like to add a label to my graph, on the right of it or at any other place, for instance somewhere above my graph. Is it possible? I want to use the option clip=true, because of the ...
2
votes
1answer
81 views

ylabel covered in graph with pgfplots

I have the following code: \documentclass[12pt,a4paper]{article} \newcounter{conto} \setcounter{conto}{\time} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} ...
2
votes
1answer
172 views

Using \foreach to manage ticks in axis, Tikz

I want to add minor distance between y ticks. The default distance is 0.5, I need to set for 0.2. It seems easy to set different space for ticks according to pgfplots, in 4.15, page 271. I add the ...
2
votes
1answer
109 views

Exclude certain plot points from smoothing

How do I exclude certain coordinates from being smoothed by the "smooth" option in a PGF plot? How do I avoid that \closedcycle jumps to zero? Here is my example: \documentclass{minimal} ...
2
votes
1answer
107 views

PGFPlots: Plot regression line and 45 line for a range of values

I have a regression that has the following simple format: ln(Y) = C + lf(X). It's estimated as ln(Y) = 0.62 + 0.81. I want to plot it for a range of values for X (0 to 50) and compare it with a 45 ...
2
votes
2answers
494 views

pgfplots surf plot: don't draw 'NaN'

I generated a checkerboard style suface plot using matlab2tikz. The data contains nan (not a number) values. I want the squares of nan values to be white (as in matlab). When I compile, I get the ...
2
votes
2answers
500 views

How to change the x axis position pgfplots

I have trouble to shift the y axis. Is there any command to shift the y axis in the right direction (the first point where graph started) and start the graph exactly from the first point. Thanks.
2
votes
1answer
229 views

How to exclude negative values from plot of PGFPlots package?

I'm plotting bar plot using this code: \documentclass[tikz,12pt]{standalone} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english]{babel} ...
2
votes
1answer
513 views

Place vertically centered legend to the right of groupplots

I want to place the legend to the right of groupplots using the pgfplots package, and for the legend to be vertically aligned at the center. In other words, I want the legend to be placed at the point ...
2
votes
2answers
289 views

Linewrap in legend in pgfplots [Solved]

I try make plot with long text in legend. \documentclass{report} \usepackage{pgfplots} \pgfplotsset{ every axis legend/.append style={at={(0.5,-0.13)},anchor=north,legend cell align=left}, tick label ...
2
votes
1answer
128 views

How enlarge the two parts of data

below shows the graph and code. the red circle show two portion of data. since the upper red circle has data values >1500, therefore the lower red circle(0-500) shows all lines cramped together..is it ...
2
votes
1answer
730 views

Pgfplots: Horizontal colorbar on top

I found on pgfplots manual ho to have an horizontal colorbar (simply specifying the colorbar horizontal option) but how can I put it above the axis? By default pgfplots puts it below the axis.. Here ...
2
votes
1answer
110 views

How to remove all of ticks keeping the extra ticks

I want something like \begin{axis}[ y ticks=\empty, extra y ticks={-1,1}, extra y tick style={yticklabels={{name1},{name2}} ] ... \end{axis}
2
votes
2answers
895 views

pgfplots: How to place the legend box in the middle of an axis

I would like to have something like legend pos= west, %insted of north west, south east... because I don't wanna place it in the corner but vertically in the middle. How could I do this?
2
votes
1answer
355 views

PGFPlots: How does one plot a wave packet?

Given the equation 2\cos(kx - wt)\cos(.5\Delta k(x - \frac{\Delta w}{\Delta k}t)). How can I plot this in pgfplots? k is the wave number w is the frequency \Delta k and \Delta w are both \ll 1 We ...
2
votes
1answer
101 views

Footnote label in pgfplot

I can't find an answer to this problem. My problem is similar to this Footnote on graph title but I would like to have a footnote netxt to one of my x axis labels. Like this symbolic x ...
2
votes
1answer
279 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 ...
2
votes
1answer
367 views

tikzpicture and pdf - x axis partially disappears

I would like to know why the x axis partially disappears, given the following code. Is it a PDF problem? Also, is there any option to connect the midpoints automatically but not in a smooth fashion? ...
2
votes
1answer
427 views

Intersecting planes not shown correctly with TikZ

I made a plot in MATLAB of a deformed and an undeformed model. I converted the figure to TikZ using matlab2tikz and added it to my .tex file. I then noticed that the two configurations, which are ...