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
0answers
11 views

Unexplainable error message with a plot using tikz and pgfplot

I am having a problem with a plot which I am unable to explain, let alone fix. A simple example is this (there is also a curve plotted from data, but I skipped it as it doesn't affect the outcome): \...
1
vote
2answers
27 views

Label PGFPlot table points with coordinates

I would like to label each plotted point with its x and y coordinate. I am able to label with a single one using the MWE below. I must avoid manually labeling each point since my actual table size is ...
0
votes
0answers
17 views

How to change the color of a particular bar in a bar diagram with pgfplots? [duplicate]

% used PGFPlots v1.14 \documentclass[margin=0.5cm]{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage[scaled]{helvet} %Paquete para letra helvetica parecida a letra arial \...
-1
votes
1answer
35 views

Move legend down a bit more

I have 2 questions: 1- How to lower the legend so it doesn't override the x-axis 2- How can I avoid the 5*10^-2 in the x-axis and get 0.05 \documentclass[a4paper,12pt]{book} \usepackage[T1]{...
0
votes
0answers
20 views

putting a legend outside, on a line [duplicate]

how can I put a legend outside on a single line under the x axis \documentclass[a4paper,12pt]{book} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english,italian]{babel} \...
2
votes
1answer
27 views

How to align two tikzpicture images inside minipages without body text overlapping?

Why does the below lead to body text overlapping my images/image caption? How can I fix this? Apologies that I haven't provided a MWE, but this is using the achemso document class from Journal of the ...
1
vote
1answer
77 views

pgfplots: Best way to draw a “patchwork” diagram

Update / Remark After I got a hint in the chat I also asked the question here (outside of https://tex.stackexchange.com/) and got an alternative approach. This is a follow-up question of this ...
0
votes
1answer
50 views

tikz equal axis [duplicate]

How can I get equal scaling? In the MWE I would like to have it so that the grid consists of squares. \documentclass{article} \usepackage{geometry} \geometry{textwidth=150mm, textheight=270mm} % ...
0
votes
1answer
31 views

Undefined control sequence help required for plotting a graph

When trying to insert a graph plotting a DC transfer curve from Multisim I have been having a minor issue and I'm not sure why. If anyone could explain how to fix this I would be greatly appreciative. ...
0
votes
1answer
51 views

pgfplots: patch diagram, change color of individual rectangles

Update: Follow-up question here. I want to create a "patchwork" diagram with pgfplots. I use patch plots, see "Chapter 4.6.13 Patch Plots". I do not have experience with 3D plots (...
0
votes
0answers
51 views

pgfplots: inconsistent behavior when using \addplot3 with option shader=interp

I'd like to plot the contour lines of a bivariate Gaussian density with correlation coefficient either 0.75 or -0.75. Turns out that the rendering looks different when changing the coefficient even if ...
1
vote
2answers
63 views

Draw cylinder and sphere using PGFPlots [closed]

I want a cylinder of radius 1 and height 1, centered on the origin above the xy plane and the part of a sphere of radius sqrt(2) centered at the origin, that covers the cylinder. This is what I have ...
0
votes
1answer
31 views

problem with 3d parametric plots and view from top

Im plotting parametric functions and getting different views of them. The problem is the top view, specifically when the function varies in the z direction, the perspective is not correct. Code ...
1
vote
1answer
69 views

Cyclic colormap in pgfplots for surface (2D) phase plots

I struggle with the shader settings for surface plots in pgfplots. In particular, I want to make a 2D surface plot of the phase of a list of complex numbers. That means, there are discontinuities in ...
1
vote
1answer
53 views

PGF: 2 x axes without a second plot

I would like to add a second x axis to my single plot. The first x axis goes from 0 to 2, the second one goes from 0 to 0.28. 0.28 on the second axis should be on the same x coordinate as 2 on the ...
2
votes
3answers
71 views

Graphing a discontinuous function?

I'm trying to graph the following discontinuous function in an interval from -3π to 3πi f(t)=t^2 , 0 \leq t < \pi , f(t)= f(t+n\pi) I've not had much success with my code. What I've come up with ...
0
votes
1answer
24 views

How to label a pgfplot from top to bottom?

I just started using pgfplots for diagramms in my paper. I am using a double column layout and want to create the diagramms with the intend that they fit in a single column if possible. I find it a ...
0
votes
0answers
35 views

Alignment of legend for multiple ordinate plots

How can we achieve a manual alignment of the legend for a pgfplots with multiple ordinate axes. Consider the simple MWE shown below - the legend is always anchored to the top right corner. How can ...
1
vote
1answer
24 views

Confidence band of the regression line in pgfplots

In a plot containing experimental data, I have to add a linear regression and the confidence bands of that regression. Thanks to Jake's answer to this question, I was able to get the linear regression ...
0
votes
1answer
11 views

pgfplots plotting an expression which has a jump

I would like to plot the following expression: (x-1)/(x+2) However if I add this in pgfplot as an expression, I get this result: I would like to make the part in the middle disappear, since the ...
1
vote
1answer
28 views

PGFPlots “fill between” causes polar axis to disappear

Having a bit of a tough time figuring out what tikz/pgf want from me here. I've tried a few solutions from previous askers, and still can't seem to get anywhere. When I use \addplot fill between [of=A ...
1
vote
0answers
16 views

rotate numbers on x axis [closed]

I tried a lot, but since gouplot is new, and I can't handle it very well, i couldn't rotate the number on the x_axis. \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \pgfplotsset{...
0
votes
0answers
35 views

3D plot with disordered coordinates

is there any way to represent a 3D plot with disordered coordinates? For Example: I have done a FE-analysis. There is one beam with two different temperatures on each site. The results from the FEA is ...
0
votes
0answers
23 views

Error when I install package “pgfplots” with MikTex

I tried to install package "pgfplots" via MikTex, but it was not successful. The error detail is as follows: Source: Libraries\MiKTeX\PackageManager\CurlWebSession.cpp:266 Error: Transferred ...
0
votes
2answers
57 views

stacking plots, same x same y

I've plotted 5 plots individually, but I'd like to have something like in the picture: where the y_max and the ymin is always the same and goes from 0.651 to 0.6535, but on different level like in ...
0
votes
1answer
49 views

How can I add a unit to the y tick labels?

I want to add '%' as a unit to the y tick labels (not for the y label) for this graph here: This is the code that i wrote for this plot: \begin{tikzpicture} \begin{axis}[ ybar, ...
2
votes
1answer
27 views

PGFPLOTS How to increase the line width without increasing the marker border width

\documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines = left, enlarge x limits=0.1, enlarge y limits=0.1, ...
1
vote
1answer
27 views

pgfplots aligning subplots causes misaligned y-tick labels

Following the accepted solution by Peter Grill for this question, I added the following line to vertically align my subplots: \pgfplotsset{yticklabel style={text width=3em,align=right}} This solution ...
1
vote
1answer
37 views

How to plot a graph for infinite series converging to a known value w.r.t with number of terms using tikz?

Let's say I have a series which converges to a known value, with each increasing number of terms to approximate it. For example: \pi = 4 ( 1 - 1/3 + 1/5 - 1/7 + ... ) How can I make a plot which ...
0
votes
0answers
12 views

pgfplots axis labels with variable scale and abbreviation

After a bit a research, I'm using this solution to abbreviate my y-axis labels. However, this only allows me to set a single abbreviation. My data spans multiple orders of magnitude, and I'd like to ...
0
votes
0answers
20 views

A bubble-plot graph and labels from time series with repeating series data

I have a time-series and multiple lines for the same dimension (each for a diferente year). How can I get yticklabels from CSV data to have the right label at Y axis? I tried to set the labels using \...
0
votes
0answers
25 views

Pgfplots: Smooth polar contour plot with Gnuplot from file

I generated a polar contour plot with a colorbar: \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{polar} \pgfplotsset{compat=1.16} \begin{document} \begin{tikzpicture} ...
1
vote
2answers
28 views

Loop over pgfplotstable rows

I wan't to draw tikz picture based on data loaded from pgf table. Can I somehow use it like standard \foreach? \foreach \i/\j in {\mytable} \draw... What I found is \pgfplotstableforeachcolumn but ...
0
votes
1answer
19 views

How to shift dashed pattern in pgfplots using “dash phase” : only in the plot, not in the legend

As mentioned in this question, one can use dash phase to shift the position of the blanks between the dashes of a plot. However, this also shifts the blanks in the legend. Is it possible to shift the ...
0
votes
0answers
40 views

Geodesics on a cylinder

I want to draw the geodesics of the cylinder. Here's my (simple) TikZ code: \begin{tikzpicture}[scale=0.8] \draw (0,0) ellipse (1.5cm and 0.6cm); \draw (0,4) ellipse (1....
0
votes
0answers
15 views

Set real dimensions of pgfplot

I'm trying to plot colored histogram in subfigure environment. But when setting chart dimensions to \linewidth I got what follows, which is definitely not what I expect. \begin{subfigure}[t]{.48\...
0
votes
0answers
42 views

Constant number of decimal places EXCEPT 0 [duplicate]

I am working with pgfplots and I want a constant number of decimal places on ticks. A similiar question was answered here pgfplot with constant decimal places on ticks \usetikzlibrary{shapes,arrows} \...
2
votes
2answers
184 views

How to use “calc” library to sum coordinates?

Why does the following code draw an inclined line? I thought the sum ($(1,6) + (2,0)$) would return a point (3,6). \documentclass[dvipsnames]{article} \usepackage[utf8]{inputenc} \usepackage{xcolor} \...
0
votes
0answers
30 views

how to convert .pgf file to .pdf file using lualatex command line

I have some code that is generating "images" (matplotlib plots) in the form of .pgf files. The project is using lualatex as a latex renderer. I want to view the generated images. How can I ...
0
votes
2answers
42 views

pgfplots: How to plot a curve with infinite value as one addplot

I want to plot acos(7/x)+acos(-2/x)+acos(5/x)-pi over domain=-20:20. I ask myself, whether I can plot this as one curve (not as two curves with different domains). So I choose unbounded coords=jump (...
0
votes
0answers
62 views

Tikz: Drawing a grid-matrix with text specifications and coloring

I am new to Tikz and I am trying to draw a very specific graph. It contains several features that with my limited knowledge I am unable to make. It is a grid type of drawing with some text ...
0
votes
1answer
58 views

Aligning a table and a pgfplots graph

I am trying to align a table and a pgfplots graph using minipage. I tried to measure the table height and set it to the graph but they still are out of alignment. Ideally, the captions should be at ...
0
votes
1answer
69 views

How to plot factorial function?

I'm quite new to tikz and pgf. I'm plotting Big O time complexities and after looking at enough examples I've been able to create exactly the graphs I want with the exception of the factorial. Simply ...
4
votes
3answers
112 views

TikZ plot for Enneper's minimal surface?

Is there a way to plot Enneper's minimal surface in TikZ either using its implicit equation or its parameterized form? ref:https://mathworld.wolfram.com/EnnepersMinimalSurface.html
2
votes
1answer
55 views

Density plot with log scale for z-axis in pgfplots or tikzplotlib

I am trying to make a 2D density plot in python using tikzplotlib. I need to have the colorbar (and corresponding z-axis) in the log scale. Here is the example of the figure in png that I want to have ...
2
votes
0answers
52 views

PGFPlots intersection segments wrong curve and endpoint

When trying to answer How to delete a part of a curve in Tikz? , I ran into problems with intersection segments from PGFPlots fillbetween. I tried to change the curve from to[out=280,in=175] to ...
6
votes
1answer
94 views

3d intersections

As exercise, I'm trying to draw the intersection of the prism [0,2] x [0,4] x [0,6], and the plane x + y + z = 5. My result is: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=...
1
vote
1answer
74 views

Plotting a curve using “plot function” Vs Bezier curve (Method of tangents)

Regarding the shown MWE, I need to plot a parabola with the following properties: Parabola starts at point "A" Parabola ends at point "B" Peak of the parabola is at point "F&...
0
votes
1answer
44 views

Not enough plotting, graph is cut and asymptotes are not displayed

So, I just practicing some of suggested tikz code that I should use based on my previous questions. However, I have another problem where this code does not yield a perfect graph (I mean a full fit ...
2
votes
1answer
37 views

How to make error bars in a bar graph the same size (pgfplots)

Hello i have a bar graph with only 2 quantities and id like to make it so each quantity has the same error bar (e.g. all the red bars have error A and all the orange bars have error B). Thank you \...

1
2 3 4 5
160