{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
2answers
254 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
408 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
838 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
149 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
231 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
3answers
184 views

Wrong placement (and/or size) of picture / plot with groupplot of table (… and discontinuity)?

Consider this MWE: \documentclass{article} % \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.5.1} \usetikzlibrary{pgfplots.groupplots} \usepackage{pgfplotstable} ...
2
votes
1answer
408 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
91 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
131 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
79 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
153 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
106 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
101 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
467 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
437 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
221 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
2answers
264 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
127 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
637 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
109 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
792 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
342 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
95 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
270 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
357 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
424 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 ...
2
votes
1answer
370 views

PGFPlots slow down compilation when plotting from external files

I am writing a report containing multiple plots of spectroscopic data by way of PGFplots which is fetching data from external files. It used to do the work, and after a few minutes of compilation it ...
2
votes
1answer
2k views

gnuplot and TexnicCenter setup

I just downloaded and ran the gnuplot setup exe. Now, how do I setup TeXnicCenter and gnuplot so I can use gnuplot with TikZ? So I have been able to add --enable-write18 but the inverted cycloid ...
2
votes
1answer
250 views

Create standalone pictures

I am trying to write a sample code to be used as a template to generate pictures that will be latter included in a paper. At this stage, the pictures are only plots. I have the following code. But it ...
2
votes
1answer
334 views

Labels in xtick with pgfplots

I am using Pgfplots to make a very simple graph. I already have the code below \documentclass{article} \usepackage{tikz,pgfplots} \pagestyle{empty} \begin{document} \begin{tikzpicture}[>=latex] ...
2
votes
2answers
305 views

Ideas for drawing this plot?

I need idea for drawing the following graph. I, obviously, do not expect full code. I hope I can get an idea about the best way to plot this graph. Should I try to draw each rectangle separately? Is ...
2
votes
1answer
2k views

matlab2tikz for surf plots: reducing data?

I was really happy to see that matlab2tikz also supports surf plots. Unfortunately, it produces too much data, so I run into the well-known memory problem. I tried compiling with lualatex instead of ...
2
votes
1answer
1k views

Adjusting features of a pgf plot

I have the pgf plots below, where it doesn't appear well. I wish to put closer the "Solving Time(ms)" and y axis, put the font size smaller how should i do it? There is also a problem for ...
2
votes
1answer
279 views

Graphing linear probability model using pgfplots

So, I am attempting to use pgflots to draw a sketch of a one-independent variable linear probability model in the form of the equation I have below, which shows the implied relationship between E(Yj) ...
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 ...
2
votes
1answer
528 views

Create a ybar interval from given bar widths

I am collecting data using the NASA Task Load Index, which gives 6 scales and has a weight associated with each scale. I am trying to plot the mean value for each scale using a ybar interval graph, ...
2
votes
2answers
1k views

Using node shapes or self made tikzpicture as image in legend

I am using the solutions of Using a pgfplots-style legend in a plain-old tikzpicture and Legend in tikzpicture to create a legend in a tikzpicture. In this legend I need a cylinder as image. I ...
2
votes
1answer
456 views

Pgfplots two datatable in the same document

\documentclass[a4paper,12pt]{article} \usepackage{pgfplots,pgfplotstable} % Grafici \pgfplotsset{/pgf/number format/use comma,compat=newest} ...
2
votes
1answer
666 views

conditional inside a pgfplotsinvokeforeach loop

I'm using \pgfplotsinvokeforeach to do mathematical computations inside the \addplot options. Now I need a conditional to decide whether to plot a line or not depending on the current index of the ...
2
votes
1answer
2k views

pgfplots: I do not know the key '/tikz/nodes near coords' error [closed]

I'm trying to create a simple plot using pgfplots. I have a problem though that drives me crazy. I'm working on a debian installation and had installed the tex-live version from the repositories. The ...
2
votes
1answer
794 views

Plotting area in the plane where two inequalities in two variables hold

I would like to plot the area in the plane where two inequalities hold, both involving two variables. I would like to do it the way Wolfram Alpha does it, but within a LaTeX document. I have looked ...
2
votes
1answer
310 views

Wrong area plot

I'm trying to draw a plot from this table: ip Min Std 0 19.86764349 97.20356138 16 19.86764349 250.079659 22 19.86764349 168.2253117 23 19.86764349 169.2514577 33 ...
2
votes
1answer
439 views

Styled or fixed color line-segments in PGF

When I want to plot coordinate data, I know that I can color individual scatter points using defined colors using point meta=explicit. The line segments between two points seem to be colored by an ...
2
votes
1answer
376 views

pgfplots and final size of the externalized pdf image

I have the following piece of code: % command: pdflatex --jobname=try-f1 try.tex \documentclass[12pt]{book} \usepackage{tikz,pgfplots} \pgfplotsset{compat=newest} \pgfrealjobname{try} ...
2
votes
1answer
1k views

How to correct for a xshift in the pgfplot legend?

Using the following example code: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel=$x$, ...
2
votes
1answer
2k views

Bar plot legend not displaying correctly

In the legend for a bar plot that I'm building, I'm only getting a small tick next to the name, not a block of color. I'm not defining any special cycle lists. The code for the plot is: ...
2
votes
1answer
31 views

Duplicate values when writing value near coordinate

I am using this code, taken from my question here. The problem arises when two x values have the same y value. Then the label I want to write near the coordinate overlaps with the other one. How can I ...
2
votes
1answer
43 views

Default tikz arrow style in pgfplots

I'm trying to change the axis arrow style used in pgfplotsto the default one obtained in tikzusing ->, i. e. I've done some research but can't seem to find a way to do that.
2
votes
1answer
27 views

Formatting axis as currency

This may well have been answered somewhere, but I can't find it. It seems very simple, but is eluding me. I have a chart built with pgfplots. \documentclass{article} \usepackage{pgfplots} ...
2
votes
1answer
42 views

pgfplots: How can I write square brackets in xlabel or ylabel?

The following works fine: \begin{tikzpicture} \begin{axis}[xlabel=$k$, ylabel=$x(k)$] \addplot coordinates {(0,1) (1,4) (2,2) (3,-1) (4,2)}; \end{axis} \end{tikzpicture} But as soon as I ...