{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

15
votes
1answer
712 views

XeLaTeX and TikZ - how do I ensure my PDFs are using the CMYK color model?

The place I want to print my document at needs the PDF to be provided in CMYK. The document is mostly text, except for a few graphs and plots which are done in TikZ or pgfplots. As suggested in this ...
15
votes
1answer
16k views

How can I change the legend's location in a pgfplot?

For a report I am preparing several figures that I exported from Matlab using the matlab2tikz script. However, the location of the legend does not please me. Here is an example plot: I want to move ...
15
votes
1answer
669 views

pgfplots: problem with “non-smooth” intersection of two lines' ends

I have a problem like the one in this question concerning a tikz drawing but for a pgfplots plot. I want to create a plot that has one region filled without opacity and a neighboring one filled with ...
14
votes
4answers
2k views

Plotting the solution of inequalities with WolframAlpha or Maple

I want to plot the solution of two inequalities and include them in a LaTeX paper. I really like they way this looks: Wolfram Alpha. Unfortunately, I have no idea how to export this into a ...
14
votes
3answers
1k views

How to draw a irregular circle(shape)?

I want to draw some irregular circle(shape) in my wireless scenario. with a basestation in the center. around is some irregular circle(shape). I find something(could be used) in this web(but I feel ...
14
votes
4answers
545 views

How to plot blurred curves with PGFPlots?

I'm trying to replicate the following plot with PGFPlots: In this answer, the author plays with opacity when drawing overlapping ellipses. Is it possible to use similar code with arbitrary curves? ...
14
votes
1answer
9k views

pgfplots: Legends in multiple y-axis plot overlapping

I am trying to add a legend for two plots on two different y-axes, however they are overlapping each other and each one is being written in its own box. I would like for both of them to share a single ...
14
votes
2answers
1k views

Fill a contour-plot

I did some calculations in Mathematica that gave me a contour plot: To include the output I wanted to however draw it with pfgplot. But there I don't get it to work, first of all the y-axis doesn't ...
14
votes
1answer
1k views

How to plot circular polarized electromagnetic wave

I am searching for a solution to get nice looking circular polarized waves in my latex document. My goal is to get a graph that looks like this: I do not want the graph to be animated but I can not ...
14
votes
2answers
5k views

Change linestyle within a plot to add dashed trendline?

I'd like to add a dashed line to the end of a plot to indicate a future projection as opposed to real data. I can do this by adding a second plot, as in the example below. However this isn't really ...
14
votes
3answers
3k views

\pgfmathsetmacro - dimension too large (biggest value allowed?)

I want to import some data with parameters to parametrize some plots. After importing a table, I assign specific variables of the table to a placeholder by using \pgfplotstablegetelem. And it works ...
14
votes
2answers
8k views

Removing x and y ticks in PGFplot

I'm trying to disable the ticks from showing on this diagram: I've tried using x tick=empty as you can see, but it doesn't appear to change anything since I'm not actually plotting in the axis, only ...
14
votes
1answer
633 views

How to plot integral as summation, as pictured?

I'm new to TikZ and pgfplots but would like to know how to plot the square as well as how to plot the arrows + delta x as well as arrow + delta A: I'd be most grateful if some of you had some ...
14
votes
2answers
1k views

Use first row of a table as legend entry in pgfplot graph?

I'm using pgfplots extensively and I'd like to avoid having to write legends every time, since all the text files I want to plot have explicit headers. As a comparison, \pgfplotstabletypeset makes a ...
14
votes
2answers
666 views

Naming the nodes of `nodes near coords` for later use

I would like to use pgfplots command nodes near coords to get a list of named node ((no1), (no2), (no3) etc.) that I can use afterwards to draw some paths that I fail to construct with pgfplots only. ...
14
votes
1answer
1k views

Dos and Don'ts of \pgfplotsset{compat=newest}

Question I just upgraded to 1.9. Christian recommends against the \pgfplotsset{compat=newest}, but that leaves one having to come back and update compat=x.y in one's projects, several times, over a ...
14
votes
2answers
491 views

quiver plot on hyperboloid surface

Using pgfplots, I'm trying to create a quiver plot on a hyperboloid surface something like this. I was able to generate the hyperboloid surface using parametric equations. I could'nt find out how ...
14
votes
1answer
1k views

How do I draw a plot with a variable line width in pgfplots?

I have highly dimensional data for which I'd like to draw a plot where I vary the line-width, somewhat similar to the famous Minard chart: I suspect this can be done with some combination of point ...
14
votes
2answers
4k views

Dimension too large while plotting with pgfplots

I have the following pgfplots code: \begin{tikzpicture} \begin{axis}[domain=-8:2] \foreach \i in {-10,-9.8,...,10} {\addplot+[smooth] {-x/\i+\i};}% \end{axis} \end{tikzpicture} I need several ...
14
votes
1answer
1k views

How to scale existing coordinates data in pgfplots?

I have a plot with its data, for example \documentclass[]{article} \usepackage[]{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[] \addplot+[%multiply x data by a factor here, multiply y ...
14
votes
1answer
518 views

PGFPlots % in ticks labels

Hi i want to put this simbol "%" in the tick labels only in the x axis how can i do?
14
votes
1answer
1k views

Tikz: intersection of line and plane

I am struggling with drawing a plane and a intersecting line. I would like to have the line C,P',P in the image, disappear if it is "behind" the plane and have it reappear if it is not behind the ...
14
votes
1answer
2k views

How to use a string column with pgfplotstable to label datapoints in a pgfplot?

I have a comma-separated list of data points. They should be plotted as a scatter plot, and should be labeled using data from the .csv file. Having specified the first column of my file as string ...
14
votes
1answer
2k views

Is it possible to create overlays in beamer inside pgfplots graphics?

When working with pgf-tikz, I can create overlays in beamer presentations with \path<overlay specification> ... However, I could not get this to work in pgfplots graphics. It would be nice ...
14
votes
1answer
2k views

geographic maps with TikZ/pgfplots

I have recently discovered pgfplots and I love it. I'm converting the figures from my thesis to pgfplots, or at least the ones I have made myself. One of my figures is a map that I created using the ...
14
votes
2answers
594 views

Bar plots in sans serif font

I want to typeset my bar plots with a sans serif font (using LuaTeX). I tried many options that I found searching the manual and the internet. None of them solved my problem---using different fonts ...
13
votes
2answers
3k views

Using a pgfplots-style legend in a plain-old tikzpicture

I am using a plain-old tikzpicture to produce a pie-chart-like plot. Now, all other plots in my paper are handled using pgfplots (which doesn't do pie charts) and have their legend typeset by ...
13
votes
2answers
7k views

Positioning of Pgfplot axis labels

I'm trying to adjust the position of my axes labels and I'm having some trouble: \documentclass{article} \usepackage{float} \usepackage{pgfplots} \usepackage{graphicx} \begin{document} ...
13
votes
2answers
2k views

Stacked bar plots with several descriptive nodes

I have a stacked bar plot where I would like to display additional information for each bar—besides their cumulative values. This information should include the non-cumulative values and the ...
13
votes
2answers
506 views

Better way of embedding OpenOffice plots into LaTeX?

Right now, I create plots in the spreadsheet, copy them to OpenOffice Draw, save as images, and then put them (as images) into my .tex file. But that leads to problems with resolution (labels too ...
13
votes
1answer
9k views

pgfplots: alignment and size of math in legend

The legend entries created by a more complex math formula as in this example are overlapping and the alignment to the lines is wrong. \documentclass[]{scrbook} \usepackage{pgfplots} ...
13
votes
2answers
2k views

How to select a finite number of samples from the file when plotting using pgfplot

I have a datafile containing thousands of points of which I need to plot only the first 100 points. How to do this using pgfplots? I tried the following with no effect. \begin{axis}[
xlabel=k,
...
13
votes
2answers
5k views

ylabel postion with pgfplots

I am using pgfplots to plot some data, but I am having problem you see in the image below. Basically, the ylabel overlaps with the axis numbering. I have googled a LOT but couldn't find any solution. ...
13
votes
1answer
3k views

Custom Dashed Plot Lines in PGFPLots

I know that you can make a dashed line in pgfplots using the \addplot[dashed] option. However, the line that produces isn't dashed the way I'd like. I found \pgfsetdash in the documentation for ...
13
votes
1answer
2k views

TikZ, 3d library and circle fading

I'm using the 3d library to put a circle on the z=0 plane, and other things. I'd like to fade this circle radially, but the result isn't as I would expect because the fading is not proportional to the ...
13
votes
2answers
312 views

How to draw areas between curves of the form $x=f(y)$ and $x=g(y)$?

I want to shade the region between two curves whose equations are of the form $x=f(y)$ and $x=g(y)$, where $f(y)\leq g(y)$ for all $y\in [c,d]$. I heard that pgfplots can be used. Also, the ...
13
votes
1answer
1k views

pgfplots: dimension too large when reading data from file

Based on the following data table data.dat x a b c d 0 284.15 69.18 284.15 70.26 0.03 284.15 70.20 284.15 70.04 0.04 318.15 70.20 284.15 ...
13
votes
1answer
4k views

What is the opposite to “only marks” option in PGFPlots?

For some application I generate a bunch of plots automatically from a script, that means that sometimes I issue contradictory options to pgfplots objects because one is the default (within the ...
13
votes
2answers
775 views

tikz pgfplots ternary diagram, density map

I am plotting points in a ternary diagram using pgfplots and the ternary axis environment. Each point does posses a 4th value (besides the 3 that are the coordinates). At the moment I am stating ...
13
votes
1answer
1k views

Using pgfplots, how can I make and use a colormap that has a sharp transition in the middle?

I wish to make a colormap where the distinction between numbers smaller than 0 and numbers greater than 0 is emphasised. So I want to make a colormap that has one sharp transition in the middle and ...
13
votes
2answers
1k views

Allow underscore in PGFPlots tick labels read from table

I'm trying to use the text data from a table column as the tick labels in a plot. The text data contains underscores, which makes LaTeX throw a Missing $ inserted error. I'd usually get around this by ...
13
votes
1answer
7k views

pgfplots: Selectively reducing marker size in the legend

I have a plot created using pgfplots in which I have included a legend. However, I find that the marker sizes in the legend are the same size as the markers used in the main plot. I think this is a ...
13
votes
1answer
2k views

Defining a Piecewise Function for PGFplots

I want to define a piecewise function q(x), and attempted to adapt the solution to this question on using pgfmathdeclarefunction to create a unit pulse function, and this works fine. However, when I ...
13
votes
1answer
1k views

How to make the tick thickness as the axis line?

I am trying to make the thickness of the ticks equal to the axis line thickness. That is what I have so far: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.5} ...
13
votes
1answer
909 views

How can I draw a quiver plot with varying line thickness?

This question originates in Scalar field in pgfplots . How can I draw a quiver plot in which the arrows have the same length, but their line width varies according to some scalar property of the ...
13
votes
2answers
2k views

Big data surface plots: Call gnuplot from tikz to generate bitmap and include automatically?

Motivation I have large numerical data files, that I would like to create density (surface) plots of. Since they are very big, we can rule out a few possibilities such as to plot them directly with ...
13
votes
1answer
2k views

Plotting an implicit function using pgfplots

What is the correct way to plot an implicit function using pgfplots? Consider the following example: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} ...
13
votes
1answer
1k views

3D Arrow Tips for TikZ/pgfplots

I really like the arrow tips shown in How to get rid of the viewer's (incorrect) axes in an Asymptote 3D graphics and am wondering how to produce this in pgfplots: I admit I have not tried ...
13
votes
1answer
349 views

Polar Plots - layout and extraction of crucial parameters

Let S be some sort of function, depending on direction and frequency, for example: envir. background noise. I have S defined on a rectangular grid and I wanted it plotted on a polar grid. So far I ...
12
votes
3answers
647 views

Draw a cylindrical spiral with TikZ

I want to make a tikzpicture to illustrate the construction of a spiral capacitor. These are made of spiral coiled films. So imagine a rectangular paper that you tail around one side. Thats basically ...