{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
2answers
32 views

Pgfplots and ClassicThesis: two plots side-by-side

I always loved the small text width imposed in ClassicThesis, but it is a problem when we have a lot of images/graphs. I would like to have two plots side-by-side in order to gain space (they are not ...
3
votes
1answer
24 views

How to Define Variables with Numbers taken from a File?

While working on a scientific topic, I wondered if the following is possible: I want to plot several exponential curves using the \addplot command. The specialty lies in the fact that I need the ...
3
votes
1answer
35 views

pgfplots: More efficient way for declaring piecewise function (similar to sawtooth)

I want to draw a repeating function that is similar to a sawtooth function. So far I started with this post and manually defined three tooths: % starting ...
7
votes
2answers
358 views

Bit string diagram with LaTex

I am interested to make some diagrams like the sample picture. I am not sure whether it can be done using Latex or not. Can anybody give any idea. Thanks.
2
votes
1answer
52 views

Problem with pgfplots and histograms

I just played with @Jakes pgfplots binomial examples from http://tex.stackexchange.com/a/198575/4011, however the histogram seems to be shifted to the left or to the right depending on the whole plot ...
1
vote
1answer
68 views

Typesetting tick marks on an axis so that the space occupied by the minus sign is ignored

The error in the following code seems to be at the following options specified in the axis of the pgfplot. ticklabel style={font=\tiny,fill=none}, extra x ticks={-3.14159, -1.5708, 1.5708, 3.14159}, ...
4
votes
1answer
120 views

Complex 3D drawings with tikz

I've already produced the following picture by means of TikZ. To do it, I modified the Sudoku example found here as follows: \documentclass{standalone} \usepackage{xcolor} \usepackage{tikz} ...
2
votes
0answers
44 views

PGFPlots - Legend box aligning with axis [duplicate]

I am trying to increase the size of the legend such that it exactly fits to size of the plot. But even after having a look at the PGF manual I could not figure out how I can realise my plan. ...
5
votes
2answers
80 views

tufte-book: tikz references in caption

Using the article documentclass, the following code works as expected. \documentclass{article} \usepackage{lipsum} \usepackage{caption} \usepackage{pgfplots} \pgfplotsset{compat=1.13} ...
1
vote
2answers
56 views

Annotating specific points in tikz plot

I'm plotting a exponential function and I need to point out some specific values in my plot. Point name (x;y) Point N1 (2;50) Point N2 (4;25) I'm trying to follow Gonzalo Medina's answer but I am ...
2
votes
1answer
63 views

How to plot functions involving rational exponents using pgfplots?

The power functions that i'm trying to plot isn't showing up fully, i've tried changing the domains and stuff but to no avail, can i get some help here please? \documentclass{article} ...
5
votes
1answer
96 views

How to make a 2D surface grid in Tikz?

I want to do something like this: And this is what I have done so far: \documentclass[a4paper, 11pt, oneside]{article} \usepackage{tikz} \usepackage{pstricks} \usetikzlibrary{scopes} ...
2
votes
1answer
38 views

How do I plot the asymptotes in this graph?

When i plot the graph of $(x^2+x+1)/(x+1)$, there appears to be a solid vertical line in the plot which happens to be the vertical asymptote, is there a way to make that line dotted and also include ...
2
votes
0answers
25 views

Reading a defined number of line from a file with **addplot**

I'm using addplot to create figures from an external txt file. I want to create different figures, using an increasing number of lines of the data file. Obviously i can create different data files ...
0
votes
0answers
38 views

Error: pgfplots colorbrewer [duplicate]

I am trying to use the new colorbrewer library and get the following error: Error: I do not know the key '/pgfplots/colormap/YlOrBr' and I am going to ignore it. \documentclass{standalone} ...
1
vote
1answer
33 views

How can I choose a column of dat file to plot in pgfplot?

I have dat file (output from Matlab) and it has four columns. How can I choose my desire column to plot in pgfplots. \documentclass{article} \usepackage[active,tightpage]{preview} ...
3
votes
0answers
79 views

Plotting the sum of a function in TikZ

I am trying to plot a function that is the sum of another function based on the parameter. A famous example of this is the "sum of squares", however the functions I really want to do this do not have ...
3
votes
1answer
88 views

Label axis in units of pi (or pi/2) and use minor tick num [duplicate]

Using pgfplots, I often want to label the horizontal axis major ticks in units of pi or pi/2, or pi/3. Is it possible to have such "trigonometric major ticks" use minor tick num = <value> to ...
0
votes
0answers
28 views

How to plot the solution to a non-linear ode?

Im currently completing my dissertation for undergrad maths, and need to plot a graph showing solutions to the ODE: dN/dt=rN(1-(N/N_0)) I would ideally want to plot three or four variations of the ...
2
votes
2answers
86 views

Add “sections” to a staked area chart [duplicate]

Edit: The original question was answered by @James and his solution covers the particular problem presented here. In This question I have exposed the original problem and I have received answer to ...
2
votes
1answer
46 views

Help with Plotting Logscale?

I'm trying to plot the time complexity of some sorting algorithms using a log scale. I'm fetching the data from a text file insertion.dat which contains the following information: x y 0 0 10 0.002 ...
2
votes
0answers
70 views

How to make 3D ribbon plots in PGF/TikZ

I'd like to make a bunch of 3D ribbon plots in TikZ or PGF, I've taken a look around and I've found no hints on how this might be accomplished, is there a simple way to do this? I'd settle for a 3D ...
0
votes
1answer
43 views

scale bar figure - showing scale with citations

I am attempting to make figures similar to this: with latex. I would like for the citations to work in order to match the observed data from where it came. Does anyone know of a good package ...
2
votes
2answers
69 views

How to scale the colorbar to data in pgfplots

Good morning, I have some .txt files that contain 3 columns of data: the first one corresponds to the x-axis value of each point, the second one corresponds to the y-axis value of each point, and the ...
7
votes
2answers
70 views

pgfplots: tick marks on axis with fill between

I am plotting a graph and shading some area beneath it using fill between like in this example: \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} ...
4
votes
1answer
69 views

Barplot orientation -

I am new to creating graphs with Latex. The graph on the right is the original graph, I then decided it would look better if I change color for each classifier type and add the value of the bar on ...
1
vote
1answer
34 views

Automatic position of variable name in axis with pgfplots

I am looking for a code - probably inside {axis}[options] - that automatically puts the variable name (for example, x, and y) at the end of each axis. I am aware of the method to do this manually, ...
1
vote
1answer
37 views

Reading xticklabels from a csv

I need to display the labels in AgentTypesS column in my barchart. This is an excerpt from my .csv file (Yes, it is an uneven file) AgentTypesL, OriginalL, MergedL, DifferenceL, ...
5
votes
1answer
63 views

Drawing solid-circle or dots in legends

I'm trying to create plot with solid circles in the legend. Please see the image below for what I've got so far: I'm unable to get my legend right, ideally I would like to draw solid red circle ...
3
votes
1answer
87 views

How to control where curves are in tikz

I am attempting to draw the following graph in tikz. My attempt so far has gotten me to here. \documentclass[border=3mm]{standalone} \usepackage[dvipsnames]{xcolor} \usepackage{pgfplots} ...
1
vote
2answers
81 views

Two Piecewise functions in a same plot

I am both new to LaTex and to tex.StackExchange. I am currently taking a course in Game Theory and I am using Latex to type my class notes. So far, I have been using this website to solve my doubts ...
1
vote
1answer
67 views

Automatically generate the value table of a mathematical function

Is there an easy way to get the value table of a mathematical function? Consider the following example and pseudo-code: \documentclass{article} \usepackage{pgfplots} \usepackage[nomessages]{fp}% ...
3
votes
1answer
36 views

\textdagger and related symbols give error in point meta=symbolic in pgfplots

When using \textdagger in point meta={symbolic=\textdagger} this gives me an error when compiling ! TeX capacity exceeded, sorry [input stack size=5000]. \curr@fontshape ->\f@encoding ...
3
votes
0answers
38 views

Find product of shifted plot and other plot in pgfplots

In the MWE, I shifted the blue plot to the left. How can I now plot the product of the shifted plot (in cyan), and the blue plot? Here is the code I have thus far: ...
2
votes
1answer
40 views

Specify custom ticks in dateplot

How to correctly specify ticks in date plots? I tried \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.13} \usepgfplotslibrary{dateplot} \begin{document} %\begin{tikzpicture} ...
2
votes
0answers
46 views

stacking histograms in pgfplots

The stacking is not working correctly. This is what I get: This might be a problem of different bins, but even restricting them is not working (slightly related questions about common bins are ...
3
votes
1answer
38 views

pgfplots: loglogaxis dual axis tick transform

I have an image I'm trying to recreate in pgfplots. We have a loglogaxis plot, onto which we would like to add an extra set of axis to show what these values correspond to under a simple ...
0
votes
1answer
40 views

PGFPlots: How to add a legend entry from a macro into a foreach loop?

I'm doing a stacked bar plot where each plot is taken from a different column of the same file, and I have the list of column names I want to use in a macro: \newcommand\tools{tool1, tool2, tool3, ...
5
votes
1answer
149 views

How to modify a mobius strip?

I have modified some mobius code by Jakes to produce another mobius strip. Could you please help to make it more like the second photo below in overall appearance? \documentclass{standalone} ...
2
votes
1answer
37 views

Pgfplots: restrict to domain when using date coordinates

I would like to restrict the domain of the x axis while using date coordinates. However, the following example (modified from pgfplots manual) will not compile since the domain boundaries for the ...
4
votes
2answers
82 views

How to resolve conflict between versions of TeXLive and pgf?

To resolve the problem I described here, I need to use pgfplots version 1.13, which required that I updated to TeX Live 2015. Doing so lead to a problem with the command \heightof as can be seen by ...
0
votes
1answer
31 views

How to unstack grouped bars in pgfplots bar-charts

I am sure this is quite a trivial problem, but I cannot seem to figure it out. I have a bar-chart with preferably three groups of four bars. The thing is, using the MWE below, the four bars per group ...
1
vote
1answer
37 views

Animate several pgfplots with different value

I have come to look on how to draw a student law with Tex and I have been very pleased with the first answer I found here Nevertheless, I found that the animation displayed in the first answer is ...
0
votes
0answers
33 views

Precompile pgfplots

I have a latex document that includes a lot of plots built with pgfplots. As of now, I just include a tikzpicture that loads the plot data from a CSV file. This is starting to take up quite some time ...
1
vote
1answer
33 views

Matlab2tikz breaks major tick weight

matlab2tikz breaks my tick weights on both x-and-y axis. The figure in MATLAB looks like following. After running it through matlab2tikz with all possible known options of ExtraAxisOptions, I ...
3
votes
1answer
89 views

Basic Bar Plot with long text legend, horizontal guides and percentage values

I am new to pgfplots and actually I want to create something pretty basic. Yesterday, I started modifying my chart with the help of the pgfplot manual and the help of Google but unfortunately, I ...
2
votes
1answer
46 views

How to have unconnected points on a plot?

I'm trying to create a graph which has all of the datapoints from an inline table plotted, without a line connecting them, but still having the points on the graph. The issue with the MWE is the line ...
2
votes
1answer
51 views

2x2 Array of PGF Plots

How would I properly layout 4 PGF plots on one page. Currently I have the plots spaced horrifically, and am not sure how to correct the problem. Ideally, I would like all 4 plots on one page, but even ...
2
votes
0answers
59 views

Why the `.tex` file is running indefinitely in PdfLaTeX?

I am using the following code to plot a set of graphs from the experimental data given in book1.txt. This .txt file is also kept in the same folder along with .tex. My book1.txt file is A B ...
2
votes
1answer
54 views

Place multiple external images in a PGFPlots axis from a PGFPlotsTable

I am trying to create an environment in which I can place several georeferenced images into a PGFPlots axis. I have working code that reads in the specified image, reads in the world file (a text ...