{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

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 ...
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} ...
9
votes
2answers
166 views

How can I use the \input command in pgfplots?

I have to create a set of groupplots with pgfplots and want to use one centralized definition of the plot style (width, height, x-axis label, etc.). It seemed to me that this should be easily done by ...
6
votes
3answers
88 views

Pgfplot coordinates in another pgfplot

How can I transform coordinates from the first axis plot to the second axis plot with a different scale? One way is to repeat all function calls. But if I've got a random function how can I get the ...
3
votes
1answer
57 views

Legend problem with horizontal bars in pgfplots

I have a problem with a weird offset with horizontal bars in a pgfplots legend. They seem to be moved "up" a bit, so a part of them is hidden under overflow. An image of the situation which explains ...
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
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 ...
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 ...
3
votes
2answers
136 views

Picking the fill color based on a value (some kind of heatmap)

I have a predefined set of coordinates, \where, and a corresponding value, \value. Each coordinate covers an rectangle. I like to choose the color of the fill=...option based on the value. The result ...
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
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?
3
votes
1answer
75 views

All but one ticklabel are showing up in polar plot

I have a problem using custom xticklabels in my polar plot. I need the exact xtick sequence specified by xticklabels but no matter what I do, the first label for 120° is not displayed. ...
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={ ...
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) -- ...
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 ...
3
votes
1answer
105 views

pgfplots: Externalize file name - use figure reference (e. g. Figure 2)

Introduction I have a document with many pgfplots diagrams embedded in figures. I want to generate a separate file for every diagram by using the externalize feature. Is it possible to name the ...
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.
5
votes
1answer
151 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 ...
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 ...
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 ...
2
votes
1answer
104 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 ...
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
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
1answer
60 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 ...
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} ...
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
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 ...
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: ...
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] ...
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} ...
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] ...
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 ...
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
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: ...
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 ...
4
votes
1answer
48 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}[ ...
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
2answers
97 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 ...
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
181 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
33 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} ...
3
votes
0answers
58 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, ...
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
137 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
52 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 ...