{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

4
votes
1answer
149 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
98 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
272 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
43 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
92 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
62 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
83 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
65 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
78 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
39 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
107 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 ...
3
votes
1answer
48 views

font size scaling and node placement issues using pgfplots and tikzscale

From the tikzscale documentation I understand, that it is supposed to keep font sizes constant. However, this does not seem to apply to axis ticks or axis labels from pgfplots' axis environment. Also, ...
3
votes
1answer
69 views

I am trying to shade in-between the two lines

The lines were created from points, can anyone give any suggestions on how to do this. Thanks! \documentclass{article} \usepackage{graphicx} \usepackage{siunitx} ...
5
votes
2answers
95 views

pgfplots: relative node positioning in axis cs

I have got a file to plot with pgfplots. For convenience I'd like to define a measure in the plot. Unfortunately the relative positioning seems to give weird results. If I define the node coordinates ...
1
vote
0answers
99 views

Error using lualatex and tikzexternalize to compile document with PGFPlots

I have a fairly large document with a number of pgfplots diagrams and due to memory capacity limits in PDFLaTeX I am now using LuaLaTeX to compile. While this works well, it takes forever to produce ...
3
votes
1answer
92 views

Area restricted by three functions

I am trying to shade the area restricted by the functions y \sin x, x = \sin y and y = 2pi + x. Now my problem is that I do not have access to Pgfplots 1.10so the libary fillbetween is not accessible ...
3
votes
1answer
94 views

Bar plot in PGF plots with no upper limit

I assesed particke size distribution using sieve analysis. Now I want to present the results using PGFplots. The largest opening was 1 mm. I can plot finite intervals (e.g. 0.25 mm -- 0.50 mm), but I ...
7
votes
2answers
92 views

Linear and non-linear functions inside \addplot to get a unique legend

I have functions which have two intervals, a linear and non-linear. I want to have these inside the command \addplot in pgfplots, to get only one legend. I tried it with them in a separated write, but ...
2
votes
1answer
60 views

Using \foreach to manage ticks in axis, Tikz

I want to add minor distance between y ticks. The default distance is 0.5, I need to set for 0.2. It seems easy to set different space for ticks according to pgfplots, in 4.15, page 271. I add the ...
6
votes
3answers
165 views

Grid dots in pgfplots

How can I generate a multi-resolution dot grid (see image) in pgfplots? The dot grid does not necessarily coincide with the axis ticks. edit: The above plot was created using \addplot[only ...
3
votes
0answers
85 views

pgfplots: unable to affect cycle list name while using \pgfplotsinvokeforeach

I am unable to use custom colors from cycle list name with pgfplotsinvokeforeach. Some pointers could be gauged from this post, which discusses execution of various steps in a plot function. In the ...
2
votes
3answers
80 views

Different xlabels for same x values on different plots

I have two tables that hold different values for the same x values. To compare them, I want to plot both of them in the same plot but with different xlabels. The tables should remain the same, i.e. I ...
10
votes
4answers
266 views

Plot the cusp catastrophe surface

I'm trying to draw (plot) the Cusp catastrophe surface into latex using any software logic. I am completely stuck because I'm definitely not a mathematician. The surface has the potential: V(x) = ...
3
votes
1answer
54 views

ybar overlaps axis line (and xtick removal)

When I use the MWE below my bar plots are overlapping partly the black x-axis How is it possible that the bar graph starts exactly above the x-axis and not on top of it? And is there a way to ...
4
votes
2answers
76 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 ...
2
votes
1answer
60 views

Pgfplot axis and axis label cutomization

Well, simply, my code gives the graph below. But what I want is something like Fig. 30 (p. 56, Advanced Engineering Mathematics, 9th Ed. by Irvine Kreszig). \ssfamily font for the tick label, ...
4
votes
2answers
100 views

How to have two x parallel xtick labels in a single pgfplots plot?

I want to have this effect: The first set of xtick labels are exactly the first column in this table (is there such a command?); Then, under this first set of label, there should be another xtick ...
9
votes
2answers
109 views

pgfplots 3d cylindrical coordinate system

I am trying to plot a cylindrical coordinate system using pgfplots. The idea would be to plot the r,theta plane similar to what polaraxis provides, see here. I don't know how to translate something ...
7
votes
1answer
174 views

How to retrieve color from a specific location and use it?

Please save your time and energy on this question, this is not an important one. What's the color in the middle (or anywhere else) in these pictures? How to retrieve/compute that color to be ...
6
votes
1answer
62 views

Automatically convert colored PGFPlots in the appendix to grayscale

My document contains a lot of colored PGFPlots, which are generated from external data files. In order to save costs when printing, I would like to automatically convert the color of every PGFPlot in ...
5
votes
2answers
80 views

How can use pgfplots to fill below for a semilogy axis?

I am plotting my y axis on a log scale, and many of the y values are less then one. Using the following code: \documentclass[12pt]{article} \usepackage{tikz} \usepackage{pgfplots} % drawing plots ...
3
votes
2answers
136 views

TikZ, PGFPlots, or GNUplot: plotting a curve without the known function

I would like to make a plot of a function that has an overshoot of 25% and then settles with subtle oscillations at 100%. I would like to create it in one of the listed packages or in gnus case add ...
2
votes
2answers
104 views

PgfPlots column name with multiple words

I have a simple data file consisting of two columns (x and y coordinates). I would like the first row of the file to be the names for the columns. I would like the user to have the option to specify ...
2
votes
1answer
155 views

Peculiar tikz-external, pgfplots, tikzscale combination problem

I want to use \tikzexternalize and tikzscale with pgfplots' \addplot graphics command and \clip=false option. I am using three files: A.png, A.tikz and A.tex. A.png can be any graphics file. A.tikz ...
9
votes
2answers
166 views

create a stacked histogram with tikz

I try to create a stacked histogram. Like this: My data consists of classes (0-4) and a float value for each class. I already have a histogram for all mean values. But I would like to color the ...
5
votes
1answer
61 views

pgfplots “Dimension too large” returned when plotting rational function

I've been using pgfplots for graphing for a while, now, and have recently run into a situation where I need to graph rational functions. Most of these have worked out fine, but one has caused me to ...
2
votes
1answer
104 views

How to plot a normal curve with proper y-values

Follow-up question to Plotting bell shaped curve in TikZ-PGF I'm new to LaTeX, and I'm typesetting a document for my stats class, and trying to use LaTeX to produce a normal probability distribution. ...
4
votes
1answer
87 views

Opacity for pst-3dplot object

How can the opacity of a pst-3dplot object be set to be transparent? I have an example where using opacity or strokeopacity options do not work. I am trying to make an image similar to the following: ...
6
votes
1answer
74 views

Strange Vertical Grid in TiKZ bar plots

I've trying to make a set of bar plots using TiKZ and pgfplots but for some unknown reason, the plot displays a vertical grid in X = 1, even when there is no grid added to the graph. Is there a way ...
1
vote
0answers
21 views

Adding legends to tikzpicture [duplicate]

I have tikzpicture (with 3 graphs from my data files. I want to add legends to data1, data2 and data3 to my picture, is it possible? \documentclass[english]{article} \usepackage{tikz} ...
0
votes
0answers
44 views

PGFPLOT Externalization not working

I am trying to externalize PGF Plot to be saved as EPS file using latex and enabled shell-escape. \documentclass[a4paper]{article} \usepackage{lipsum} \usepackage{tikz} ...
3
votes
0answers
71 views

External PDF from pgfplots contains several pages when with floatrow

Plotting with pgfplots and the external library creates the single PDFs for every plot as wanted. But every of those PDFs contains several pages, each showing the same plot. Sometimes there are three ...
2
votes
1answer
62 views

Exclude certain plot points from smoothing

How do I exclude certain coordinates from being smoothed by the "smooth" option in a PGF plot? How do I avoid that \closedcycle jumps to zero? Here is my example: \documentclass{minimal} ...
4
votes
3answers
127 views

Positioning pgfplots axis in tikzpicture

I want to put a pgfplots plot beside several other pdf images that I import into my document, but I can't figure out how to position the pgfplots axis in the larger tikzpicture: ...
1
vote
0answers
71 views

Plotting Multiple Time Series plots in LaTeX using PGFplots and txt files - Relativity Issues

I have a problem with plotting multiple time series plots in a single graph in Latex. Background: I have three products - Potatoes, Apples, and Oranges. Each products' historical price and ...
7
votes
1answer
143 views

How to interrupt a plot?

Please consider the following example code: \documentclass{article} \usepackage{pgfplotstable} \pgfplotstableread{ 1 19.178 26.027 8.219 6.849 39.726 1 2 54.795 21.918 4.110 6.849 ...