{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
89 views

How to evaluate the height of a ybar to change color of label accordingly

Problem I want to change the color of a node near coords label depending on the height of the bar it lies on. That is, if the label is outside the bar I want to put a color that is different from the ...
2
votes
2answers
91 views

pgfplots - tikz external - legends are missing

I'm using tikz external to get plots rendered faster. But legends in the plots are missing if external is used. Update: I'm using label to create legend. The same issue does not occur if \legend is ...
2
votes
1answer
139 views

Plot the poisson function correctly [duplicate]

I was try to plot the Poisson distribution as a discrete graph and only found continuous graph examples like this: Poisson distribution with tikzpicture Formula is: &space;0" ...
0
votes
0answers
124 views

pdflatex fatal error because of Bad parameter value, font_mem_size

during plotting graphics with pgfplot I faced the problem of two many data points in one plot so I first tried to avoid it, but later I needed more data points. This question How to expand TeX's ...
1
vote
1answer
36 views

pgfplots line cap fragments

On one specific set of data I get really strange fragments plotted in a 3D axis. The undesired fragments are "star-like" strokes, as can be seen in: A mwe is: \documentclass{standalone} ...
3
votes
1answer
53 views

Fix Overlapping Plots in Pgfplots

I am trying to plot x^2+y^2−z^2=1 and x−2z=0 on the same graph and am able to successfully graph them; however, the result looks horrible and overlaps poorly. How can I fix the overlap and make a ...
1
vote
2answers
61 views

PgfPlots:Improving Dashed Lines [closed]

Edit 3: Now I understand that the real issue is tikz externalize. However, I couldn't produce a MWE. My code is long, somehow when I make it shorter, it doesn't compile (however it compiles once I ...
2
votes
0answers
46 views

pgfplots 3D plots size versus 2D plots size

I wanted to create a 3D plot but it's not possible for me to set the right size. Should I try out until I find the right values for height and width for the 3D plot or is there an easy way to find ...
1
vote
1answer
49 views

surface plot with only z data from file, while x and y coordinates to be calculated

I would like to create a surface plot from a large set of z data in a text file. For the sake of minimum file size and since the z values are located on a regular rectangular mesh, the x and y ...
2
votes
1answer
77 views

Style of axes in TikZ

I have the following two TikZ pictures (see code at bottom). How can I achieve that the style of the axes in the second picture (the function plot) is the same as in the first picture? ...
3
votes
0answers
108 views

Drawing a phase line diagram using TIkz/PGF

I have created a phase line diagram before using these two packages. The code is as follows, \documentclass{amsart} \usepackage{pgfplots} \usepackage{tikz} \newcommand*{\TickSize}{2pt}% ...
4
votes
1answer
102 views

How to graph the following exponential function using Tikz and PGF

I would like to graph the following function, 10000/(9999*e^(-0.125*x)+1) using Tikz and PGFplots but I can not seem to get it to work. I would like labels for the horizontal axis (t) and the vertical ...
1
vote
2answers
65 views

“Package pgfplots Error: Could not read table file” in Beamer

I am trying to plot a Tikz figure on a Beamer slide but receive the following error: ! Package pgfplots Error: Could not read table file '" x y 0.8 0.8 1. 0.8 1. 1. 0.8 1. 0.9 0.8 1. 0.9 0.9 1. 0.8 ...
3
votes
0answers
42 views

Help with plotting Quadratics in pgfplots

I'm practically new to the pgfplots package. I want to plot the quadratic equation 2x²-5x+2 on a set of axes (this is for an A-level text book). I have two questions: Why does plotting x² in the ...
2
votes
0answers
48 views

Translate plot data from file in tikz

I have some x,y coordinate data organised as two columns in my mydata.dat text file. I have no problem plotting this, but I want to plot the same data but just translated by some 2d Vector. My attempt ...
3
votes
1answer
57 views

More visible legend entries for only filled pgfplots bar chart

How can I get more visible legend images next to the textual legend entries A, B, C? The default for only filled bar charts seems to consist only of a hair thin vertical line, which makes it quite ...
20
votes
2answers
447 views

Waterfall chart

I am trying to generate the following figure more automatically based on this example. Currently, the nodes above and below the bars are generated manually, which I like to avoid. I would prefer to ...
2
votes
1answer
33 views

Specify a domain when using date coordinates?

I'm using date coordinates in=x and I would like to use a soft clip, which requires a domain. But something like domain=2015-07-20 05:00 : 2015-07-20 23:59 or domain={2015-07-20 05:00 : ...
3
votes
1answer
29 views

Fillbetween two curves in differents axis environments

I am trying to fill an area between two curves. Easy with \fillbetween, right? Except that the two curves are drawn in two distinct axis, so that the name path is lost between them. To get an idea, ...
1
vote
1answer
42 views

Perspective error in pgfplots surface

I exported a surface plot from MATLAB using matlab2tikz. For some reason, the pgfplot differs from the MATLAB plot in a way that information deeper in the image plane appear above. As images describe ...
6
votes
1answer
91 views

3d PGFPlot with custom mesh and polygon

I am trying to reproduce this figure as closely as possible in PGFPlots (the original was made with a combination of gnuplot and Illustrator): The 3D surface is f(x,y):=x^2 y^2. I am struggling a ...
10
votes
1answer
145 views

Part of function domain omitted using pgfplots

How would I plot the equation x^6+y^5cos(x)=1 and make a graph? I usually use pgfplots, but I am not sure how to work around the equals sign in this equation. When I solve for x and plot the function ...
1
vote
0answers
42 views

From a bar chart with multiple values per ticks to a stacked bar chart

I succeeded to generate a bar chart from a table which provides multiple values per ticks. The code is given in the following code: \documentclass{standalone} \usepackage{pgfplots} ...
2
votes
3answers
49 views

How to remove quotes from data for pgfplots

I have a lot of .csv files that I need to plot. However, the numeric data comes, sometimes, among quotes or just as numbers (without the quotes). For example a,b,c,d "1","4","5","1" "2","3","1","5" ...
2
votes
3answers
89 views

How can I emphasise the vertical asymptotes in this plot?

I'm plotting a function with the following code: \documentclass[]{article} \usepackage{tikz, pgfplots} \begin{document} \newcommand{\F}{(x-5)*(x-4)*(x-2)*(x+1)*(x+2)*(x+4)} ...
8
votes
1answer
91 views

Two plots, change bar plot reference system only

TL;DR How can I make a horizontal bar plot with the origin on the right? I wanted to combine several plots in a unique figure. I have a custom scatter plot, and I want to overlay it on top of a bar ...
5
votes
1answer
45 views

pgfplots issues with fillbetween

With this example document \documentclass[tikz,12pt]{standalone} \usepackage{tikz,pgfplots} \usepackage{pgfplotstable} \usepgfplotslibrary{fillbetween} \pgfplotsset{compat=1.12} \begin{document} ...
4
votes
1answer
62 views

pgfplot plot difference in x axis

I have a bunch of data where the x-axis is in seconds. I want to plot a snippet of this data, which means the starting point is going to be a pretty high number: example of snippet test.csv: X Y ...
3
votes
1answer
62 views

Pgfplots draws majorgrid after/over axis line

It seems like pgfplots draws the grid after the axis lines. Therefore light grey grid lines appear on top of the axis lines. This is what I mean: See the light lines separating the axis lines. I ...
3
votes
2answers
51 views

pgfplots: Line style differs between graph and legend

I have a simple example where the line styles in the diagram don't match the line styles in the key. The latter is correct. Using Texlive 2015 just installed. tlmgr says no updates of pgfplots avail. ...
4
votes
2answers
73 views

Visualize relative positions of graph for composition purposes

I often use the possibility of pgfplots to annotate my graphs by adding nodes on it based on its relative position. For a linear plot that is rather simple, after after a few guesses I find the right ...
6
votes
1answer
83 views

Add Whitespace Around Plot Marks

I have a simple graph in PGFPlots, where the marks of two different plots slightly overlap: Around 50 and 100 the graph gets a bit too busy, so I would like to add some whitespace around the marks, ...
3
votes
1answer
52 views

How do I apply “nodes near coords” to a single bar?

I want to change the position of a single node in a ybar plot. I know I am able to change the position of the nodes for a whole plot (by adding nodes near coords in the \addplot [...]), but in this ...
1
vote
0answers
18 views

pgfplots output shifted figures when plotting customized function

I'm plotting a function using pgfplot. But the output is has some extra white space on the left of the figure. It's really strange. Can someone shed some light on it? Code: \documentclass{article} ...
1
vote
0answers
39 views

Double y-axis in pgfplot for polar plots

Does anyone has a clue about how to "double" y-axis in polar plots using pgfplots? This question is related to this previous one: Polar plot using pgfplots/tikz Until now I only got the top part (as ...
4
votes
1answer
44 views

Multiplot pgfplots code not working properly

I have been trying to obtain this look with my code: So far I have been having a tough time. I put the group style as 3 by 3, but it appears that this may be the issue. Please help me get the ...
3
votes
1answer
38 views

pgfplots Plot moving down page with yrange

With the following: events.dat y mean lower upper 0 7.70234e-08 6.73448e-08 8.67019e-08 0.1 8.49244e-08 7.72264e-08 9.26225e-08 0.2 1.1735e-07 1.02559e-07 1.32141e-07 0.3 3.06841e-07 2.47066e-07 ...
5
votes
3answers
258 views

Plotting the graph for exp(cos(1/x))

I am having issues plotting the function exp(cos(1/x)) in the domain (0,1) with pgfplots and TikZ using a normal addplot command with the function exp(cos(deg(1/x))). It seems LaTeX is having some ...
3
votes
1answer
45 views

Define a systematic method to include pgf plots into jpg photos

I am including images into my LaTeX document and, overlapped to each image, I am adding a PGFplot, showing (a graph with) the environmental conditions when the photo was taken. I have the time-series ...
13
votes
1answer
204 views

Drawing the p,T-diagram with TikZ/pgfplots

I am trying to draw a p,T-diagram with TikZ using pgfplots as shown in the picture. All I have so far is: \documentclass[a4paper, 11pt]{scrartcl} \usepackage{tikz} \usepackage{pgfplots} ...
1
vote
0answers
44 views

pgfplot - keep legends widthin \linewidth when the are set outside

I'm using pgfplots, but i want to have my legends next to the plot. This is easy by setting legend style and anchor. But i also want the plot to be as big as possible. So if my labels are to long, ...
2
votes
1answer
30 views

Labels when using gaps between line and point in pgfplots

this is a follow up question to: Gap between line and point in pgfplots, like pointintervalbox in gnuplot. I would like to add a legend in the plot and maybe even on the y-axis. Unfortunatelly this ...
1
vote
1answer
96 views

Multi-line legend entry in pgfplots

In some of my plots the curve description in the legend is too long, making the legend going over the plot, even if the legend is placed as far away as possible. Therefore I want to have multiple ...
3
votes
1answer
42 views

Pgfplot Legend Type

I need a legend type given below. I want to write parameter values just once. How can i get this type legend. code example \documentclass{article} \usepackage{amsmath} \usepackage{amsfonts} ...
1
vote
0answers
18 views

Insert space after each second bar

I have a bar plot which shows 7 bars for one xtick. I want to group two bars by inserting some space after each second bar. I tried to use xshift in the \addplot command, but the color of the bar ...
3
votes
1answer
75 views

How to add multiple x axes with different scaling?

I am trying to plot the following graph (Standard Atmosphere) with pgfplots: What I currently have is: \documentclass[]{article} \usepackage{pgfplots,amsmath} \begin{document} \begin{tikzpicture} ...
2
votes
1answer
62 views

Same color for mark and label in scatter plot

I would like to obtain a scatter plot with marks and labels of the same color. I can get colored marks but labels stay stubbornly black: I would like 0's to be blue, 1's to be green etc. in the ...
1
vote
0answers
67 views

Multiple PGFPlots in single figure

I'm trying to remake these plots from an article about Nested Containment List by Alekseyenko: I have managed to do one plot: \documentclass{article} \usepackage[english]{babel} ...
3
votes
1answer
71 views

3D surface mesh from external data with pgfplots

I have 5 Lines each with a varies values in y. The line in the middle (z constant = 30), The bottom two lines (left and right) are constant at z=0. The other 2 lines constant at z=15. For a give ...
2
votes
2answers
61 views

pgfplots: annotate each bar in a group with custom values

how can I add custom annotations to each bar in a grouped bar chart? I know how to display the values from the the bars (with every node near...), but the values I need to display, above or below the ...