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
16 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): \...
0
votes
0answers
7 views

Outliers' colours do not match their corresponding Boxplot colour

can you give me some help here? I'm using custom colours for each axis of my boxplot, but their outliers do not match that color. This is what I have so far \documentclass{article} \usepackage[utf8]{...
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
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
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]{...
1
vote
1answer
62 views

How to plot the DFT transformation of a vector with tikz/pgfplots?

My question seems to be simple but still I could not find any answer for that. Assume that we have a vector and its DFT which I computed it in R. > x <- c(3,9,4,2,5,6,2,6) > x [1] 3 9 4 2 5 6 ...
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
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} \...
4
votes
1answer
1k views

How to select a range of data within a .csv file in latex using pgfplots?

I am generating a plot of data using pgfplots in latex. I am using data from several excel files as .csv. Here is the MWE: \documentclass[border=5mm,convert]{standalone} \usepackage{pgfplots} \...
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 ...
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
1answer
27 views

Dashed line as a mark in pgfplots

I am trying to turn some markers into a dashed line in this diagram. However, I can only change them all at once. I need the "a", "b" and "c" to remain as a solid line, ...
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. ...
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 ...
4
votes
1answer
1k views

Is there a way to place the x axis at a specific y value in PGFPlots?

I prefer single-line axes for plots, rather than the box style which is (I think) the default for PGFPlots. I'm familiar with the axis x line*=middle option, which places the x-axis at y=0. However, I ...
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
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 ...
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 ...
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 ...
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
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
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 ...
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 ...
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
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
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, ...
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
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 ...
2
votes
1answer
98 views

Specifying a domain for the z-axis in PGFPLOTS

I am trying to draw a mesh in the domain { (x,y,z) in [0,4] }. I was able to constrain the domain in the x-axis and y-axis, but the mesh is still drawn in the negative z-axis (Image 1), which 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
1answer
88 views

matlab2tikz - problem with german letters - ä, ö, ü, \cdot and r_N

I'm using matlab2tikz the first time and get some problems with the first graph. I could seperate the problem. In the moment, I insert german letters like ä, ö, ü or special code like \cdot and r_N in ...
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 ...
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
52 views

Pgfplots polar contour plot from file table with shading

I want to generate a polar plot with a colorbar quite similar to this one: from this question: Rotating polar contour plot messes with alignment of plot and axis I want to use this file with the ...
0
votes
1answer
40 views

How to put series of small graphics on the graph?

I am making plots with y-axis breaks by placing one \nextgroupplot above the second one. These plots have not only curves but also some additional graphics, which are assigned to bottom coordinate ...
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} \...
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
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 ...
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
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
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 \...
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 ...
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
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} ...
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
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
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
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 ...

1
2 3 4 5
160