{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

0
votes
1answer
48 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
1answer
48 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 ...
0
votes
0answers
25 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
47 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 ...
5
votes
1answer
81 views
+100

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
52 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 ...
15
votes
1answer
132 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
31 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
100 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
70 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
81 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
60 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
47 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
59 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 ...
12
votes
2answers
184 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
48 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} ...
1
vote
0answers
55 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 ...
6
votes
3answers
703 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
44 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
97 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
59 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
99 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
43 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
44 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
62 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
42 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
22 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 ...
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 ...
0
votes
0answers
31 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 ...
2
votes
2answers
62 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
85 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
65 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
1answer
90 views

Specify x and y in different coordinate systems in pgfplots similar to gnuplot

In gnuplot you can specify positions in several coordinate systems: First, Second, Graph, Screen, Character. What are the equivalents in pgfplots? I know the following: First : axis cs: Second : ...
5
votes
2answers
102 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
88 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
3answers
132 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
196 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 ...
4
votes
1answer
53 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
46 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
75 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 ...
3
votes
2answers
91 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 ...
4
votes
1answer
49 views

Error cross-referencing when tikz mode is graphics if exist

I am getting the error "Undefined control sequence" when using \tikzset{external/mode=graphics if exists} and the label does not exist (It should produce a warning not an error, though because the ...
2
votes
1answer
45 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
57 views

PGFPLOTS: How to merge 2 tables for histogram

I have a data set that I will plot across two pages. My initial strategy is to split the table in half. Read in the first table and plot, and so with the second. My problem with this is I do a summary ...
1
vote
1answer
52 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 ...
2
votes
1answer
54 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 ...
11
votes
2answers
6k views

How to plot data from a CSV file using tikz and csvsimple?

Here is a minimal example : \begin{filecontents*}{data.csv} a,b,c,d 1,4,5,1 2,3,1,5 3,5,6,1 4,1,4,9 5,3,4,7 \end{filecontents*} \documentclass{article} \usepackage[utf8]{inputenc} ...
3
votes
1answer
91 views

everyshi.sty is missing, how to install

I'm trying to use the package pgfplots, and I have successfully installed it along with the pre-requisite pgf. Whenever I compile, I get the error message "The required file ...everyshi.sty is ...
1
vote
0answers
55 views

How to put legend below the chart?

I have the following code that produces a line chart: \begin{figure}[p] \centering \begin{tikzpicture} \begin{axis}[ use units, cycle list name=exotic, %This defines the color. It ...
1
vote
1answer
50 views

Marking (resampling) a point on a pgfplots curve, interpolated from table data?

I was looking for this in the pgfplots manual, unfortunately the term "resample" is not mentioned, and "sample" hits the samples key, which refers to analytical functions, not to table data; so I ...