{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
0answers
98 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 ...
11
votes
1answer
1k 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
79 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
190 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
164 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
89 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 ...
8
votes
1answer
160 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 ...
1
vote
0answers
70 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
76 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
51 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
239 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
366 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
76 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
174 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
167 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
147 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
270 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
112 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
105 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
73 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
390 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
267 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
241 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
635 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
359 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 ...
4
votes
1answer
139 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
111 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
172 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
115 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
297 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 ...
5
votes
1answer
236 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 ...
3
votes
3answers
107 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 ...
11
votes
4answers
483 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
164 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
256 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
203 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
183 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
244 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 ...
9
votes
1answer
247 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
181 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
219 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
239 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
198 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
290 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
290 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
537 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
205 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
165 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
134 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
22 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} ...