{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
57 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 ...
7
votes
2answers
81 views

Using LaTeX commands inside pgfplotsset

Is there any way to use LaTeX commands inside \pgfplotsset? For instance, the following code produces an error indicated in the \pgfplotsset line, whereas if one replaced \contents in the ...
3
votes
2answers
67 views

Polar plot with cartesian values, lack of angular precision in the integrated arctan2 calculation?

I noticed that for values close to 0° and 180° the angular values dramatically changes if the values are imported from cartesian data. Here the code (with cartesian coordinates plotted in polar with ...
4
votes
1answer
26 views

Line break in date ticks label

I want to plot some data depending on dates, but as the date range is quite large (4-5 years) I would like to have ticks in the form dd.mm\\yyyy, is it possible ? It would be even better not to repeat ...
4
votes
3answers
137 views

How can already binned data be plotted as a histogram?

I have the following data: [0, 1000) : 14524 [1000, 2000) : 38214 [2000, 3000) : 36169 [3000, 4000) : 25875 [4000, 5000) : 16942 [5000, 6000) : 10603 [6000, 7000) : 6778 [7000, 8000) : 4288 [8000, ...
1
vote
0answers
58 views

pgfplots - plusminus doesn't match its definition

I've been trying to make a ybar plot with error bar using pgfplots. I want to make this graph inside a tex template, but one weird thing has occurred - when I inserted the following code (be more ...
9
votes
2answers
251 views

Plotting a directed graph using pgfplots

I have a few files in the following format: x y 12 12 12 13 13 15 15 15 15 13 13 12 12 10 10 8 8 8 8 10 10 12 12 12 12 10 10 10 And I wanted to plot them as a directed graph in a ...
1
vote
1answer
34 views

How can I add the index of value of a table to a point on a graph?

I would like to add to each branch of my polar comb graph the index value as a label. I give you my code and a screenshot with what I would like to have: \documentclass{minimal} ...
3
votes
2answers
56 views

How to plot only some value of a table?

I want to plot only some values of an external tex value table, for example from the 3rd value to the 6th value. I could manually comment the non-wanted values but the table may often change and I ...
4
votes
1answer
80 views

How to add labels to polar plot / polar comb in polaraxis and show FULL coordinates?

In pgfplots, I am trying to: for a first figure: label 12 polar plots plotted on the bases of 12 tables (values given in cartesian coordinates) without showing a legend but adding a label directly ...
8
votes
0answers
189 views

Automatically add discontinuities in some plots

I have multiple plots (about 15 different figures) that have the same axes (i.e., same ymin and ymax values and same xticks). One of the plots has very large values. I don't want to either increase ...
4
votes
1answer
30 views

zmin axis value for a 3d plot in TikZ

If I plot this the z axis does not start at 0 but somwhere negative. How do I fix this? \documentclass[border=2pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \usepackage{tikz} ...
4
votes
1answer
144 views

grouped bar colors in pgfplots

I have a simple grouped bar chart but would like to have all group bars the same color. Currently each bar in a group is colored, possibly because of the way I have used addplot. I've tried to use a ...
4
votes
2answers
106 views

Black Fill in my plot

I'm using the following code and when it compiles the result is not what i expect. \begin{figure}[h] \begin{tikzpicture} \begin{axis}[xbar,enlargelimits=0.15] \addplot [draw=blue,pattern=horizontal ...
5
votes
1answer
47 views

pgfplotstable will not generate table

I have some data from a table that I would like to tableize with pgfplotstable. After many hours of going through the pgfplotstable 1.10 manual and basicly copying the example code with my data. Are ...
5
votes
1answer
65 views

PGFplots - label each group plots

In this group plot how do I add labels to individual graphs. I want to label each graph as (a), (b), (c)... \documentclass[margin=5mm]{standalone} \usepackage{pgfplots} ...
8
votes
2answers
98 views

Gap between line and point in pgfplots, like pointintervalbox in gnuplot

I wondered if it is possible to create a scatter plot in pgfplots with a similar style as the "pointintervalbox" option in gnuplot, i.e. a plot with points and lines, but there is a gap between the ...
2
votes
1answer
86 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
56 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? ...
4
votes
2answers
89 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
99 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} ...
3
votes
0answers
37 views

pgftables: nodes near coords align depending on value? [duplicate]

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
77 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
46 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
160 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
66 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
1answer
64 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
806 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
62 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
83 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
89 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 ...
12
votes
2answers
244 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
61 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
43 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
63 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
658 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
26 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
86 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
23 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
63 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
38 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
60 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
121 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
63 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 ...
17
votes
1answer
191 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 ...