{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

0
votes
0answers
46 views

Intersection of data points from file with plane [duplicate]

I have written a simple code to stack multiple 2-dimensional plots read in from data files, in a 3-dimensional plot for comparison purposes. The minimal working example is the following: ...
4
votes
1answer
84 views

pgfplots: coordinate has been dropped because it is unbounded

After compiling the code I get: coordinate (0Y0.0e0],4Y0.0e0]) has been dropped because it is unbounded (in y). Here the solution was to specify a domain. I did it, hence I do not understand why I get ...
2
votes
1answer
92 views

How to draw a secant of parabol like this picture?

I want to draw this graph I tried with Geogebra \documentclass[12pt]{standalone} \usepackage{fouriernc} \usepackage{pgf,tikz} \usepackage{mathrsfs} \usetikzlibrary{arrows} \pagestyle{empty} ...
3
votes
1answer
179 views

Displaying a pgfplots graph above another pgfplots graph in TikZ

I have two graphical solutions to an inequality (and an algebraic solution to it). One solution is to be displayed on the number line, and the other solution is to be displayed on the Cartesian ...
1
vote
1answer
74 views

Partial polar plot with pgfplots

I want to create a polar plot only of the first quadrant of the circle (angles 0 to 90 degrees), but I can't get the ticks and labels right. Take this sample: \documentclass{standalone} ...
3
votes
1answer
103 views

Periodic coloring of boxed plane partions

I am using the code below, which creates different coloured layers. Having trouble to get a decoration in making it work simultaneously for each layer in the three axes. Kindly some help here. I am ...
1
vote
1answer
75 views

Fill square mark in legend?

I'm using the following code to generate a simple graph, and I want to have the legend show a filled in gray square to represent the shaded area on the graph. Everything still leads to a white square ...
8
votes
2answers
64 views

pgfplots: node near coords missing due to rounding problems

I have the problem that in the following plot the right node near coords text of A is missing. The source of the problem is a rounding error in the data: They should sum up to 100 but in A it is a bit ...
1
vote
1answer
43 views

Some issues with a stacked area plot - pgfplot

I have three issues with a stacked area plot. 1: I want to make the plot more width to fit it in my presentation. But if I scale in x-direction it also scales the fonts (labels). How to avoid that? ...
6
votes
1answer
108 views

Is there a TikZ and PGFplot HTML manual online?

This builds up on the question TikZ manual newest version online?: I know where to find the latest version of the TikZ (or PGFplots, or ...) manual online, in PDF form. But sometime, answering to a ...
1
vote
2answers
47 views

pgfplots: tikzpicture within tikzpicture

I like to use tikz nodes to position plots next to each other. However in the following MWE the axis seem to be shifted to the left. \documentclass{book} \usepackage{pgfplots} \begin{document} ...
1
vote
1answer
39 views

How to parse and print the characters {} with pgf and \thisrow?

I have a data table with "{}" I would like to keep these characters. Results: I would like to uningore this character from parsing to be printed on the image. I know that I could to change: nodes ...
3
votes
1answer
40 views

Set vertical axis limits above/beneath the maximum/minimum resp. value

I would like to have my vertical axis 1.0 above the maximum value and 1.0 beneath the minimum value (implicit). Though that enlarge y limits would do the job, however it does not. I'm not sure how ...
3
votes
0answers
65 views

Error bars with color on pgf plots

I was trying to make my error bars the same color as I have for my data on pgf-plot. The method was greatly explained earlier here - Define error bar color in scatter class My code at the beginning ...
3
votes
1answer
54 views

How can I add degree signs to the numbers on the x axis?

I want to add degree signs to the numbers on the x axis, as shown in this picture. How can I do this? \documentclass[tikz,border=5pt]{standalone} \usepackage{pgfplots} ...
0
votes
0answers
43 views

How can I change axis in my plot?

I have surface plotted with code I copied from sourceforge.net. I want to change the axes labelling from the one given, which does not render correctly when incorporated in a tex document anywat. I ...
7
votes
1answer
148 views

Direction field for dy/dx=-x/y

\documentclass{beamer} \usepackage{tikz,pgfplots} \begin{document} \begin{frame} \def\length{sqrt(1+(-x/y)^2)} \begin{tikzpicture} \begin{axis}[ domain=-3:3, view={0}{90}, ...
3
votes
1answer
64 views

Drawing line of best on semilogy graph and showing it's equation

I have some data which is related by the relationship y = B*exp(Cx) I want to be able to plot the data and determine the value from the relationship: ln(y) = ln(B) + Cx I have raw data values of x ...
1
vote
1answer
71 views

How to change the color of the grid lines and how to change the position of tick lines?

I am building a code to show the area between the two functions below. It's good but it can get better. My questions are: is there a way to move the x tick labels (the numbers on the x axis) a ...
6
votes
1answer
81 views

pgfplots: change order of barplots

When one has more then one barplot in one pgfplots axis like in the following example then the red plot at the top of the code ends up as the bottom bar of the plot. I do find this confusing -- ...
3
votes
1answer
109 views

Plotting issue with PGFPlots `\addplot'

Can someone help with workaroung about such issue? \addplot [only marks, mark=o] table[x index=0,y index=1,col sep=comma] {data.dat}; works just fine, but \addplot [only marks, mark=bullet] ...
3
votes
2answers
62 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
35 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 ...
4
votes
1answer
98 views

pgfplots: More efficient way for declaring piecewise function (sawtooth with rising and falling edge)

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
427 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
65 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
91 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}, ...
5
votes
1answer
151 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
47 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
112 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
71 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
72 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
134 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
57 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
26 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
40 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
70 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
116 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
135 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
32 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
96 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
55 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
92 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
68 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
118 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
135 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
77 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
49 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
57 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
85 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 ...