Skip to main content

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
22 views

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=...
John's user avatar
  • 548
3 votes
2 answers
90 views

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 ! ...
Patricio's user avatar
  • 623
3 votes
3 answers
144 views

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....
mf67's user avatar
  • 878
6 votes
1 answer
166 views

I'm using the following code to produce a plot: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ width = 15cm, ...
Dominique's user avatar
  • 1,593
7 votes
3 answers
254 views

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. ...
Mark Roelands's user avatar
6 votes
1 answer
114 views

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 ...
Bibi's user avatar
  • 1,650
6 votes
3 answers
136 views

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 ...
Francis Cook's user avatar
3 votes
1 answer
73 views

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. ...
Rain's user avatar
  • 226
3 votes
1 answer
92 views

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). ...
PatrickT's user avatar
  • 3,503
3 votes
0 answers
45 views

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 ...
katang's user avatar
  • 1,595
5 votes
3 answers
208 views

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 ...
Sebastiano's user avatar
  • 67.1k
13 votes
5 answers
344 views

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 ...
Dominique's user avatar
  • 1,593
3 votes
2 answers
111 views

I'm trying to draw 10 functions of ten different colors (actually starting from red and ending with yellow) inside a tikzpicture environment. Problem is that the code reads only the first color (red) ...
Liam Seddio's user avatar
4 votes
2 answers
157 views

As I was intent on moving function declarations further up, so as to use them in multiple files, I noticed something unexpected. The first code plots a thin black line. The second code plots thick ...
PatrickT's user avatar
  • 3,503
3 votes
1 answer
97 views

The objective is to draw arrows that show convergence to a particular coordinate. The code below has served me well in simple cases. But attempting to use coordinates calculated with the intersections ...
PatrickT's user avatar
  • 3,503
5 votes
1 answer
138 views

Using tikz and PGFPlots, I am creating a patch plot from data table with the line patch type. I would like to decorate the end of each line with an arrow. What is the best way to do this? Below is a ...
trumpeter201's user avatar
3 votes
1 answer
59 views

%%% featues %%% % violinplot % CAVEAT: run it as `latexmk -pdf -shell-escape -interaction=nonstopmode -g main.tex` %%% picture %%% % https://tex.stackexchange.com/a/679168/222785 \documentclass{...
Rubem Pacelli's user avatar
2 votes
2 answers
86 views

I would like to create a graphic that does what this file is doing,but without going through each individual line \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{...
username's user avatar
  • 143
4 votes
2 answers
159 views

I am trying to make a pgf plot so that when printed, the units are exactly 1 cm, i.e, the grid lines should be 1 cm apart. However, whatever I do, I cannot make it work and I really don't know why. ...
klirk's user avatar
  • 497
7 votes
1 answer
93 views

I am trying to plot multiple curves, of which some are trigonometric, on the same plot. However, the ylabel appears to be slanted every time I use trig format=rad in my code. If I remove this, ...
Scholar's user avatar
  • 465
0 votes
0 answers
76 views

I am trying to create a surf plot with an additional point cloud on top. The data for both is saved in two different tables, which are then read and plottet into the same axis environment. Currently I ...
Peter1509's user avatar
3 votes
3 answers
119 views

I have the plot of several functions on a single axis, and I would like to add extra y ticks on the right of the plot to show the different numbers to which these functions converge to. However, I can'...
Tristan Nemoz's user avatar
8 votes
2 answers
262 views

Here the curve is drawn with a single color (red) It's easy to get the solution curve. The below figure is drawn in this app for y'=x^2+y^2-1, y(0)=1/2. As you can notice the color of the curve is ...
Black Mild's user avatar
  • 19.7k
4 votes
1 answer
127 views

Need to add tick labels on the outside boundaries of the plot like on the pic below. Without axes explicitly displayed it works by default but after I add axes the labels are displayed inside the plot ...
Vladimir Tsitrin's user avatar
5 votes
2 answers
188 views

I get this error when I try compile the function below ! Package PGF Math Error: Sorry, an internal routine of the floating point unit got an ill-formatted floating point number `1Y6.9305e-1]'. The ...
joseline's user avatar
  • 225
5 votes
1 answer
91 views

I would like to make a very minimalist bar plot, with different color bar for each country and their respective flag (worldflag if possible) instead of name. I have tried a few different things, but ...
G. Bay's user avatar
  • 2,367
13 votes
4 answers
656 views

I am interested in a generic technique to visualize functions in a quality appropriate for journal articles. Consider the function $$-\sqrt{\lvert x-\tan y \rvert}$$ over $[0,1]^2$. Tools like ...
arctiq's user avatar
  • 141
5 votes
3 answers
245 views

I would like to create the following coordinate system with TikZ. German school books seem to deviate from (international?) conventions here; in any case, the axes need to be swapped, among other ...
Bigga's user avatar
  • 173
11 votes
2 answers
927 views

I am trying to plot a Student's t distribution without using gnuplot. Here is what I have been trying: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \...
lane-h-rogers's user avatar
2 votes
1 answer
69 views

I am trying to compile a document using pgfplots and gnuplot. The relevant code block that I am trying to compile is: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \begin{...
lane-h-rogers's user avatar
-1 votes
1 answer
127 views

how can I generate a math-text using gradient coloring, like this?
Angelo Aliano Filho's user avatar
3 votes
1 answer
87 views

I am trying to export a small TikZ/PGFPlots figure as a PNG using the standalone class with the convert option. My goal is to make the overall figure smaller (so that both the plot and the font size ...
RiverSage's user avatar
3 votes
1 answer
115 views

Setup I'm following the answer about parameterized curves in a sphere from https://tex.stackexchange.com/a/199715/7561. I'm inserting these spheres in a bigger diagram and noticed the extra space ...
adn's user avatar
  • 11.7k
4 votes
3 answers
231 views

I have a set of values that I am plotting with the dateplot library of pgfplots. But I also need to indicate the desired range within which those values ideally should lie in. How can we highlight ...
J...S's user avatar
  • 519
6 votes
2 answers
194 views

The plot is shifted to the right -- it should be centered. Any ideas why? I assume it comes from my coordinate transformation, since I plot nothing, the coordinate system is centered. \documentclass{...
Matthias's user avatar
  • 388
-1 votes
2 answers
97 views

I am trying to add a black circle to the next picture at (-1,0), to indicate that the graph starts there. I tried using \filldraw[black] (-1,0) circle (2pt) but it did not work. Also, how can I add a ...
Twink's user avatar
  • 239
2 votes
2 answers
104 views

I am starting to work with pgfplots and I'm struggling to get my axes right. I know that choosing the two angles in the view={}{} option of the axis environment can change the setup of your axes. ...
noparadise's user avatar
10 votes
1 answer
368 views

I absolutely love tikz and pgfplots, and I am really thankful for what their authors have built. I regularly am surprised and in awe by what people can accomplish in them. Also, both of them have ...
Paul Paulsen's user avatar
0 votes
1 answer
81 views

I want to plot a heat map of our earth (it's actually SNR of HF-Propagation). This works fine, however, if enable the colorbar in my axis definition I run into this issue: ! Undefined control sequence....
Matthias's user avatar
  • 388
4 votes
1 answer
144 views

Tonight, I discovered that pgfplots can generate automatic vortices (gradient), i.e., level curves, using the contour lua= option when compiling with LuaLaTeX. I made some modifications to the code ...
Sebastiano's user avatar
  • 67.1k
4 votes
1 answer
114 views

I noticed an issue with the placement of axis labels in PGFPlots when all of the following conditions are met: tick align=center or tick align=outside is used (not with tick align=inside), there is ...
B Legrand's user avatar
  • 653
4 votes
1 answer
75 views

I am trying to make a scatter (in a group plot) with data taken from a reference csv file. The x values are in the column PC1, y values are in the column PC2. I wanted the mark / shape to change ...
Miloop's user avatar
  • 1,377
2 votes
3 answers
187 views

I would like to achieve font consistency between graphics created using the standalone class and those rendered directly in Beamer using the metropolis or moloch themes. I'm creating plots with ...
Natal Pires's user avatar
6 votes
1 answer
190 views

I am trying to draw a vector field in pgfplots, but I am encountering issues that I can't solve despite various attempts. Specifically, I want the vortices or spirals to be dependent by the vector ...
Sebastiano's user avatar
  • 67.1k
1 vote
1 answer
104 views

I want to put the image in place of the logo and the name of the university that is in poster \documentclass[20pt,margin=1in,innermargin=-4.5in,blockverticalspace=-0.25in]{tikzposter} \geometry{...
bakhta marouf's user avatar
4 votes
2 answers
158 views

I'm drawing polar plots covering only half of the full 360° (the right half of the circle) using pgfplots, and I can't figure out how to shift yticklabels to the top part of the plot (+90° in the plot ...
pawq's user avatar
  • 43
1 vote
2 answers
77 views

I need to add equations to some parts of the curves: I'm using the chemmacros package. I'm having trouble because the size of the chemical formulas seems too large compared to the curves: I therefore ...
Nicolas's user avatar
  • 3,043
6 votes
3 answers
340 views

I’m not sure if this is the best approach, but I’ve been trying to create a curly brace using an explicit mathematical function. So far, I’ve combined a couple of curves to approximate the shape, but ...
Jasper's user avatar
  • 10.9k
1 vote
1 answer
76 views

I'm trying to combine patches and individual marker symbols in a ternary diagram, but not able to display the markers in the legend. The following is my attempt with two different ways of adding ...
Buck Thorn's user avatar
0 votes
0 answers
61 views

I want to position my y-labels such that the plot doesn't cover up the label. This is the code that I used: \begin{tikzpicture}[>=latex] \begin{axis}[ axis x line=center, axis y line=center,...
Manya Chauhan's user avatar

1
2 3 4 5
203