{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

8
votes
1answer
139 views

Riemann sum graph

What I'm trying to do is plot a function (defined using \newcommand{\f}[1]{expression}) using pgfplots Then draw N+1 lines. Each going from (axis cs: x,0) to (axis cs: x,f(x)), where x is in ...
5
votes
2answers
2k views

Remove tick marks on only one axis in pgfplots

How do you remove the tick marks on only one axis in pgfplots? In my MWE, you'll notice slightly darker part to the y grid lines where the ticks are. I'd rather just have the grid lines, with no ...
1
vote
1answer
46 views

multi line math in pgfplots labels

Quick and maybe easy question, did some research on my own but didn't lead anywhere... Is there a way to use a split or multline environment inside a pgfplot label? Maybe ditching the label altogether ...
3
votes
2answers
57 views

How to align annotations with axis labels in pgfplots?

I would like to annotate plots produced with pgfplots in such a way that: The baseline of the annotation is aligned with the baseline of the x-axis label. The left margin of the annotation is ...
1
vote
0answers
85 views

pgfplot or matplotlib? [closed]

The reason I ask this is because I was trying to draw multiple lines in pgfplots (I was trying to make a drawing showing how Riemann sums and integrals are connected). And after unsuccessfully trying ...
26
votes
4answers
4k views

Differential Equation direction plot with pgfplots

In earlier thread Jake provided some code whom successfully draws the following differential equations in the range [0; 1] dy/dx=2*x dy/dx=x*sqrt(x) See: How to draw slope fields with all the ...
3
votes
3answers
184 views

Tikz: Drawing tangent to S-shaped (logistic) function

I want to make a similar graph as given below but without x-axis labels. This is what I got with the code given below: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.8} ...
7
votes
1answer
126 views

Reduce distance between ticklabels in pgfplots barplot

I have problem with my code in Tikz. I need smaller spaces bettwen names at line x. \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[czech]{babel} \usepackage{listings} ...
2
votes
1answer
168 views

biblatex and pgfplots

I'm using pgfplots to plot some graph of data I stored in a file (a lot of data points). If I charge the bibtex package, I obtains the following error: TeX capacity exceeded, sorry [main memory ...
2
votes
1answer
230 views

Pgfplots and round-off error

I have a graph that must show the oscillations in energy of a numerical scheme. The problem is that the energy is something like this: -9.99999994950000e-01 and I have oscillations after 8 digits. ...
2
votes
1answer
1k views

pgfplots: how to fix axis length?

I used ymin=0 and ymax=1000 to give axis the length I want. The problem is that if I have some "crazy" data that escape (I have to plot stable solution vs. unstable solution of my algorithm), pgfplots ...
1
vote
0answers
48 views

Adding vspace between x-axis label and legend generated with legend to name feature [closed]

I recently started working with pgfplots and now I am trying to generate two horizontally aligned plots using the same data. So I wanted to use one single, centered legend for both plots. It is all ...
3
votes
1answer
103 views

How to label areas in pgfplots fillbetween library

Is there any simple way put a label say $A$ roughly at the "center" of an area created by the pgfplots fillbetween library? Take for example the following example: \documentclass[tikz]{standalone} ...
1
vote
0answers
33 views

Problem with contour in pgfplots (error)

I'm trying make the same that in pgfplots contour example error The difference is I have gnuplot installed. But appears error: ! Package pgfplots Error: sorry, plot file{avanzado_contourtmp0.table} ...
5
votes
1answer
152 views

colour each x co-ordinate with a different colour in a bar plot in pgfplot

I want to cycle colours for each x co-ordinate in a bar plot. Is it possible? For instance, in this example I want each metric to appear in a different colour. This question Colors and legend in ...
5
votes
1answer
81 views

Plotting data seems “noisy”

I am trying to plot some experimental data. When I plot the data using tikzpicture/pgfplots, the data seems "noisy". It becomes less "noisy" when I use the keyword each nth point={n}, where I ...
0
votes
0answers
47 views

IEEE conference template has shows undefined control sequence?

\begin{equation} EST(n_{i},p_{j}) = \max\{T_{Available(p_j)},\max_{n_m\in \pred(n_i)}\{AFT(n_{m})+c_{m,j}\}\} \end{equation} while i write a equation in IEEE conference template it shows an error: ...
1
vote
0answers
35 views

CMYK Shading with relative coordinates

I am trying to in a way automate the shading issue described here: Drawing a box with shading in pgfplots The general goal is to put a working code part in my style definition using append after ...
1
vote
0answers
36 views

How to reuse a pgfplots table?

I am creating multiple plots from a single input: \addplot+[discard if not={condition}{T}] table[meta index = {1}, y index = {2}, x index = {3}, col sep=comma] {data.csv}; \addplot+[discard if ...
2
votes
1answer
143 views

How enlarge the two parts of data

Below shows the graph and code. The red circle show two portion of data. Since the upper red circle has data values >1500, therefore the lower red circle(0-500) shows all lines cramped together. Is it ...
3
votes
0answers
69 views

Parametric irrational system of equations with pgfplots

I thought of parametric form to the following system of equations, but it was difficult for me. Please help me to declare it in a parametric function drawn in pgfplots.
1
vote
1answer
30 views

Using the tikzexternal.sty package together with legend to name feature

I am using the following TeX code (minimal example), which compiles fine, when running pdflatex then run make -f filename.makefile and repeat the procedure a second time to also include the referenced ...
0
votes
0answers
40 views

Easy way to draw a square lattice? [duplicate]

Basically how do I draw a plain square lattice an easy way without specifying where every node and edge is located with no coordinate axis?
6
votes
2answers
227 views

how to obtain exactly same size standalone pgfplots

I am using standalone to make pdfs of my pgfplots to later include as an image into my main document. The y-axis are different for some of the plots (some negative, some positive), thus the size of ...
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 ...
3
votes
1answer
85 views

Contour plot error with pgfplot and tikz

I'm trying to plot contour lines of a two variable function. I found this example here: \begin{tikzpicture} \begin{axis}[view={0}{90}] \addplot3[contour gnuplot={ labels over line,number=9}] ...
4
votes
1answer
77 views

Custom highliting of lines in pgfplot

I have the following pgfplot TeX code: \begin{tikzpicture} \begin{axis}[ xtick={ 5, 10 }, xticklabels={ ...
4
votes
4answers
194 views

With which package will I create, in the shortest code, two points with horizontal error bars with overlap region dashed?

Pgfplots? Metapost? Tikz? As I can't make it right now with any of them, I have to choose one of them to study. Which of them? Which has shortest code? Which has best image quality? I don't mind ...
3
votes
0answers
43 views

How can I draw the capacitor smoothing effect? [duplicate]

I want to draw a rectified signal with (blue) and without a capacitor (black). This is what I'm getting This is what I want Code: \begin{figure}[H] \begin{tikzpicture} \draw (0,0) -- ...
18
votes
1answer
313 views

Enlarge limits to nearest tick

I'm using pgfplots to auto-plot a number of datasets. The x-axis is in this case not to be enlarged. I'm using enlarge y limits, to get a clearer view of the data, but I would like it to scale to the ...
2
votes
1answer
105 views

Axis break in pgfplots - same scaling for the two plots

I've found the answer to my question here. Nevertheless I have a related question. The MWE can be exactly the answer to the linked question, so I insert here just the "interested part" (if I have to ...
2
votes
0answers
38 views

Polaraxis with error bars in pgfplots

Im trying to plot some values with error bars in polar coordinates. Here is my MWE \begin{tikzpicture} \begin{polaraxis} \addplot+[only marks,mark size=1.5pt,error bars/.cd,y dir=both,y ...
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 ...
5
votes
1answer
62 views

Split subfigures from pgfplots groupstyle

in my code below, I would like to know what is the best approach to split the figures in the groupplot? I wanted to have figs (a) and (b) on page 1 just under the text, and the rest of the figures on ...
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
0answers
55 views

Tikz/PGFPlots produce different graphs when compiled on my desktop and ShareLaTeX [closed]

I am experiencing a weird Tikz/PGFPlots issue. For some reason, the y-coordinate of nodes is being places relative to the bottom of the tikzpicture instead of the origin. The weird part is that it ...
5
votes
1answer
52 views

Add a decade plot to a graph in pgfplot

I would like to add a -30dB/decade plot (like that shown in the dashed line): to my plot from ~x = 2000, to x = 10000. How can I go about doing this? Thanks! Here is my code for the original ...
5
votes
2answers
66 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
53 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
29 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
177 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
39 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
156 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 ...