{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

5
votes
2answers
69 views

How to skip ticks in pgfplots

I have monthly data, and I want to show ticks for, say, each quarter. Thus, instead of showing 12 ticks per year, I want to show 4. There is a very similar post here, but the solution is to write the ...
5
votes
0answers
47 views

Shaded area under pgfplot, starting with first data point, outputs wrong shaded area

This post is building of the question posted here. When I try to get the area under the curve to show up between 100 and 3000 by using the soft clip={domain=100:3000} command, I get this plot: I ...
2
votes
1answer
24 views

axis ticklabel does not load properly in pgfplot

I have two data series (actual data and a forecast) connecting in one point. Yet, the labels only load for the first series. I need to show all dates. Here is a MWE: \documentclass[12pt]{article} ...
5
votes
2answers
54 views

pgfplots: dynamic path names in a foreach loop

I'm trying to generate a couple of intersecting peaks with pgfplots with dashed/dotted paths where they overlap. I'm having some trouble though with path names inside a foreach loop. Here's the code: ...
2
votes
1answer
30 views

add extra tick labels pgfplot

This post is building off the color area under plot in pgfplots. I was trying to add extra tick labels at 1000 and 3000 (based of the area under the curve). I am only getting the last number showing ...
5
votes
1answer
181 views

How to achieve equal colors for a marker's filling and edge?

Consider the following example from the pgfplots manual p. 164: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[tiny] ...
10
votes
1answer
107 views

color area under plot in pgfplots

I am trying to color the area under a plot between x = 500 to x = 1000. I am not sure how to get the colored area to show up just under the curve within those limits. Can you help me color the area ...
2
votes
1answer
40 views

pgfplot - groupplot print x label only once in the last row

In the below group plot, the xvalues are common for all the subplots. I want the x labels to be displayed only on the last row of the group plots. \documentclass{article} \usepackage{tikz} ...
0
votes
2answers
91 views

How to draw a region of inequality

Could you help me draw a region of this inequality: \begin{eqnarray} 3x_1 + 3x_2 \geq 27 x_1 + 2x_2 \geq 18 4x_1 + 2x_2 \geq 28 \end{eqnarray} I need two graphs: one with three inequalities marked ...
2
votes
0answers
33 views

How do I set /pgfplots/trig format?

I am trying out pgfplots: \documentclass[]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[xmin=0,xmax=2,ymin=0,ymax=1.25, samples=50, /pgfplots/trig format=rad] ...
2
votes
1answer
34 views

Remove marker from legend in pgfplot

In my code below, there is a marker in the legend. I just have two plots without any markers. How to remove these markers and just have the line be shown in the legend entry? Here is my code: ...
6
votes
1answer
158 views

Add break node to plot in pgfplots

I was able to 'break' the vertical axis using pgfplots, but some issues came along with it: Most importantly, I can't find how to add the 'break sign' (the two parallel lines) to my plot as well, ...
6
votes
2answers
81 views

Error in pgfplot when big offset is subtracted

I have some data with a huge offset that I want to plot. Im using PGF plots, where it's possible to subtract the offset from a whole row in my data. This works when the offset isn't too big, and/or ...
4
votes
1answer
49 views

Cannot import data from csv file with pgfplots

I need to import some data from a csv file, but I get Package pgfplots Error: Table 'Data1.csv' appears to have too many columns in. Other posts related to this are not helpful. My code is here: ...
2
votes
1answer
24 views

Plotting function ontop of scatter plot in pgf

I have the following code \documentclass[danish,a4paper,12pt]{article} \usepackage{tikz,pgf} \usepackage{pgfplots} \begin{document} \begin{figure}[!h] \begin{tikzpicture} \begin{axis}[ ...
4
votes
2answers
98 views

Drawing constant graphs

I need some help with drawing constant functions. What I want is to draw a graph of the function f(x) = C, between in the interval [a,b] where C is some arbitrary constant in the real numbers. I ...
2
votes
1answer
142 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
61 views

How can I complete my Histogram?

I am trying to make Histogram, so far I have reached at following code would you please help me, where is the problem and how can I complete this task? Here is the MWE. ...
4
votes
2answers
199 views

Tikz picture, rotate x tick labels

I have following code: \documentclass{article} \usepackage{tikz,amsmath} \usepackage{subfig} \usepackage{pgfplots} \begin{document} \begin{figure}[!t] \centering \subfloat[A ...
4
votes
1answer
36 views

Duplicate values on the x-axis

I'm having problems with this simple bar-chart graph in LaTeX. Why are the years on the x-axis duplicated for values 2017 and 2018? How can I have only 3 bars on the x-axis? \documentclass{book} ...
4
votes
1answer
414 views

PGFPlot two \pgfplotstableregressiona

Hi i have two plot with two linear regression but the legend show the same equation for the straight line... I haven't made a MWE because I thought it isn't needed---Is it? \pgfplotstableread{ X Y 97 ...
0
votes
0answers
125 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 ...
3
votes
0answers
61 views

Change cubes in 3d plot pgfplot to bars

I am plotting a 3d diagram using cubes to represent the data. Works fine so far. Basically, this is what I started with: http://pgfplots.net/tikz/examples/scatter-cube-plot/ Now what I want to do, ...
1
vote
2answers
62 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 ...
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 ...
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 ...
2
votes
2answers
521 views

Y-tick labels on the right side, y-axis label on the left

Is there a way to only move the y-tick labels to the right? The option yticklabel pos=right automatically moves the axis-label, too. Here a MWE of how the axis-label is also moved: ...
2
votes
0answers
47 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
50 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
111 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}% ...
8
votes
1answer
92 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 ...
4
votes
1answer
103 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 ...
2
votes
2answers
70 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 ...
6
votes
1answer
94 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 ...
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 : ...
1
vote
1answer
43 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 ...
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 ...
3
votes
1answer
62 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 ...
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 ...
10
votes
2answers
430 views

Gap between line and point in pgfplots, like pointintervalbox in gnuplot

I wondered if it is possible to create a scatter plot in pgfplots with a similar style as the "pointintervalbox" option in gnuplot, i.e. a plot with points and lines, but there is a gap between the ...
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, ...
2
votes
0answers
49 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
30 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
0answers
43 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" ...
1
vote
1answer
185 views

Pgfplots: set plot margins

Is there a possibility in pgfplots to set the margins reserved for the x- and y-label, similarly to gnuplots tmargin, bmargin, lmargin, rmargin. I would like to have following values for the ...
6
votes
2answers
294 views

Polar plot using pgfplots/tikz

I would like to reproduce the figure below using pgfplots/tikz packages on Latex. I am sharing with you a .csv file to plot a similar figure. It is important to notice that y-axis are outside the plot ...
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)} ...