{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

3
votes
1answer
63 views

use tike markers outside of plot operation / use math symbols as markers

I ask this question more to have suggestions than to solve a real problem. When I have to plot data I use pgfplots. On the other hand, in order to keep the code smaller, I use tikz in other ...
4
votes
1answer
48 views

Removing blank space in y axis legend in pgfplots package

I am making a French science baccalaureate project and I am using the pgfplots package to create graphs from experimentation datas. The only problem is that there's a little blank space between the y ...
1
vote
1answer
34 views

Pgfplots: Tick coords are being ignored

Working on a bar chart currently and I cannot seem to get the ticks of the y axis to work correctly. More precisely the ytick = \empty (and also ytick = {0,5,10,15,20} ) parameter seems to be ignored. ...
1
vote
0answers
15 views

Pgfplots: Draw angle besides coordinate line and plot [duplicate]

Good day, I want to show in my plot angle between coordinate line and plot like this: Сan anybody help me with it?
3
votes
1answer
54 views

Plot hex numbers in pgfplot

I want to draw a graph from external text file which contains hex numbers (representing integers) like 0x8210 in 4 columns. It seems pgfplot does not automatically recognize the hex numbers. I know ...
2
votes
0answers
35 views

Little problem ploting edge with mesh, pgplots

I'm ploting the function z=1+|x²-y| making \documentclass{article} \usepackage{pgfplots,tikz} \pgfplotsset{compat=1.12} \begin{document} \section{Introduction} \begin{figure}[h!] \centering ...
6
votes
2answers
195 views

How to match color of user-placed labels to contours in pgfplots?

This question is a follow-up to this one about manually placing contour labels in pgfplots contour plots produced with the contour prepared option. Briefly put, the problem I'm faced with now is that ...
5
votes
1answer
101 views

Linear regression - trend line with pgfplots 2

Happy new year. I have fitted a trend line of a population-year data with pgfplots. But I get wrong values of slope m and intercept b. By LibreOffice Calc, I got the values: f(x) = 4,478.87 x – ...
8
votes
1answer
143 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 ...
1
vote
1answer
55 views

Manual control over placement of contour labels in pgfplots?

Sometimes the automatic placement of pgfplots's contour labels is not satisfactory. For example, consider this example from the manual (with minor changes), \documentclass{standalone} ...
3
votes
2answers
61 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
1answer
47 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 ...
1
vote
0answers
90 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 ...
4
votes
2answers
130 views

How to plot multiple 2d filled graphs in 3d with TikZ? [duplicate]

I am trying to plot four 2d plots in a 3d box. I want these plots to be filled with respect to zero. That is, if the line is above zero, I want it to be filled from the line until zero. If the line ...
3
votes
3answers
193 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} ...
4
votes
1answer
98 views

How to add legend to pgfplots “contour prepared” plot?

I want to add a legend to a pgfplots contour plot that is generated using the contour prepared option. The legend should contain the colors of the various levels and show the value associated with a ...
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
34 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
62 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
37 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
3answers
151 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
82 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
87 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
78 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
108 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
157 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
56 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
196 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
107 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
70 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
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 ...
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
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
0answers
48 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
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: ...
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] ...
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} ...
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
129 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} ...