{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
508 views

Problem in adjusting contour label color and numbr of samples in pgfplot

I am trying to create a contour plot using TikZ. I have two questions: How can I change the contour labels color to all black? Is it normal that gnuplot responds slow for creating smoother contour ...
2
votes
1answer
586 views

Tikzpicture in a two column way using a one column .cls template

I'm using a .cls IEEEtran from IEEE available here http://www.ieee.org/conferences_events/conferences/publishing/templates.html; and all document is in two columns. I'm ploting using pgfplots a ...
2
votes
1answer
179 views

ytick pgfplot issue

I have the following latex code but unfortunately cannot get the ytick to be of my choice. \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{center} ...
2
votes
1answer
149 views

ticks disappearing for diverging (out of range) plots

my xticks disappear for some plots even though I explicitly ask for them. Here is my MWE. The function goes to -infinity at the right border of the interval. \documentclass{article} ...
2
votes
1answer
788 views

pgfplots and log scale: bars starting from the bottom of the screeen

The following MWE \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ybar,ymode = log] \addplot coordinates{ (1,1e-15) (2,1e-14) ...
2
votes
1answer
359 views

pgfplots: fill the volume under a 3d surface

I have a very simple 3d graph. \begin{tikzpicture} \begin{axis}[view={60}{20}, %axis equal image=true, xlabel=$X(T)$, ylabel={$D(T)$}, zlabel={$V(T)$}, zmin=0 ] \addplot3[surf,shader=flat,z ...
2
votes
1answer
1k views

Minor ticks not showing when using matlab2tikz

I am using matlab2tikz to import MATLAB figures into TeX. However I can't seem to get the x or y minor ticks to show in the document compiled by TeX. The MATLAB figure I have converted to .tikz have ...
2
votes
1answer
168 views

\pgfcalendar@datetojulian error when plotting a time series using pgfplots

I am trying to plot a hyetogram (hourly precipitation vs time, or column 10 vs column 1 in my data file) with data downloaded from a WUnderground weather station. The time column seems to be properly ...
2
votes
1answer
622 views

pgfplots: how to fix axis length?

I used ymin=0 and ymax=1000 to give axis the length I want. The problem is that if I have some "crazy" data that escape (I have to plot stable solution vs. unstable solution of my algorithm), pgfplots ...
2
votes
1answer
356 views

Error when using pgfplots and beamerposter

I'm trying to create a poster presentation using beamerposter, and it refuses to compile when I insert my pgfplots plot. I get the following error message ! TeX capacity exceeded, sorry [input stack ...
2
votes
1answer
480 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
1answer
276 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
483 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} ...
2
votes
1answer
316 views

pgfplots: how to check if addplot filters all data

is there an easy way to check if a \addplot(+) table [...] command in PGFPLOTS has any drawn any points? The reason is that I want to process the data dynamically, and if the plot is empty, the legend ...
2
votes
1answer
298 views

matlab2tikz for binary matlab figures

How do you properly use matlab2tikz for binary MATLAB figures? The figures are only black and white and when trying to generate the .tex file I get the error: Input argument 'color' is not a scalar. ...
2
votes
1answer
671 views

Consistently specify function to be graphed with or without gnuplot

I would like to be able to specify a function and then graph that with with pgfplot only, or use gnuplot to compute the coordinates. As far as I know there are two main differences in how the ...
2
votes
1answer
1k views

Tikz Axis bounding box does not align with other bounding boxes. What can I do?

I want to place a lot of pictures and plots in a long document. By now, I am using figure-environment with center-environment, but the tikz-axis-plots didn't align well with included eps-pictures or ...
2
votes
1answer
2k views

Drawing Vertical Arrows in Coordinate System Using Pgfplot

I have a series of data plots, an example of which is depicted below, and I would like to draw a vertical line through a particular x-coordinate on each plot, so that the head of the arrow is is ...
2
votes
1answer
593 views

how to use \insert{_file_} to include tikz \draw command?

I'm using Stata to run some simultions, and my data change every time I run my do file. My data have a discontinuity that changes with each run and I'd like a curly brace that reflects the size of ...
2
votes
1answer
1k views

Regarding bar chart with text as x axis labels

I have seen the previous posts regarding "bar chart with text as x axis labels". I tried to use the same code discussed in the posts and in the documentation, \begin{tikzpicture} ...
2
votes
1answer
70 views

Half filled circle marker

How can I draw a half filled circle on my axis. I would like the marker to be at the origin and be filled on the left half of the circle. \documentclass[12pt,]{article} \usepackage{graphicx} ...
2
votes
1answer
93 views

Is there a reliable way to define the scale label's position in a groupplot in relation to the respective label?

I was asked to try and put the scale labels for the yticks not right above the north west corner of the plot as it is rather unusual. Personally, I tend to agree. It works easily but above left might ...
2
votes
1answer
66 views

Contour plot using pgfplots where some data entries are NaN

I would like to make a contour plot of data that has been saved in a text file that consists of three columns where the columns are x_i, y_i and z_i and some elements z_i are NaN. I use MikTex 2.9 ...
2
votes
1answer
41 views

Gap at origin when using axis lines*=left in conjunction with line width spec via axis line style

Please forgive the strange graph displayed here - I am simply trying to display a replicable chunk of code in the presence of all the packages I am attempting to use and want to avoid displaying data ...
2
votes
1answer
91 views

pgfplots - How can I use the same single coordinate from multiple data files for one plot?

I have multiple .csv files which are organized like force-stats.txt (see MWE below). I'd like to make a plot based on several single points in these data files. Is this possible? So far searches with ...
2
votes
1answer
65 views

2 rows legend and alignment

I got a legend with two rows and I would like to have a different alignment on each row. Is it possible ? In my current code, the legend entries on the second line are much longer than ones on the ...
2
votes
1answer
87 views

Add single bar to a stacked bar plot

In order to show the difference between three measurements against a single one, I need to combine a regular bar plot and with a stacked one. However, once I use a stacked bar plot, the single datum ...
2
votes
1answer
235 views

Problem with pgfplots/pgfkeys: “I do not know the key '/tikz/use units'”

Problem in short: I'm using pgfplots but I can't use units in the labels. I tried this minimal example (from http://pgfplots.sourceforge.net/gallery.html) and get an error message: ...
2
votes
1answer
248 views

Axis break in pgfplots - Large box around plot

I had the same problem as TSGM: Axis break in pgfplots I wanted to break the y-axis in a plot. I have tried the solution, which Michi had suggested on Axis break in pgfplots. It worked fine for me, ...
2
votes
1answer
80 views

How to change font family LaTeX plot?

I want to change the font family of the bar plot to Helvetica fonts. I have tried using the following code but it only changes axis fonts and not the data labels inside the plot: ...
2
votes
1answer
243 views

Peculiar tikz-external, pgfplots, tikzscale combination problem

I want to use \tikzexternalize and tikzscale with pgfplots' \addplot graphics command and \clip=false option. I am using three files: A.png, A.tikz and A.tex. A.png can be any graphics file. A.tikz ...
2
votes
1answer
246 views

Simple Line-Plot with date on x-axis

I need to do a really simple line plot and my data is looking like this: Date Value Apr2013 0.06 Mai2013 0.08 Jun2013 0.1 Jul2013 0.2 Aug2013 0.4 Sep2013 1.5 Okt2013 2.0 Nov2013 4.1 Dez2013 8.1 ...
2
votes
1answer
81 views

Loop in pgfplots doesn't work

I'm trying to do a loop in pgfplots to draw a bunch of rectangles under a curve, but it doesn't work. This is my code \begin{tikzpicture}\begin{axis}[ width=160pt,compat=1.5.1,grid ...
2
votes
2answers
147 views

How do I group curves in 2-D plots with pgfplots

In the above image, you can see that there are 4 curves. I have two techniques (black and red). I test them on two different experimental scenarios. So corresponding to each scenario, I get one red ...
2
votes
1answer
147 views

Why do these two plot commands give different results?

Why the following two MWE codes, using pgfplots with and without gnuplot give different results (a phase shift)? \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
2
votes
1answer
106 views

Special design of 3 plots with LaTeX

I wish design 3 plots (A, B and C) in the form of: ------------------------+---------------+ | | A | | ...
2
votes
1answer
90 views

Vertical labeled markers

I have a plot with four curves, and I wish to add vertical marker to pinpint the exact moment the curve drops below a certain threshold, much like this: I'd like to be able to control the width of ...
2
votes
2answers
212 views

pgfplots: markers with text above the marked points

first an image of what I would like to have I want to have a free text of the nth marker of each plot. I am symply providing no example, because I am not really sure to solve it and I am maybe ...
2
votes
1answer
147 views

Ternary plot: points outside of the triangle

although my test data points are all inside the (0,0,1),(0,1,0),(1,0,0) triangle, my ternary plot unexpectedly plots some of them outside of the triangle. \documentclass{beamer} ...
2
votes
1answer
465 views

Polar plot: label and legend rotation

I am using the polar library with pgfplots to plot a graph like this: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat = newest} \usepgfplotslibrary{polar} ...
2
votes
1answer
194 views

pgfplots: How to fix the number of yticks?

With max space between ticks= it is possible to set space between ticks, but I would like to setup the number of ticks, so all my graphs will look similar. I would be happy with 4 ticks, so if y vary ...
2
votes
1answer
230 views

How can I get the grid done correctly?

I'm trying to put the grid in my graphic, and I'm getting this problem below. The grid style must be help lines, and dashed, this I know how to do, but the problem remains in put the grid correctly. ...
2
votes
1answer
415 views

Trouble including a Matlab surf plot (pdf or png) with pgfplots

I have successfully used \addplot graphics before. Now I have a surf plot in Matlab, which I exported as png and pdf and I would like to include the image with \addplot3 graphics. I found some ...
2
votes
1answer
483 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} ...
2
votes
1answer
149 views

Error when there are plotting macros before \pgfplotsinvokeforeach

Why does \pgfplotsinvokeforeach produce ERROR: Undefined control sequence. when there are plotting macros before it inside a groupplot? \documentclass{article} \usepackage{pgfplots} ...
2
votes
1answer
450 views

Matching Rotated \hyperref in arbitrarily rotated x-label in Pgfplots

Similar to this question: How to make pgfplots vertical labels have proper hyperref erence box? Except, that I am trying to get hyperref working with angled rotated x-axis labels: Got it working, ...
2
votes
0answers
49 views

Part of specified graph is missing

I have the code to graph a rational function f(x)=(3x^{2}+5x)/(2x-3) with a vertical asymptote and a slant asymptote. The equation for the vertical asymptote is x=3/2. I decided to have two parts to ...
2
votes
0answers
18 views

Changing max/min a function will be plotted with pgfplot [duplicate]

I was hoping someone could shed some light on this issue: When I plot a function using something like \addplot+[mark=none,smooth,] (\x,{2 * \x^2 + 4 * \x + 1}); the line of the function does not ...
2
votes
1answer
44 views

Not distinct x values and different domain in one graph

I want to plot data like this \pgfplotstableread{ x y 5 10 6 12 6 12 7 11 }\dataA \pgfplotstableread{ x y 5 8 5 15 6 10 7 13 8 14 ...
2
votes
0answers
76 views

Contour plot of data, where the data is of the form x_i, y_i, f(x_i,y_i)

I would like to plot the following data in a contour plot using pgfplots: data.txt. The data is of the form x_i, y_i, f(x_i,y_i) and contains NaN values. I am able to plot this exact data in a surface ...