{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

11
votes
1answer
659 views

Draw a line between data points in two different pgfplots (subfigures)

I have two different pgfplots in two subfigures. I want to draw a line between the red circled data points and the blue ones. I added lines manually with LibreOffice Draw to show you what I mean. My ...
8
votes
3answers
431 views

PGFplots 3d: Creating a filled solid of revolution

I have searched through the internet for a solution, but since I'm not that skilled with pgfplots, I need your help. For several examples I want to draw solids of revolution, but filled ones. I ...
0
votes
0answers
81 views

Choosing location of legend entries in Pgfplots

I am fairly new to using pgfplots and have been combing the manual for a couple hours now and I can't find an elegant solution to my problem. I would like to have two columns of legend entries and ...
1
vote
1answer
74 views

How to scale column numbers in a pgfplot table

I want the numbers in my second column in dataTest.dat file be multiplied by 1E4, and it seems that \addplot table[x=x,y=10000*y] {dataTest.dat}; does not work, what should I do then? Here is the ...
3
votes
1answer
157 views

pgfplots legend to name not working

I would like to use legend to name feature to display legend externally. I have two graphs inside a tikz picture which comes from this question. Here is the code tha to tried to modify and make the ...
6
votes
1answer
208 views

How to prepare coordinates for 3D surface plot using pgfplots

I'm trying to plot a Pareto front on 3 dimensions, using pgfplots. However, although I expect a nice surface to appear (since it is a Pareto front), pgfplots does not produce the result I want (yet). ...
4
votes
1answer
78 views

Placing labels as numbers at the top of each bar in this plot in pgfplots

I have this bar chart where numbers seem to appear to be not centered at the top of each bar. I tried writing "center" in the \node area, but it did not work. The code is written using pgfplots. The ...
4
votes
1answer
114 views

Tufte-handout caption overlapping figure

I am attempting to display three figures, side by side in a table. I've placed the table inside the figure* environment to make the table the full width of the page, however the corresponding caption ...
5
votes
2answers
527 views

Making mesh grid lines transparent in surface plot with pgfplots

I need to make a partly transparent, one color, surface plot. Additionally I want to control the transparency of mesh lines. Running this code: \documentclass{standalone} \usepackage{tikz,pgfplots} ...
2
votes
1answer
150 views

Grouping plots without groupplots

Running this MWE: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{figure} \centering \begin{tikzpicture} \begin{axis}[% width=2in, height=2in, scale only axis, xmin=0, xmax=7, ...
1
vote
0answers
83 views

legend transparency in pgfplots

I want to have a legend in pgfplpots such that it overwrites grid lines (i.e. grid lines are erased where the legend is placed) but not the axis (i.e. axis are drawn on top of legend, in case legend ...
6
votes
1answer
76 views

pgf math is not returning the correct results

I have in \pgfmathsetmacros some stored variables. I checked that math on Mathematica when the plotted points came back wrong. \pm\infp is approx \pm 1.51022 and \pm\infn is approx \pm 0.46823. ...
4
votes
1answer
202 views

pgfplots and using axis cs to add points

I am trying to mark two inflection points using a foreach loop in a pgfplot, but it isn't working. \documentclass[tikz]{standalone} \usepackage{pgfplots} \pgfplotsset{compat = 1.10} \begin{document} ...
5
votes
2answers
220 views

pgfplots and tikz: clipping a named plot

I would like to clip along a \addplot line made by pgfplots. I am not sure entirely how to do this since my tries have failed. What have done so far is below. \documentclass[tikz, convert = ...
6
votes
1answer
1k views

Tikz Stacked Bar Chart with Text

I have the following stacked bar chart and want to put some text behind each bar element and some text into each of the colored areas. Do you have some ideas, how I could achieve that? The ...
3
votes
1answer
99 views

How to properly place an object based on axis?

I would like to place a rectangle in one of my graphs. However it seams that I am mixing dimensions. Is there a way to make sure that \draw uses the same dimension and would fill what is currently ...
3
votes
1answer
256 views

PGFplots and GNUplot with addplot3

I am trying to plot the following: \documentclass[tikz, convert = false]{standalone} \usepackage{pgfplots} \pgfplotsset{compat = 1.9} \begin{document} \begin{tikzpicture} \begin{axis}[view = ...
7
votes
2answers
198 views

Why does a plot of a reciprocal function using pgfplots look wrong?

I am trying to plot the function 1/x^2 but the result is obviously wrong, here is how it looks like here is the code \begin{center} \begin{tikzpicture} \begin{axis}[ %xlabel=$x$, ...
1
vote
0answers
43 views

Displaying two plots side by side not displaying titles correctly [duplicate]

I’m writing a report and using the following code to display a bode-diagram. To save some space (I have several of these figures), I’ve displayed them side by side, but the title of the right plots’s ...
5
votes
0answers
163 views

Help creating 3D solids of revolution in pgfplots? [duplicate]

I have done a lot of plotting in 2D using pgfplots but I am new to the 3D portion. I am attempting to illustrate a solid of revolution. For example, I have the area under the curve y = x^2 + 1 on the ...
5
votes
1answer
179 views

A pgf plot problem

I'm new to pgfplot and I have a pgfplot problem. figure 1 :As you can see the line is going through the number '2'. How can i fix it? figure 2: Also can i fix the line length, going through 2, ...
3
votes
0answers
343 views

using gnuplot to plot data from a file

I am trying to plot some data using pgfplots, but the data are so extensive that the maximum capacity is reached. I get the error: TeX capacity exceeded, sorry [main memory size=3000000]. What can I ...
1
vote
2answers
112 views

Non-linear plot looks linear

I am plotting a non-linear function -2/3 x^ 3 + x^2-3x+4/3 in the interval [0,1/2], I tried to change the scales to make it look less linear but still looks like a straight line. Any suggestions? ...
4
votes
1answer
207 views

Stack figures in horizontal plane in 3D rectangular shape without loss of quality

I am plotting figures on GMT but it does not support some features in gridview. So I want stack each figure on different platforms below each other. E.g. I want to add each image like the following
5
votes
3answers
412 views

pgfplots stacked bar chart with markers

I have a stacked bar chart. I would like to add markers to the chart in some values. I am trying to create something like in the stacked bar chart. Is it possible to add markers instead of another ...
3
votes
1answer
212 views

Showing all the decimal numbers on the y axis clearly in a given chart

I would like to show my y axis as follows: Here is my code: \documentclass[english,12pt]{standalone} \usepackage{tikz} \usetikzlibrary{patterns} \usepackage{pgfplots} \pgfplotsset{compat=1.10} ...
4
votes
1answer
255 views

How to skip ticks in pgfplots plot?

I have frequently the problem that too many data points are available for the x axis, I want to show them all in the actual plot, but I would like to show only a subset of the ticks. For instance, if ...
5
votes
1answer
281 views

Pgfplots : Shadow in bar chart with restricted domain

I have a following code which plots a pgf bar plot for me. I am able to add shadow to one of the bar plot. However, the other plot which has a broken y bars, I am unable to add the shadow, because ...
3
votes
0answers
108 views

PgfPlots bar with missing data causes columns to be “misplaced” [closed]

I looked for a similar problem here in SE but I couldn't find it. It's just driving me crazy :| Here is a MWE: \documentclass[xcolor=dvipsnames, 10pt, pdflatex]{beamer} \usepackage[utf8x]{inputenc} ...
0
votes
0answers
10 views

Skipping ticks in pgfplots plot [duplicate]

I have frequently the problem that too many data points are available for the x axis, I want to show them all in the actual plot, but I would like to show only a subset of the ticks. For instance, if ...
1
vote
0answers
108 views

Create a bar char from CSV

I have a .csv file that looks like this: gender.csv GENDER,NUMBER,PERCENT MALE,20,20 FEMALE,80,80 TOTAL,100,100 I want to create a bar chart using MALE and FEMALE. GENDER can be the chart name or ...
3
votes
0answers
36 views

Function not plotted between 0 and 1 [duplicate]

When I am trying to plot the function x^0.5 / ( x^0.5 + 10^0.5 ), the plot will only start at x=1 but not at x=0. See the following MWE: \documentclass{article} \usepackage{tikz} ...
4
votes
1answer
258 views

Plotting a function defined with \pgfmathdeclarefunction

I've got a few macros that perform floating point lookups and calculations for me and I'm interesting in plotting their results. They're the kind of calculation which requires if/else, so they can't ...
1
vote
1answer
164 views

Plotting an arbitrary function in latex [closed]

I would like to know how I can replicate the diagram below in latex. thanks. Edit: I can plot a function using tikz/pgfplots if I know how the function is defined. Unfortunately, I don't know how ...
3
votes
1answer
60 views

pgfplots: adds “-indexX” to duplicate columns when pulling column name by \pgfplotstablegetcolumnnamebyindex

I am making graphs from a huge CSV with a macro hacked from http://tex.stackexchange.com/a/45125 and http://tex.stackexchange.com/a/24023 Which selects start/end column and adds them etc. But ...
3
votes
1answer
1k 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 ...
7
votes
1answer
93 views

Change line style in pgfplots in the middle of a line

I have the following MWE graph: \documentclass{memoir} \usepackage{pgfplots} \pgfplotsset{compat=1.10} \begin{document} \begin{tikzpicture} \begin{axis} \addplot coordinates { (1000,1) ...
5
votes
0answers
66 views

pstool + pgfplots + parskip conflict

I've recently observed extremely strange latex bug if pstool + pgfplots + parskip packages are used at the same time. \documentclass{article} \usepackage{pstool} \usepackage{pgfplots} ...
11
votes
2answers
782 views

pgfplots: Grid Lines below Filling

I want to fill the area between two curves and have the grid lines below the filling. Is this possible? (From Showing grid on top of plot fill with PGFplots? I thought axis on bottom might work, but ...
3
votes
1answer
103 views

Automatic pin position on pgfplot when using custom axis

I'm trying to put automatically label several plots. For this purpose, I just discover the pin option to add it to the plots. This solution works rather well, and semi-automatically. However, when ...
6
votes
2answers
399 views

Scaling and trimming white space from a pgfplots picture

In answering How do I create a combined figure with two imported curves and draw around it with Tikz?, I was able to make my own graph fill the space between two horizontal lines as seen here. ...
5
votes
1answer
155 views

How do I create a combined figure with two imported curves and draw around it with Tikz?

This is a two part question that I'd really appreciate any help with, I couldn't find previous posts about this so I apologize if this is a repeat question. It all stems from attempting to create this ...
7
votes
1answer
178 views

pgfplots y=x graph not rendering all points

\begin{tikzpicture}[baseline={([yshift=-1em] current bounding box.north)}] \begin{axis} [ x = 0.75cm, y = 0.75cm, xlabel ...
4
votes
1answer
194 views

tick labels style overwrites extra tick label style

For reasons, I need to move a tick label slightly to the right. Additionally I want to add an extra tick label at the zero of a function. However, the style chosen for the x label overwrites the ...
4
votes
1answer
74 views

pgfplots - Manual file (.pdf) asks me if I want to save the changes

Why does the manual for pgfplots have that prompt? I use it like every other file: I search for things, copy them, close it. That's it. The prompt is only for this very file.
1
vote
1answer
97 views

pgfplots - Data set doesn't get cut off

When doing a groupplot such as the one starting on the bottom of page 385 in the manual, is there some specific setting to cut off the data at the specified new xmin- and xmax-values? Or is there some ...
2
votes
1answer
148 views

set x axis text labels from data file in pgf plots

Here is the MWE: \documentclass{article} \usepackage{pgfplots, filecontents} \pgfplotsset{compat=1.8} \begin{filecontents}{horizontal.dat} Name Self PR ST PA CO TO RS 95.8 87.8 94.6 99.2 87.4 91.9 ...
5
votes
1answer
125 views

\foreach not behaving in axis environment

Am hesitant to ask yet one more embarrassing question, but I can't seem to see the problem with the \foreach in the MWE. It should produce several horizontal lines but only produces the one with the ...
9
votes
2answers
264 views

Plotting Arrows Programmatically in Pgfplots

I'm having an issue where I would like to plot a series of evenly spaced arrows where the length is dependent on the values from a data file and I'm not particularly sure how to go about it. I would ...
1
vote
0answers
191 views

fillbetween causes Illegal unit of measure (pt inserted) [closed]

This works beautifully: \documentclass[12pt]{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=newest} %\usepgfplotslibrary{fillbetween} \begin{document} \begin{tikzpicture}[ ...