{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

7
votes
2answers
77 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$, ...
1
vote
0answers
38 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
55 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 ...
5
votes
1answer
78 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, ...
2
votes
0answers
65 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
83 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
73 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
2
votes
0answers
41 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
41 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
83 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 ...
4
votes
0answers
62 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
26 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} ...
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 ...
1
vote
0answers
53 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
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} ...
4
votes
1answer
49 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
106 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
28 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 ...
2
votes
0answers
29 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
53 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
48 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} ...
10
votes
2answers
134 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
52 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
69 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
93 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 ...
5
votes
1answer
48 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 ...
4
votes
1answer
43 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
29 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
39 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 ...
4
votes
1answer
51 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
153 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
40 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}[ ...
4
votes
1answer
50 views

pgfplots - legend displays incorrectly for stacked bar chart

I have a problem with formatting the legend correctly. Here is my code: \begin{figure}[H] \centering \begin{tikzpicture} \pgfplotstableread{ x Order m0 m132 m3 m460 ...
8
votes
1answer
117 views

pgfplots: How to add the origin to the axis in a robust way?

Question I add the origin to my graph with after end axis/.code={\path (axis cs:0,0) node [anchor=north west,yshift=-0.075cm] {0} node [anchor=south east,xshift=-0.075cm] {0};} (code found here). ...
6
votes
2answers
126 views

pgfplots: how to display a label next to my plot when the option clip = true cuts out a part of the graph?

Question I want to attach a label to the curves I draw. My current solution is to add a node after the plot of my function (see the code below). But, when I explicitly cut out a part of my graph, ...
1
vote
0answers
48 views

pgfplot same size font in figures and same size figures

Hi I've created figures with standalone and pgfplot package. The figures output size are different to one another but more importantly the font size are different. I would like all figures to be of ...
9
votes
1answer
87 views

pgfplots line colors

Is it possible to make pgfplots use a predefined color map while plotting multiple lines, I currently have 9 samples that I want to plot, but don't want to type different colors for each one. Right ...
3
votes
1answer
49 views

Display plot pgfplots multicolumns

I have the following data & I'm trying to display a plot similar to the screenshot items,section_1,section_2,section_3,section_4 10,82,42,38,22 20,38,24,20,63 30,44,49,39,40 40,58,48,47,47 ...
4
votes
1answer
48 views

tikzpicture : hide only one “plot” from legend

Found the answer: pgfplots: prevent single plot from being listed in legend I plot multiple things to one tikzpicture. Because the plotting order is important to me, to avoid overlaying of the hatch ...
8
votes
1answer
109 views

pgfplots: wrong domain, wrong axis, uncentered graph… is it a bug?

Question I get a very strange graph with pgfplots, see the picture below. What is going wrong? Code and picture \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
2
votes
1answer
53 views

pgfplots: how to add a label to a graph with the option clip=true?

Question I would like to add a label to my graph, on the right of it or at any other place, for instance somewhere above my graph. Is it possible? I want to use the option clip=true, because of the ...
7
votes
1answer
84 views

pgfplots: the margins “eat” some parts of my graph

Question I use pgfplots with the ultra thick option ans without explicitly giving the domain for the y-axis. It seems that in this case, some part of my graph is "eaten" by the margin: see the ...
4
votes
1answer
147 views

Drawing phase line for differential equations

How can one draw one of this pictures in latex with the simplest way and good looking output?
0
votes
0answers
49 views

Graph Labeling and Text Overlay Ability

I have a couple of question in regards to LaTeX ability to overlay text on a graph at a specific point. The background: I have a time-series plot that I load in to LaTeX using a txt file and the ...
0
votes
0answers
37 views

Varying Error Bar Length In Timeplot Graph

I have a quick question about the Error Bars functionality in LaTeX, specifically - I am using pgfplots and tikzpicture packages. I was wondering if it is possible to vary the length of the Error bar ...
4
votes
0answers
48 views

Using PGFPlots to plot macro result [duplicate]

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 ...
10
votes
2answers
96 views

Convert from physical dimensions to axis cs coordinate values

In answering PGFPlots: Howto draw a label at a zero of a function?, I got stuck on converting a length in pt to the actual coordinate value in the axis cs system. Here I only need the x value, but ...
11
votes
3answers
270 views

PGFPlots: How to draw a label at a zero of a function?

Is there an easy method to construct a node (and hence a label) at a zero of a function, i.e. at the intersection of the function with the x-axis? The examples I found were somehow too complicated, ...
2
votes
1answer
42 views

ylabel covered in graph with pgfplots

I have the following code: \documentclass[12pt,a4paper]{article} \newcounter{conto} \setcounter{conto}{\time} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} ...