{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
24 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
1answer
63 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 ...
3
votes
0answers
45 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
20 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
48 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
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
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
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
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 ...
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) ...
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} ...
10
votes
2answers
127 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
49 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
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
46 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 ...
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
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
149 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
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 ...
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
2answers
115 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
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 ...
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
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 ...
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} ...
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 ...
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
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?
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
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 ...
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, ...
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} ...
9
votes
1answer
90 views

How to make an inline pgfplot

I have the following code to graph a function with a height of 2em, and in line with some text, but it gives an error. \documentclass{article} \usepackage{pgfplots} \newcommand\quadratic{ ...
3
votes
0answers
57 views

How to automatically optimize the PDF output of TiKZ externalize?

I use pgfplots with externalization for generating plots in my document. For heavy plots the output PDF for a figure can grow to few hundred KB. I used Adobe Acrobat to optimize the PDFs which ...
3
votes
1answer
81 views

Simple pendulum phase space plot with pgfplots: looking for a clever parameterization

I want to produce a nice phase space plot of the simple pendulum for a course I'm teaching. Essentially, this boils down to plotting y^2/2 = cos(x) + e for different values of e (the energy). If I ...
1
vote
1answer
59 views

pgfplot tikz single plot with 2 y axis

I have 5 columns of data in a txt. file as nxI Bfield1 magmoment1 Bfield2 magmoment2. I am attempting to implement nXI - x axis, Bfield1 and Bfield 2 as my y axis and magmoment1 and magmoment 2 as ...
5
votes
1answer
76 views

plot coordinates {(a_1,3) (a_2,2) (a_i,4) (a_r,1)} in pgfplots

I am using the following code: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \pagestyle{empty} \begin{document} \begin{tikzpicture} \begin{axis} \addplot+[ycomb] plot ...
2
votes
1answer
35 views

Scaling pgfplots matching papersize

I'm facing some problems at the moment with scaling some diagrams so that they each fit on a page (landscape) in my appendix. Does anyone has some suggestions how to solve this? Any help would be ...
3
votes
0answers
66 views

matlab2tikz does not capture legend title? [duplicate]

I generate a plot in MATLAB using the code below (MWE): x = [1:100]; y = x.^0.5; [hLine1]=semilogx(x,y); hleg1 = legend(sprintf('%.4f',0.4334)); set(get(hleg1,'title'),'string','test'); set(hleg1, ...
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 ...