{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
69 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 ...
1
vote
1answer
30 views

pgfplot: how to render 3dplot with colors black, white and gray

I my previous question, I rendered a 3d plot, but as I want to print my plots they should be in black, white or gray coloring format. How should I change the coloring scheme? ...
3
votes
2answers
64 views

pgfplot: 3d function plot

After my previous question, I want to plot a 3d surface; as a simple function I tried to render the bellow plot but I was not successful. \documentclass{standalone} \usepackage{blindtext} ...
2
votes
0answers
85 views

Solid of revolution about arbitrary axis

I'd like to rotate the region between y=cos(x) and y=x^2 - 0.25*pi^2 about the line x=pi. How to do this? So far I have only managed to rotate around the x-axis: \documentclass[letterpaper]{article} ...
1
vote
0answers
27 views

pgftables: nodes near coords align depending on value?

The following code results in node labels overlapping the graph. How can I align them depending on the graph so that '1375' und '1574' are below the node and the others still above? ...
1
vote
2answers
71 views

pgfplots - How can I define one cycle list for all graphs (or the least amount possible)?

Due to all the maintenance after changing a color in a list, I tried to define just one cycle list so I do not have to update all my lists anymore. It is all in all an annoyingly huge amount of time, ...
2
votes
0answers
39 views

Insert pgf with referenced png file from a different folder

I'm trying to insert a pgf file that I made with matplotlib. This file references to a png file (since I inserted a png figure in the plot). When I put the png in the same folder than my tex file, ...
4
votes
3answers
146 views

Pgfplots - How to deal with special characters in data files?

I have a file which contains column headings such as AAA-BBB or something to the effect of CC_DD_8734-20°. How should I deal with this if I just want to use such a file? Or should I prepare each set ...
4
votes
2answers
63 views

Using set list with pgfplotstable

I am trying to create a new column in a table using the set list option, but it will not expand the list when stored in a macro. I've tried \expandafter in various locations with no joy so far. ...
3
votes
1answer
59 views

Data manipulation in contour maps (x/y-axis and contour label)

I am using contour maps in pgfplots as part of CAD as well as documentation. Serving both purposes I would like to improve the readability of my contour maps, by multiplying x- or y-axis times a ...
4
votes
1answer
783 views

Linebreak in ticks-labels

I'm using \symbolic y coords in a xbar-plot. Some of these coords are very long. There is a solution using nodes which is very ... hardcoded. And it would be nice to have it automated. How do I ...
5
votes
1answer
46 views

pgfplots - How can I use 'nodes near coords' with multiple data values for one tick?

When using displaying multiple values for a tick and then activating the display of the values/coordinates, things get messy. This is why I want to display the values inside of the bar. Or on the ...
12
votes
1answer
2k views

Stacked barplots/groupplots with text labels in x-coordinate

I was trying to stack a groupplot, or was it grouping a stacked plot? However I was trying to get something like: The ybar stacked option works quite nice here. But when I try to adapt it to a ...
4
votes
1answer
74 views

pgfplots - How can I define the bar width for a xbar plot?

I found the key bar width on page 82 in the manual. However, when I use it: ! Package pgfkeys Error: I do not know the key '/pgfplots/bar width', to which you passed '5pt', and I am going to ...
6
votes
1answer
73 views

plot legend : increase its area

So my question in general is what is the method to change the precise area of the rectangle used in pgf plots? Yes, to make it larger ... MWE: a typical bar chart ...
11
votes
2answers
226 views

Derivative of a tikz path?

I would like to draw curves that are smooth and have linear segments. These curves are to be used in the graph of one-dimensional functions, x(t). [To be used as position vs time graphs in writing ...
5
votes
1answer
53 views

Scatterplot with marginal histograms using pgfplots

I've tried to use pgfplots to create a scatterplot with marginal histograms like it can be seen here: ...
4
votes
1answer
33 views

style odd and even nodes near coords differently

I'm using this style definition in the preamble: \pgfplotsset{ base/.style={ ymin=0, xtick=data, nodes near coords, } } \pgfplotsset{ random/.style={ ybar=3pt, bar ...
7
votes
1answer
2k views

Multiple y axes in groupplot

I want to create a barplot with three groups. Compared are two criteria. To make it more comprehensive here the plot I already generated I approached this problem by using the example from Stacked ...
4
votes
1answer
61 views

How to make logarithmic axis “readable”?

How can I make a logarithmic axis more readable? I have many plots that look similar to this one: The problem is in the y axis. Anyone can imagine what 10^5 represents, or 10^6. It is not so easy ...
8
votes
3answers
2k views

Surface plot with coordinates in pgf

Is it possible to draw a three dimensional surface using coordinates instead of formulas? MWE so far: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
1
vote
1answer
654 views

Default distance between axis numbers and axis labels pgfplots

What is the default distance between the axis numbers and axis labels in the plots made with pgfplots?
4
votes
1answer
1k views

pgfplots, custom legend and tikz library external

I try to create Tikz figure with several pgfplots subplots. I want to have one legend for them since they all have the same curves. I found out from this question that i can label and than reference ...
1
vote
0answers
21 views

Problem with documentclass memoir + pgfplots from data file

I'm using the documentclass memoir and I want to make a plot from a file.dat of two rows, nothing special. But I keep getting that pgfplots could not open the file. The point is that if I make a new ...
3
votes
1answer
69 views

pgfplots: “group” legend entries?

Actually, I'm working on a study where I've to plot a lot of temperature data etc. Therefore, I use "pgfplots". Everything works pretty well, so that I get the result as shown in the attached picture ...
16
votes
1answer
5k views

Colors and legend in groupplots/barplot

In order to compare three items I use the groupplot command. For each item I have n different criteria to compare. Is it possible to set the color for each criteria itself? Meaning the first bar in ...
0
votes
0answers
22 views

Using tikzscale along with correct references in externalized tikzpictures

It is not advised to use tikzscale package along with mode=list and make based on Patrick's comment here: http://tex.stackexchange.com/a/89595/24167 However, the references (e.g. \cite) does ...
0
votes
1answer
60 views

Combination Function with Factorial - Not correct result - Pgfplots

\begin{tikzpicture} \begin{axis}[ axis lines = left, xlabel = $Number of Elements$, ylabel = {$Combinations=\frac{(n)!}{(n-r)!(r!)}$}, ] %Axis \addplot [ domain=2:10, samples=100, color=red, ] ...
0
votes
0answers
34 views

pgfplots update Texlive2014

I am currently using Texlive' 2014 on Ubuntu 12.04LTS machine. The problem I am facing is updating different packages (eg. Pgfplot). I have tried changing repositories, and this does not seem to ...
1
vote
1answer
53 views

PGFPlots - trying to combine legends

I have an interesting problem. I am trying to create two graphs using the groupplots environment, side-by-side, that show different sets of data elements with different legend entries and different ...
7
votes
1answer
118 views

How to change the annotation of a clickable bar plot

Reading the manual always helps, but in this case it hasn't been very fruitful. I have created the following stacked bar plot. The bars are clickable (only in acrobat pdf). I would like to be able to ...
0
votes
1answer
57 views

Add a horizontal line to a PGFPlot and add it to the legend

I have a PGF Plot with some computational results from a CSV file. At the time the CSV file was generated, there was a value that was not known. That value needs to be on the plot also, however. What ...
16
votes
1answer
169 views

Rotation transformation of a parametrized plot

I'm working on this plot with pgfplots: The image is from our sister-site Mathematica.SE and there's also a nice explanation how to do it with Mathematica. I follow these steps: Parametrize the ...
1
vote
1answer
35 views

Two dimensional error bars in pgfpot

How can one plot a graph with specified error bars on both coordinates x and y in pgfplots? I have been trying to use the following: \addplot[scatter,only marks, scatter src=explicit symbolic, ...
8
votes
2answers
113 views

Arrow tip center with TikZ (and pgfplots)

The arrow default behaviour is shown on the left picture part. How can I achieve that the “circle” arrow tips (see the picture below) end at their center, as drawn in the right image, but without ...
4
votes
2answers
74 views

How can I add zero lines to a groupplot?

I'd like to add zero lines to a groupplot by defining them once in the groupplot environment. I of course based this on the clues and replies I found on here & in the manual, but so far I ...
5
votes
2answers
84 views

Make pgfplot load data automatically

I have a (hopefully) nice pgfplot (If you have any optimization suggestions towards the layout, don't hesitate to tell me :) ), which I will be using repeatedly. Therefore I would like to create a new ...
1
vote
1answer
66 views

PGFplots - single legend in a group plot [duplicate]

I have a group plot and when I try to add a legend it repeats on all subgraphs. I want a single common legend line at the top of the whole graph. \documentclass{standalone} \usepackage{graphicx} ...
1
vote
1answer
53 views

PGFplots multiple ylabels

I want to have multiple y labels in a group plot. Now I have 4 different values for ylabels:Range1, Range2, Range3 and Range4. I want to add a common ylabel say "throughput". How do I do that? ...
2
votes
1answer
63 views

PGFPlots x-axis problem

I've been stumped on how to get the y-axis to turn off, but to have the x-axis have a set domain. Every time I run the two code samples, the x-axis domain is always 0->1. The goal is to set the x-axis ...
13
votes
2answers
225 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 ...
7
votes
1answer
51 views

PGFplots xaxis to use exact values and not scale

I have a graph with values in xaxis as powers of 2. PGFplots automatically changes the x labels. I want it to use the exact values. What option should I use? \documentclass{article} ...
7
votes
3answers
729 views

Weird result plotting sin(x) using tikz/pgf [duplicate]

Trying to plot the sin(x) function, I get this result: The MWE is here: \documentclass{standalone} \usepackage{ pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} ...
1
vote
1answer
46 views

Loop through table for boxplot prepared

I am trying to produce figure with 2 boxplot prepared plots from an inline data file. I grabbed this code from here to use as a starting point. Given that the wrapper code allows the boxplot data to ...
1
vote
1answer
101 views

PGF stacked bar graph not drawn correctly

I am having problem with the following code which is supposed to produce a simple stacked graph. \documentclass[tikz,border=2pt]{standalone} \usepackage{pgfplots} \usepackage{tikz} \begin{document} ...
1
vote
0answers
67 views

Flip x and y axis of ternary graph

I am trying to reproduce the USDA Soil Triangle. To do so, I would need to flip the x and y axis of the default pgfplots-ternary. I understand, that I could switch my inputs (don't really want to do ...
3
votes
0answers
102 views

Create violine plots

I use pgfplots for most of my plots. Now I need to add a violin plot. Is this possible with pgfplots or any other package?
2
votes
1answer
47 views

Pgfplots, Units and “Modify Number Data Scale”

I've got a question with tikzpicture in LaTeX. Data of Tikzpicture are in a external file. The y-axis scale is like: 100,000 - 150,000... (thousands). I need to put the scale of this axis like 100 - ...
3
votes
2answers
50 views

pgfplots - How to enlarge a plot when the nodes' coordinates are on/over the edge?

I am creating a groupplot (at least intend to) with a width 4cm for each plot. As I'd like to have the values shown via nodes near coords, this proves problematic because I can't figure out how to ...
1
vote
2answers
72 views

pgfplots - How to draw zero line for y (from xmin to xmax) when one uses symbolic x coords?

Based on the code provided by Jake: \draw[very thin] (axis cs:\pgfkeysvalueof{/pgfplots/xmin},0) -- (axis cs:\pgfkeysvalueof{/pgfplots/xmax},0); I am drawing a zero line for y-values for bar plots. ...