{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

1
vote
0answers
12 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, ...
2
votes
0answers
43 views

How do I get a straight line in \begin{tikzpicture}[decoration=Koch snowflake]?

The following code \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{decorations.fractals} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[scale=3,decoration=Koch snowflake] ...
1
vote
1answer
54 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
47 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} ...
5
votes
1answer
43 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 ...
4
votes
1answer
70 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
72 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
174 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 ...
4
votes
1answer
31 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 ...
4
votes
1answer
60 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 ...
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 ...
5
votes
1answer
46 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: ...
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
30 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 ...
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 ...
1
vote
1answer
34 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, ...
3
votes
1answer
67 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
164 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
65 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
48 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? ...
8
votes
2answers
111 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
72 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 ...
7
votes
1answer
50 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
1answer
116 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 ...
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 ...
3
votes
0answers
101 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?
1
vote
0answers
59 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 ...
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
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. ...
2
votes
1answer
44 views

pgfplots - How can I fill the background to a “node near a coordinate”?

I'd like to have the nodes/values for each plot fill with white, so the grids get overdrawn, so to speak. Is this possible? (Note: I only activated the major grid for x for the sake of the thread.) ...
0
votes
1answer
24 views

Title distance to axis/labels [duplicate]

How can I change the distance from the title to the axis of a plot? I'd like to have some tick labels at a axis at the top of a plot and a title above it. The title and the labels are written to near ...
1
vote
0answers
65 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 ...
6
votes
1answer
62 views

how to avoid drawing of graph through inset

I have a figure which requires an inset. Using pdfplots i am nearly there but have the main graph plotting through the inset. How can i avoid the drawing through the inset? Also is it possible to ...
13
votes
2answers
220 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 ...
0
votes
0answers
35 views

Pgfplots 2 horizontal barplots, back to back, share y-axis, have different x-axis

Is it possible to have 2 horizontal barplots which share a common y-axis with one plot reversed, ie. back to back. The x-axis would be scaled differently. I have 2 items in my data that are scaled ...
3
votes
2answers
46 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 ...
2
votes
2answers
63 views

Matlab2Tikz FaceColor Surfplot

I would like to export a surf plot, whose face color is for example green, out of MATLAB R2014a to latex with the aid of matlab2tikz. Unfortunately when i run pdflatex the face color now ranges from ...
4
votes
2answers
92 views

Barplot: alternating colors, bars side by side

I'd like to have a barplot with bars side-by-side and with alternating colors. It should look like the ouput of the code below, just with alternating bar colors. (Got the idea from here) ...
3
votes
1answer
66 views

Graphing each trigonometric function and its inverse

May I have the code for graphing each trigonometric function and its inverse on the same Cartesian plane? I have the following code for only graphing the sine function, and I got the following error: ...
5
votes
2answers
106 views

How to mark/label nth data point from file in pgfplots?

\documentclass{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} % For \pgfplotstableread \pgfplotsset{compat=1.10} \pgfplotstableread{ 0.01 1.00 0.02 2.00 0.03 3.00 0.04 4.00 ...
7
votes
2answers
90 views

Using sans font for tick labels in pgfplots

I am using a sans font for my figures. Hence I also want the tick labels of the pgfplots to be in sans. The tick labels, however, are set in a math enviroment. So changing the text font does not ...
4
votes
2answers
58 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. ...
4
votes
2answers
48 views

How to avoid copied code with the combination pgfplots/standalone?

I have a series of pgfplots-based figures that I compile to pdf images using the standalone package. I currently have one .tex-file per figure. The problem with this is that since it might just be the ...
4
votes
1answer
82 views

Small Axis arrows in PGFplots

I would like to draw small arrows (through a macro probably), to show the coordinate directions like the plot below. It would be nice to have the option to turn on/off the grids as well. The MWE for ...
4
votes
3answers
143 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 ...
10
votes
2answers
207 views

Decorating a path's edge with a hatch pattern in TikZ

Problem I would like to indicate an infeasible region in one of my pgfplots by manually drawing a path in the canvas. This should be a hatched pattern that is decorated on the path, something like ...
3
votes
2answers
95 views

TikZ inside pgfplot axis environment

I am trying to use the TkZ command MarkRightAngle in an axis environment, however I cannot get it to work. I get a "Missing character: There is no ; in font nullfont!" error and "Line 21: Package pgf ...
1
vote
1answer
55 views

How to hide the legend in a tikz picture

I am trying to hide the legends in the following tikzpicture code. However, after I use every axis legend/.code={\let\addlegendentry\relax}, it messes up the picture. Could someone help me how I can ...