{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
1answer
63 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, ...
3
votes
1answer
17 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
38 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
140 views
+100

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 ...
4
votes
2answers
63 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} ...
1
vote
0answers
43 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
40 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. ...
3
votes
1answer
76 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 = ...
3
votes
2answers
2k views

How to save a figure produced by tikz save/export as JPG/PNG file

I have created various plots using pgfplots package for my thesis. Now I would export them in jpg or png format. Does it exist a way to achieve this porpouse?
4
votes
1answer
54 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
93 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 = ...
5
votes
1answer
72 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 ...
4
votes
1answer
3k views

pgfplots stacked bar plot: distance to axis, padding between bars

I have the following chart: \documentclass{article} \usepackage{xcolor} \usepackage{tikz} \usepackage{pgfplots} \definecolor{transfertoserver}{HTML}{D7191C} \definecolor{database}{HTML}{FDAE61} ...
3
votes
1answer
77 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 ...
1
vote
0answers
39 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 ...
7
votes
2answers
119 views

how to fix a wrong pgfplots plot?

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$, ...
5
votes
0answers
68 views

Help creating 3D solids of revolution in pgfplots?

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 ...
4
votes
1answer
84 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
1answer
89 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
83 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
87 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? ...
44
votes
4answers
4k views

3-dimensional histogram in pgfplots

I have a simple 3d histogram which I want to import into pgfplots, e.g. using matlab2tikz or by hand. PGFplots does not offer 3d histograms. Is there an easy way to do this?
4
votes
1answer
90 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 ...
0
votes
0answers
7 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 ...
3
votes
1answer
45 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
0answers
81 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
31 views

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

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} ...
1
vote
0answers
57 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
1answer
48 views

calling an expression in the document in pgfplot

Say I have the following function which I would like to plot. $S(z)=\frac{p.(\alpha_H+z.\alpha_W)}{p.(\alpha_H+z.\alpha_W)+\beta_H+z.\beta_W}$ While I could specify it in the \addplot command, I ...
4
votes
1answer
54 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
74 views

How can I resolve the side effects of AddEverypageHook to external pgfplots?

I have quite a huge document with many pgfplots, which I would like to externalize. Well I can externalize them, but my \AddEverypageHook command from the everypage package affects this externalized ...
3
votes
0answers
35 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} ...
5
votes
4answers
139 views

How to add a labeled mark on your plot in xy-plane by using (tikzpicture)?

I need a picture like Here is a try: \documentclass{article} \usepackage{pgfplots} \usetikzlibrary{decorations.markings} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[-stealth, ...
34
votes
3answers
7k views

Pgfplots: how to fill the area under a curve with oblique lines (hatching) as a pattern?

I want to hatch the area under a curve (graph of a function) with oblique lines on an interval (to illustrate the function's integral on that interval). This can be done elegantly in gnuplot... ...
0
votes
1answer
72 views

Scatterplot add a x line top of the line using Pgfplots

I want to draw a x line on the Picture-1 exactly like picture-2. I also want to remove the arrow as marked with circle. Any suggestion or complete code will be greatly appreciate. Picture-1 Code ...
1
vote
1answer
109 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
53 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 ...
10
votes
2answers
141 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 ...
4
votes
1answer
97 views

Positioning Even or Odd x axis tick labels in PGFPlots

I am wondering if it is possible in PGFPlots to position separately only the Odd x-tick labels (or Even). The reason is that, my x-axis labels look congested. In Tikz datavisualization, I have noticed ...
3
votes
1answer
460 views

Pgfplot figure off-center because of axis label

My figures are always off-center because the right axis is trimmed closer to the figure than the left. Do I have to manually extend the right axis by an adhoc amount every time? ...
4
votes
1answer
307 views

ylabel style when axis y line=right

When I'm using axis y line=right, it appears ylabel style is not applied, as illustrated by this MWE: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \begin{document} \Large ...
3
votes
1answer
30 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 ...
7
votes
1answer
54 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) ...
2
votes
0answers
32 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 ...
5
votes
0answers
50 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} ...
6
votes
2answers
74 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. ...
4
votes
1answer
46 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.
5
votes
1answer
97 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 ...
6
votes
1answer
53 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
32 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 ...