Questions tagged [pgfplots]
{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.
10,136 questions
0
votes
1
answer
28
views
My y-axis shows numbers like 1, but I want it to display 1.00 (two decimal places) [duplicate]
\documentclass[a4paper, 12pt, floatsintext]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{polski}
\usepackage{float}
\usepackage{caption}
\usepackage{tikz}
\usepackage{...
8
votes
3
answers
638
views
Graphing the function y=x^2sin(1/x)
Consider the following MWE:
\documentclass{article}
\usepackage{amsmath}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
\begin{...
1
vote
0
answers
39
views
Read and plot dates from .csv using pgfplots
I have been trying for hours (with the help of ChatGPT) to read and plot a basic data series from a .csv using pgf plots.
My csv file looks like this:
Date,Total
1978-02,61.24904688
1978-03,60.9695051
...
0
votes
0
answers
35
views
PGFPlots filled polygons with colormap
I want to plot a bunch of polygons and fill each of them with color from colormap. I am trying the following unsuccessfully:
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=...
3
votes
2
answers
91
views
Single point in a figure on beamer
I'm trying to build a figure on beamer that has a single point on it. I've tried what I'd usually have done in other settings (article, book), but I'm still getting an error. In particular, I get
! ...
3
votes
3
answers
146
views
Thicker axis in PGFplot
Is there a better method to have the x=0 and y=0 axes thicker? I made a basic approach by adding lines, but is there a better method?
\documentclass{book}
\usepackage{pgfplots}
\pgfplotsset{compat=1....
6
votes
1
answer
166
views
Inaccurate TikZ/PGF plot
I'm using the following code to produce a plot:
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
width = 15cm,
...
7
votes
3
answers
256
views
help with 3D Surface plot TikZ
Can someone please help with coding the surface plot for
$\sqrt{(x - 1)^2 + y^2} + \sqrt{(x + 1)^2 + y^2} - 4 = -|z|$
in TikZ for my article in LateX? I have been trying, but can't seem to manage it. ...
6
votes
1
answer
117
views
Error linked to active characters?
This MWE gives an error that disappears if line #3 or line #4 are commented. I would say that this has probably something to do with active characters, but I am not able to understand what goes wrong ...
6
votes
3
answers
146
views
\tikzmath defined functions sometimes won't parse in \addplot, producing spurious errors
This is my first post so the graph may not appear and/or the format may look weird. Apologies if that is so.
The graph is produced when the line \addplot[red, thick] {myexp(x,4)}; is commented out
...
3
votes
1
answer
73
views
Why does PGFPlots separate the axes of my log-log graph?
I'm trying to make a log-log graph. Semi-log graphs and linear graphs work just fine, but for some reason when I try to make a log-log graph PGFPlots doesn't draw the horiziontal axis or the curve.
...
3
votes
1
answer
92
views
Aligning arrows along a path at fixed steps on a rectangular grid
The objective is to have arrows along a path for every 1-unit step we take horizontally or vertically. The arrows would be aligned midway between major grid tick marks, e.g. midway along (0,0)--(0,1). ...
3
votes
0
answers
46
views
Plotting quasi-3D figure with axial filled planes
I want to make a quasi-3D figure from three variables. They pair-wise form a two-dimensional figure. I want to emphasize that the green plot is in the green plane, etc.
I have two issues
1./ The red ...
5
votes
3
answers
209
views
Plot any real sequence of real variables as in Geogebra and Desmos
Several years ago, I created a GeoGebra script to plot any real sequence of real variables. As you can see from the screenshot, there is a command on the left:
Sequence({(n, 1/n)}, n, 1, M)
which ...
13
votes
5
answers
349
views
Iterated plot with TikZ, PGFPlots and foreach loop
I'm trying to plot an illustration of the fixed point method in which a function is evaluated repeatedly in a loop. The result should be a staircase or spiral plot on top of the plot of the function ...