Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
14 views

Using externalize library for pgfplots on Overleaf

To speed up the compilation of my files which contain several pgfplots, I want to use the externalize package. Also I have been using the subfiles package. Now, I have put : \usetikzlibrary{external} ...
1
vote
0answers
23 views

pgfplots: Two different color maps in surface plot

I am looking for a way to create the following surface plot with pgfplots: Using matlab2tikz I got the following code: \begin{tikzpicture}[% trim axis left, trim axis right ] \begin{axis}[% ...
3
votes
1answer
40 views

How to pass an array to function in pgfmathdeclarefunction

I am trying to plot below function as 3d surface plot, where $\theta_1,\theta_2$ are the x and y axes respectively. The Z axis is supposed to be $L(\theta_1,\theta_2)$. $$ L(\theta_1,\theta_2) = \...
1
vote
1answer
33 views

pgfplot with timestamp in microseconds

My example as below: \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \begin{filecontents*}{data.csv} (10-18-2018 16:50:27.871,0) (10-18-2018 16:50:27.888,8) (10-18-...
0
votes
1answer
21 views

How to add a legend over each segment in axis environment

i would like to have in each of segments of the graph, created by the provided example, a text say n=1, n=2,... n=4. I think i would first have to change the scaling, because otherwise I have no space ...
0
votes
0answers
18 views

Cover plot outside of axes area [on hold]

I have a plot (in pgfplots) which reaches outside of the ymin:ymax values I have chosen: Can I cover the plot outside of the axes area, so that the blue line finishes where the horizontal axis is? ...
1
vote
1answer
13 views

Custom function in pgfplot not working on 2nd call

I took inspiration by my previous post (Drawing Line Plot with uncertainty) and another (Is there an easy way of using line thickness as error indicator in a plot?). My current issue, is that the ...
0
votes
0answers
25 views

Linear regression from a specific portion of a data file in pgfplots

I found clean solution to plot from a specific portion of a data file here How to read a specific portion of a data file in pgfplots. Works perfeclty. But for some reason it doesnt work when i'm ...
2
votes
1answer
17 views

pgfplots: \draw not working inside axis environment

Here's a MWE: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.13} \begin{document} \begin{tikzpicture}[ ] \begin{axis}[ ] \draw (0,0) -- (1,1); \...
1
vote
1answer
34 views

Generating graphs with top label different from down

%how use the top label diferrent form the down label? \documentclass[12pt]{article} \usepackage[dvipsnames,table]{xcolor} \usepackage{siunitx} % SI-units \usepackage{pgfplots} \usepgfplotslibrary{...
2
votes
1answer
34 views

Filled area behind bar plot from table data

I have the following MWE where I want to place the data from file myintervals.csv as filled area behind my bar plot. There is a problem with expandable macro here, but I don't get it working correctly:...
0
votes
2answers
40 views

remove row from pgfplotstable macro

I've got to a point where I have some data stored in a pgfplotstable macro. I want to remove a row from that macro (a line where some data is missing) and then further process the remaining data (...
1
vote
1answer
34 views

TikZ spy and PGFPlots fill between

I used PGFPlots library fillbetween to create a plot, and now I want to magnify part of it using TikZ spy library. However, when I do it the filled area between plots disappears, both from the ...
3
votes
1answer
31 views

Moving Tick Markers in a TikZ Picture

How can I move the marker <2A> slightly up in the picture? \documentclass [12pt, a4paper, onecolumn, fleqn] {article} \usepackage [portuguese] {babel} \usepackage [utf8] {inputenc} \usepackage ...
1
vote
1answer
43 views

Produce plate shape figure

I want to produce a figure in TiKz like this: I tried with this code: \begin{tikzpicture} \begin{axis}[view={60}{30}] \addplot3[surf,shader=flat, samples=30, domain=-1:0,y domain=0:2*pi, z buffer=...
1
vote
2answers
46 views

Generating random graphs with “esami” package

I want to display graphs with random variations using the variables in the esami package. I have tried with tikz but when I put the \FPsv inside the coordinate of a point I get lots of error messages. ...
2
votes
1answer
35 views

pgfplots: positioning a normal and tangent vector on a 3d surface

I feel that there should be a simple, good way to plot a 3d surface and place a vector (or more) at one point on it, where the vector is a function of the point and the surface. For example, a normal ...
0
votes
0answers
25 views

Plot with shaded regions under curve [duplicate]

I want to plot the given graph, with a concave function and a rectangular box formed by drawing lines from the $x$ and $y$ axis to a point on the function. I also draw a segment from that point to the ...
3
votes
1answer
40 views

set layers in PGFPLOTS polarplot not working as expected

I have following code: \begin{tikzpicture}[] \begin{polaraxis}[xtick={0,90,180,270}, ytick={0,1}, ymax=1.5, xticklabel={\pgfmathprintnumber{\tick}\si{\degree}}, set layers=default] \addplot[thick,...
0
votes
0answers
37 views

pgf mesh plot using .csv file, runaway argument

when using the following code : \begin{figure} \centering \begin{tikzpicture} \begin{axis}[ grid=major, xlabel=$t$, ylabel=$d_p$, zlabel=$N$, ...
1
vote
1answer
32 views

Weird behavior when mixing the tikz “let” and “plot” operation

Can anyone explain to me why the output of the following code changes when I remove +\x1 ? \documentclass[tikz]{standalone} \usepackage{tikz} \begin{document} \usetikzlibrary{calc} \begin{...
0
votes
0answers
29 views

Figures does not fit on single page [closed]

I have three separate figures with subfigures on each inside like this: % ONE===================================================== \begin{center} \begin{figure*}[!htbp] \centering \begin{subfigure}...
2
votes
1answer
49 views

How to make a line between two planes and show distance between them using tikzpicture environment

Please consider the following MWE: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.15} \pgfplotsset{ axis equal image, axis lines = center, label style={font=\tiny}, ...
0
votes
0answers
20 views

How to create 3d line plot in 3d mesh [closed]

I am trying to include a 3D line plot into a mesh plot as follows (both come from seperate .csv files): \usepackage{pgfplots} \begin{tikzpicture} \begin{axis}[ grid=major, ...
1
vote
1answer
44 views

Drawing Line Plot with uncertainty

Does anyone have an idea how to generate a graph with the 'uncertainty' area like in the picture shown: i have no idea where to start! Thanks for any inspiration! Cheers! Martin
2
votes
1answer
23 views

How to remove the little bars on the axis while keep the labels at the same time?

When I do this: \begin{figure}[h] \centering \footnotesize \pgfplotsset{ width=0.45\textwidth, height=0.3\textheight, symbolic x coords={2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,...
3
votes
1answer
86 views

Planck's black body law

I am trying to plot Planck's law for the radiation emitted by a black body, with different values of the temperature. This law reads \begin{equation*} \rho(\omega, T) = \cfrac{\hbar \...
0
votes
0answers
39 views

How to draw an area arount the points on a plot

I need to draw an area around the points on a plot. It should look like in related picture. May you give me an idea how to achive it in the pgfplots (best) or in another software?
2
votes
1answer
45 views

pgfplots: add tikz drawing to axis labels

So far, I used gnuplot to draw plots for my LaTeX documents. However, sometimes it is not so satisfactory and I have not yet found the optimal solution for making plots. Since I read about pgfplots ...
0
votes
2answers
22 views

Force a grid to be square in pgfplots

I'm trying to create a plot using pgfplots so that the grid lines are square, while maintaining all the other labeling and such. I can manually set the height and width of the plot, but I'm not sure ...
0
votes
1answer
21 views

How to use format/fixed and comma separator in tikz

Is it possible to use Format/Fixed and comma as separator in a tikz picture? Please find below an example picture: I used the code below and got the following error message: Package pgfkeys Error: I ...
1
vote
1answer
40 views

Add a legend to drawn functions in Tikz

I have 6 functions in a Tikzpicture, and I want to create a legend in the top left corner, so that all colours are identified with a value for p. So I would like to create a legend in a box that ...
2
votes
2answers
35 views

Change sign of axis markers in tikzpicture

I have the following MWE to generate a graph of a function, which is defined in terms of y. For this, I would like the y-axis markers to be given in positive numbers instead of negative (i.e., show ...
1
vote
1answer
36 views

Rectangle Under Graph

Does anyone know why this code doesn't work? I'm trying to put a rectangle under the curve, but for some reason it gives me a very odd response. \doucmentclass{standalone} \usepackage{pgfplots} \...
2
votes
1answer
42 views

How to add slopes to function plotted with pgfplots?

I'd like to add slopes to a function I've plotted that is similar to the following figure that I drew using asymptote. I'd like to remove asymptote dependency from my document by using pgfplots/tikz. ...
1
vote
2answers
53 views

Shading area under curve TikZ

Using code I got from here, I'm trying to make a small rectangle of height y = 6 between bounds x = 2 and x = 7, and shade it in. Any idea why this doesn't work? \documentclass[12pt]{standalone} \...
1
vote
1answer
76 views

Drawing a discrete probability mass function

I am having trouble drawing the following probability distribution: I am not very sure about how I can do this. I've looked at sample plot functions using PGF Plots and Tikz, but I haven't been able ...
0
votes
1answer
27 views

Shifting specific labels in pgfplots

I'd like to be able to modify the position of specific labels in a difractogram, most are ok, but some are positioned on top of each other and those are the ones I'd like to move. \documentclass{...
0
votes
0answers
9 views

pgf ticks with fixed and scaled ticks not working [duplicate]

In the question posted below the answer seemed to work Scaled tick option not working but for my plot the x ticks stubbornly refuse to be fixed. I want the tick labels to be shown as seen in the ...
0
votes
0answers
18 views

use pgfplots table meta to style marker [duplicate]

I have a table of data that I would like to read in order create a plot. From my understanding of the pgfplots manual, the meta parameter allows to read one (single) additional column from the file ...
0
votes
0answers
15 views

Externalize graphics when using pgfplots generates then deletes plots on compile

I am having an issue with the externalize option on PGFPlots. The system generates the external PDF files fine and if the compile is interrupted at the correct time the plots are all present and ...
0
votes
1answer
47 views

Need changes in the given code for plotting a signal

I want plot for a square wave pulse. I have written the following code: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ width=5cm, height=4cm, x ...
2
votes
1answer
23 views

Looping over existing colours in addplot in pgfplots

In Change color in addplot in for loop of pgfplots It was discussed how to loop over nonexistent colours in \addplot and axis I would however like to loop over existing colours, but: \documentclass[...
1
vote
1answer
32 views

Implicit error with matplotlib2tikz thisrow already exists

The conversion from Python 3.7 into LaTeX code worked well with matplotlib2tikz v0.6.18. The only exceptions are some ignored parameters which seems reasonably discarded for me (aspect ratio and tick ...
1
vote
2answers
45 views

Adding text and labels to a pgfplot

I am very new to LaTeX and pgfplots. I would like to reproduce this image: Is this possible using pgfplots? All I have so far is a straight line! \begin{tikzpicture}[scale=0.70] \begin{axis}[ymin=0, ...
1
vote
1answer
18 views

Trend line of a plot, based on variable values

I'm trying to draw a trend line of a plot. The only way I found is by using tables: \begin{figure}[H] \begin{tikzpicture} \begin{axis} \addplot [only marks, mark = *] table {\datatable}; \addplot [...
1
vote
1answer
30 views

Centering caption in figure environment with a tikzpicture

I'm trying to center a tikzpicture and a caption inside the figure environment, but when I compile something is off. It seems as if the caption and the tikzpicture are centering with respect to ...
2
votes
1answer
27 views

\pgfmathsetmacro creates “Dimensions too large” for t distribution

I am trying to plot 't' distribution with area of interest shaded. I have done both plotting and sharing area. Next tried to draw vertical lines closing the shaded area on both sides. For this, I need ...
1
vote
1answer
28 views

Reading string from CSV in pgfplotstable

I have a CSV file which contains different sets of plot-data (x1,y1,z1), ..., (xn,yn,zn) and some additional data, one of which I would use as legend. My current code is as follows: \documentclass{...
1
vote
1answer
68 views

How to make my barchart more beautiful

I have the following code: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{width=12cm,compat=1.9} \begin{document} \begin{tikzpicture} \begin{axis}[ title={Testbench: Bitzähler (...