{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

3
votes
1answer
72 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 ...
2
votes
1answer
28 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} ...
3
votes
0answers
50 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
21 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
49 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
46 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
47 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
70 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
134 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
68 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
106 views

Plotting an arbitrary function in latex [on hold]

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
50 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
129 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
94 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
452 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
287 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
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 ...
7
votes
1answer
52 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
26 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
42 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
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. ...
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.
5
votes
1answer
92 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
47 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
31 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 ...
1
vote
1answer
28 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
36 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
49 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
150 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
38 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
45 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 ...
5
votes
1answer
2k views

Vertical line in ymode=log plot

Please have a look at the following MWE: \documentclass{article} \usepackage{pgfplots,pgfplotstable} \begin{document} \begin{tikzpicture} \begin{axis}[ %ymode=log, ] ...
4
votes
1answer
47 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 ...
11
votes
3answers
269 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, ...
8
votes
1answer
114 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
1answer
101 views

Simple Characteristic Function or Step Function in pgfplots

How would I go about creating a simple characteristic function plot such as this in pgfplots? It is not necessary for my Latex processor to generate the plot based on a function, manually drawing the ...
6
votes
2answers
117 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, ...
10
votes
2answers
95 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 ...
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
85 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 ...
8
votes
1answer
108 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} ...
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 ...
2
votes
1answer
52 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 ...
4
votes
2answers
73 views

Align axis of separate plots in pgfplots

I am preparing a talk using plots generated in pgfplots' axis-environment. I want the plots' axes to be of the exact same size and position. Unfortunately, plots with different axis- and plot-labels ...
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 ...
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 ...
4
votes
1answer
143 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?