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
1 vote
1 answer
44 views

Beamer theme Metropolis changes TikZ draw

I am having trouble adding a TikZ graphic to my Beamer presentation which uses the theme Metropolis. Here is an example of the issue: \documentclass{beamer} \usepackage[utf8]{inputenc} \usepackage{...
user avatar
0 votes
0 answers
14 views

Trouble with clip and labels in pgfplot

I would like to add zero to the origin of the axes. I tried with clip = false and \node[anchor=east] (zero) at (axis cs:0,0) {0}; but with disastrous results. This is my graph: \documentclass[tikz]{...
user avatar
1 vote
0 answers
15 views

splot not plotting the graph correctly

This equation has to plot the point $(0,0)$ since when $x= 0, y=0$. But however I arrange the equation,it does not plot the point $(0,0)$. Can someone help me with this problem. \pdfpagewidth 85mm ...
user avatar
0 votes
2 answers
22 views

Delete vertical and horizontal lines in both axis (tikzpicture)

I have the following figure: And I would like to be able to remove all the stripes or lines on the axes, which I enclose in black. This is my code, I would appreciate your help. \documentclass{...
user avatar
  • 196
0 votes
0 answers
106 views

How to draw equations (not funtions) in LaTeX

I want to draw this equation in LaTeX using tikz (maybe with pgfplots): (x^2+y^2) + \frac{0.7}{\sqrt((x-0.3)^2+y^2)} + \frac{0.3}{\sqrt((x+0.7)^2+y^2)} = 2.5 This is from geogebra: I tried gnuplot: \...
user avatar
0 votes
0 answers
12 views

pgfplots: Legend for markers choosen by point meta in a scatter plot

What I made I am using point meta to colour the points of a scatterplot according to a label, as shown by the MWE and the screenshot below. I am however struggling to make a legend mapping the colour ...
user avatar
2 votes
2 answers
35 views

pgfplots — Align two separate plots by x-axes and align captions

Here's a concrete example that illustrates the problem \documentclass{article} \usepackage{pgfplots} \usepackage{float} \begin{document} \begin{figure}[H] \pgfplotsset{disabledatascaling} \begin{...
user avatar
  • 2,793
0 votes
0 answers
40 views

Geospatial chart with pgfplots and tikz

Is there a way to do something like this: by using pgfplots and tikz ? Thank you V.
user avatar
  • 1
2 votes
0 answers
42 views

matlab2tikz: bunch of error messages in tex when adding the jet colormap to a surfplot

I created a surf plot in matlab which is also correctly depicted in the figure. f3 = figure(3); p3 = surf(X,Y,Z); hold on; p3.LineStyle = 'none'; colorbar; %change the color map colormap(f3, jet(256))...
user avatar
  • 77
5 votes
3 answers
901 views

Plotting x^(x-1)

I would like to graph the function x^(x-1) but I keep running into errors. Instead of a xy plane, it just graphs the x axis. Here is the general set up. \documentclass{standalone} \usepackage{...
user avatar
0 votes
2 answers
30 views

Handling with customlegend style

How can I do so the size of the customlegend box adapts to its content? \documentclass[12pt]{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.16} \usepgfplotslibrary{...
user avatar
2 votes
2 answers
113 views

Uncover points of scatterplot

have a a plot that is similar to this (almost) minimal example here: \documentclass{beamer} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{frame} \begin{tikzpicture} ...
user avatar
  • 67
1 vote
0 answers
27 views

Why setting point meta destroys the data in contour lua?

Problem I'm trying to change the color of a contour plot (contour lua) by setting point meta. However, instead of using the information from the plot, I want to use another function to color them. ...
user avatar
  • 10.8k
2 votes
1 answer
60 views

How to extend logarithmic pgfplots to values below 1?

This is a follow up to another question. I basically want to extend x-axis to log values below 1. This works great for the x-axis (xmin=1e-3, xmax=1e7) itself, but when I try to extend the colored BB ...
user avatar
2 votes
1 answer
49 views

pgfplots legend marker scale

The legend of my scatter plot is not picking up the sizes of the markers that I'm using. I'm being extreme here so that the difference is obvious. I'm hoping to understand how to get the sizes to be ...
user avatar
  • 652
1 vote
1 answer
28 views

Arbitrarily change axis properties in pgfplots within a foreach loop

I have a bunch of plots which I want to insert as subfigures within a larger figure. Because they share the same y-axes, I don't want to waste space repeating the same axis and tick labels for each ...
user avatar
0 votes
1 answer
50 views

Tikz Grid goes beyond graph

The Grid goes beyond the graph, as you can see in the screenshot below. What do i have to change, to make the grid align with the graph? It should only be inside the coordinate system. \usepackage{tkz-...
user avatar
1 vote
1 answer
21 views

Setting pgfplots line opacity based on column name

I want to create a plot that has multiple lines. Each line corresponds to some measurements taken over space at a given moment in time, though these time points are not (necessarily) equally spaced. ...
user avatar
  • 179
1 vote
1 answer
22 views

pgfplots with nodes near coords fails for some symbolic coords

I have made a plot with pgfplots where the symbolic coords contain special characters input via \texttt. When I enable nodes near coords, LaTeX chokes on these special characters. \documentclass{...
user avatar
0 votes
0 answers
47 views

Pgfplot overlapping plots

I currently used tikzplotlib from Python to generate the following plot in LaTeX. However, my current subplots are overlapping in LaTeX while they were not overlapping in Python (I used fig....
user avatar
  • 1
0 votes
1 answer
43 views

Drawing Unconnected 3D Arc in PGFPlots

I am trying to draw a 3-dimensional half circle arc in PGFPlots using a parametric equation. This is the relevant code. \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{...
user avatar
0 votes
1 answer
44 views

Let a line make an angle with respect to coordinate system

I want to draw an asymptote to indicate the blue line to follow a certain path. However, the asymptote seems to shift as I adjust the height and width of the plot. I have tried to make everything ...
user avatar
1 vote
2 answers
84 views

pgfplots fails to graph the function [sin(x)]^100

The image shows that the graph of [sin(x)]^100 (in red) lies below the x-axis in four small intervals, as the function is non-negative its graph should be on or above the x-axis. So there is an error ...
user avatar
1 vote
2 answers
32 views

What is the addplot code to draw a simple vertical line of height 0.6 at x=1

I took a crack at this question earlier but deleted it because I think the subject line was misleading. My apologies for any confusion that might have caused. My task is to draw a simple vertical line ...
user avatar
  • 285
1 vote
1 answer
51 views

pgfplots won't plot simple trig function

I am trying to plot the following function where arccos(...) outputs a result given in radians Here is what I've got: \documentclass[12pt,tikz,a4]{article} \usepackage[utf8]{inputenc} \renewcommand*\...
user avatar
3 votes
1 answer
77 views

Place arrow in pgfplots

I want to place an arrow to indicate a remarkability in pgfplots. For now, I have the following code: \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \...
user avatar
7 votes
1 answer
215 views

Is it a limited numerical precision of Tikz or I don't understand the transformation?

I'm using a (-n active) nonlinear transformation of the form x \mapsto (x + a * sin x), y \mapsto y The problem is that the points with x = nπ, for n an integer, should be fixed points of the ...
user avatar
  • 329
2 votes
2 answers
76 views

3d barplot with colormap / heatmap

I'm trying to plot a 3d bar where the bars are colored with a colormap/heatmap. I just found this solution: enter link description here to get a 3d bar plot but i dont get a solution for the colormap ...
user avatar
  • 45
2 votes
1 answer
31 views

Undesired line between "fill between" regions

i´m trying to make this plot: As you can see, I am having trouble on the right side. I want to make the colored regions disappear softly to the right. To make that I defined, for each color, two ...
user avatar
3 votes
1 answer
33 views

Can I customize the legend of my plot?

I have the following plot: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ legend entries={Region,Signal}, ] \addplot[ fill=gray!20, ...
user avatar
0 votes
0 answers
28 views

How to use percentage instead of count in Histogram plot using Tikz library? [duplicate]

I use the following code to create the Histogram which has a count on the y-axis. But, I want to use the percent value instead of the count. \begin{tikzpicture} \begin{axis}[ width=0.4\...
user avatar
1 vote
0 answers
57 views

How to add a shaded confidence interval to a pgf plot from a csv file? [closed]

Here is the file: data I can't get the following code to work. Apparently adding and subtracting the rows is the problem. Am I missing something here? \documentclass[crop,tikz]{standalone} \...
user avatar
2 votes
1 answer
42 views

PGF boxplot prepared including outliers from file

This question is basically a continuation of this answer. How can I handle outlier data in PGF boxplots, supposed my input table looks like this: \pgfplotstableread{ index lw lq med uq uw out1 ...
user avatar
1 vote
1 answer
31 views

Replicate sidesubfloat with subcaption-package

Following the answer I received in https://tex.stackexchange.com/a/652074/61517 I wanted to make the figures even more compact by moving the corresponding labels above/to the left of the figure (as ...
user avatar
  • 1,691
4 votes
2 answers
104 views

Rounded corners do not transform well in Tikz under a nonlinear transformation

I want to apply a nonlinear transformation to the following image Whose code is \begin{tikzpicture} \draw (-4,-2) grid [step=1] (4,2); \draw[ fill=green!30, draw=blue, very thick, rounded corners=5ex,...
user avatar
  • 329
0 votes
0 answers
50 views

Plot function with integral: find the right formula

How can I plot a function like this? Where r_A and n_A,0 are constant. For now, let's leave out the details: I just want to know what equation I should write as the argument of the \addplot command. ...
user avatar
1 vote
1 answer
27 views

Selectively disabling axis labels in tikz-figures without modifying original file

In a current project I have the following figure structure (using example figures here): The file has been created using two files, main.tex: \documentclass{article} \usepackage{standalone} \...
user avatar
  • 1,691
1 vote
1 answer
14 views

pgfplots multiple addplots misalignment of symbolic x axis labels

Following is the code I have tried so far \begin{figure} \centering \begin{tikzpicture} \begin{axis} [ ybar, error bars/.cd, ylabel = Score, ...
user avatar
  • 13
1 vote
1 answer
44 views

Pgfplots ignores my last datapoint

Datapoint e will get ignored regardless of whether d - the previous datapoint - exists or not. I want a, b, c, d and e to be present in the plot in a bar plot that groups the bars by two (so feel free ...
user avatar
  • 1,373
0 votes
0 answers
19 views

How to draw a figure with multiple subfigures and parts in common? [duplicate]

I am trying to make a figure in LaTeX to explain modulation. By any chance, do you know how to plot this ? I know how to plot one figure, but not to add the binary values on top, nor putting the ...
user avatar
  • 1
1 vote
1 answer
26 views

y minor grid is not showing. why?

Could you please tell me why minor grid lines are not showing in this graph? Is this because I made ymin value to be greater than 0? It is set to 60 at the moment. Thanks for your help! \documentclass[...
user avatar
  • 1,926
0 votes
0 answers
25 views

pgfplot addplot with predefined 3D coordinates

I tried to modify the code in this post to make it work with 3D coordinates but I get this error: ! Undefined control sequence. round(0.99626*\the \pgf@z /0.0283465)/1000 l.44 ^^I\gettikzcoordinates{...
user avatar
  • 2,775
1 vote
1 answer
117 views

Save function inside macro for the function’s derivative

My intent is to plot the first derivative of a function, following this approach: f'(x) = (f(x + dx) - f(x))/dx. Mine is a bit of a long function, so I would like to know if it is possible to save it ...
user avatar
0 votes
1 answer
21 views

PGF axis label background is covering axis ticks

Related question: White background behind axis ticks I use a lot of worksheets with Cartesian coordinates. I like using PGF because it graphs functions for me. I have a few small things that I would ...
user avatar
1 vote
1 answer
63 views

tikzscale package not working with group plots

I'm trying to scale a pgfplots that uses group plots but something is not working properly. This is the MWE: \documentclass{article} \usepackage[% total={6in,9in},% body={111.5mm,185.6mm},% head=...
user avatar
  • 2,775
1 vote
1 answer
32 views

Combination of pgfplot crossreferences and invoke before with externalize produces error

I would like to use the "legend to name" feature of pgfplots with externalize. This works fine if I don't use the "invoke before crossref tikzpicture" which I use to set the ...
user avatar
0 votes
2 answers
49 views

How to move percentage numbers in bar chart horizontally?

I want to to move the percentage numbers in horizontal direction so they don't overlap: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \pgfplotsset{testbar2/...
user avatar
1 vote
1 answer
26 views

Error bars in pgfplots symlog bar chart not working

I'm trying to create a bar graph with symlog axes and black error bars. However, the best I got so far is below. Now my error bars disappear behind my bars and have colors that are not black for some ...
user avatar
  • 13
1 vote
1 answer
42 views

Alignment of pgfplot inline legend in body text and caption

I would like to use pgfplots' "legend to name" feature to reference the (named) legend in the caption of the respective figure environment. Additionally, it would be nice to be able to put ...
user avatar
1 vote
1 answer
38 views

How can I remove one of the '0' (origin label) for the given graph?

I was wondering if anyone could help me with removing the origin label(s) and putting '0' precisely in the corner position. By my understanding, it seems that we are supposed to remove these labels ...
user avatar

1
2 3 4 5
179