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

“TeX capacity exceeded, sorry” when drawing graph with PGFplots (whats the max that can be drawn)

Hey I have this graph I'm trying to draw but it uses about 15k (x,y) coordinates. When trying to create this document I'm getting this error that tex capacity is exceeded. Is there any way I can still ...
2
votes
3answers
165 views

Calculating definite integral of smooth function in pgfplots

I have the following code which plots the graph of (1 - x^2)^n for n=1,3,5,7. Is there a way to calculate the integrals from -1 to 1 directly in pgfplots? The goal is to have normalized functions. \...
0
votes
0answers
24 views

Hot to put some nodes only when specific condition mets in pgfplots (3dplots)

I used below code for drawing 3dplots to represent some data 1 % Preamble: \pgfplotsset{width=7cm,compat=1.3} 2 \begin{tikzpicture} 3 \begin{axis}[ 4 view/h=60, 5 plot box ratio={1}{1}{1}, ...
1
vote
1answer
23 views

Can values be too small/big for pgfplots?

So i've got the following code, in which I want to extraplorate a linear regression line. My attempt was to add \pgfplotstableregressiona*x+\pgfplotstableregressionb as a new plot, but it simply won't ...
0
votes
1answer
37 views

Axis with Border

I am new to tikz and have been trying to create different graphics. I am trying to get a nice grid around the axis (like shown above). I am having trouble. I have tried several things, but nothing ...
1
vote
0answers
35 views

pgfplot/tikzpicture declare function error with sqrt(): missing number treated as zero

I am adapting the solution here to plot the slope field for a differential equation. The equation I would like to use is dy/dt = -sqrt(1-y^2). I can get it working for "simple" functions (...
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
1answer
37 views

Drawing Straight Line y=x and Coloring and Labeling Two Regions [closed]

How can I draw something like the figure below using latex:
2
votes
1answer
49 views

How to make curved arrows

I am a math teacher and I still have a hard time getting started with Latex, but I would like to know if someone could help me on how to generate the following example. Researching on the internet I ...
2
votes
3answers
200 views

Help me to draw the figure using tikzpgf plot

How to draw the following figure using Tikzpgf ? I need to plot with the axes exactly in the figure. Also I want to display the vertex (4,-2). I know to join two points (a,b) and (c,d) by ...
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 ...
2
votes
1answer
59 views

I can't get latex(tikz) to draw a right square bracket

I am a beginner so please forgive any obvious mistakes. When using the code below \documentclass[letterpaper]{article} \usepackage{tikz} \usepackage{amsmath} \usetikzlibrary{arrows} \begin{document} \...
2
votes
1answer
25 views

pgfplots: Two Y-axes in different unit systems

I am attempting to create a graph showing some results, and to plot SI units on the left Y-axis and Imperial units on the right y-axis. My MWE so far is getting close, but as you can see from the ...
0
votes
0answers
22 views

Problem with TexWork PDF generator in plotting TikzPicture

I have to export a PDF composed of a lot of pages, but OverLeaf can't compile (I use the free license). So I'm using the TeXWork program but among all the TikzPicture images, only one of these fails. ...
1
vote
0answers
40 views

Smooth plot with mesh option and table data in pgfplots

Is it possible to have the same smoothness of the black plot while using the mesh option? \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.17} \begin{filecontents}{data-fake.dat} ...
1
vote
0answers
117 views

Placing marks outside coordinate system with pgfplots

I have a table of data (time vs. time) in a separate file and want to plot it with pgfplots. It works fine, but I have some special values denoting timeout in that table and I want to put them outside ...
1
vote
1answer
17 views

On fixing the issue with ytick alignment in groupplot

I am experiencing some issues while trying to have a common y axis scale as well as ticks. I tried some solutions like every plot/.style to ensure the range of the axes over the groupplot is the same ...
2
votes
1answer
31 views

pgfplots: how to bring all node plot annotations to top in proper way?

I'm plotting many almost parallel lines (in the MWE I'm just plotting random stuff), where I am using the very convenient node[pos=0.x]{label} option to annotate my graph. The issue is, that multiple ...
0
votes
1answer
26 views

How can I make \newcommand work together with \ticknum

I'm trying to make a lot of different variations of PGFplots label styles so I'm trying to define different values and use \ticknum to pick one of them for example \newcommand{\x0}{0.3} \newcommand{\...
3
votes
2answers
94 views

How to graph a function outside the domain using tikz?

I want to graph the function (x^(2/3))*(6-x)^(1/3) that is displayed as the results of Geogebra. But I get an error in tikz and it can only be graphed in its domain [0,6] \documentclass{standalone} \...
7
votes
1answer
140 views

Fill the intersection of 3 (or more) curves

I couldn't find a simple way to fill the area of the intersections of 3 curves. I want to fill this area: My try: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \...
1
vote
0answers
27 views

Adding a letter to the x-axis ticks of pgfplots graph of function [duplicate]

I'm new to stack exchange, so please let me know if there is anything I should do to make my question more clear. I'm new to LaTeX, and I am trying to make a graph of the equation from special ...
1
vote
1answer
34 views

Plotting disproportionate sets of data

I solved an optimisation problem for three cases. I intend to plot the results as a groupplot (essentially a 3 by 1 groupplot). Since I present six sets of data in each plot, I get a graph that looks ...
3
votes
1answer
77 views

Filling area between 2 Plots made by coordinates with transparent

I am trying to fill the area between 2 plots with lil bit transparency. Actually i got with fill between this figure: How can I only fill the difference between the two plots. Make the actual orange ...
2
votes
1answer
31 views

Citations in tikzpicture bar chart

I am trying to draw a bar chart using pgfplots in which I want to add references to x coordinates. I am getting the following errors with the output. Paragraph ended before \XC@definec@lor was ...
1
vote
1answer
26 views

Adding an extra y tick, also adds an unnecessary one in the other part of the plot

I want to construct a normal distribution probability plot. The x-axis is for the x-values of my bins, and the y axis shows the cumulative probability on the tick labels, but the y-values are the ...
1
vote
1answer
35 views

How to draw a line before points in a tikz picture

I have a problem with drawn lines in a tikz plot. It feels like the solution should be really simple but I don't know how to solve it. When I plot data points and a line, the line is behind the data ...
0
votes
1answer
40 views

pgfplot x axis ticks aligned with a matrix beneath |

How can I make something like this as shown in the image using pgfplots in latex. I want the x-axis tick marks aligned with the other texts as shown in the image.
0
votes
1answer
43 views

3d plot with pgfplots and tikz [closed]

Following coordinates: O(0|0|0) P\left(-\frac{25}{2}|0| 0\right) Q\left(-\frac{25}{2}|-12|9\right) R(0|-12|9) L\left(-\frac{25}{4}|-8| 6\right) g: \vec{x}=\left(\begin{array}{c}0 \\ -12 \\ 9\end{...
2
votes
2answers
156 views

PGFplots - Automatic choice of a cycle list according to the number of curves

Is it possible for PGFplots to choose (automatically) such or such cycle list according to the number of curves to display ? To illustrate, and using the colobrewer library, PGFplots could be ...
2
votes
0answers
46 views

PGFplots - How to modify “line legend” style

I would like to know if it's possible to change the default legend style line legend. For one of my documents, I'm trying to redefine and harmonize (same width, etc) my legend styles (including line ...
0
votes
1answer
37 views

Drawing a second and third x-axis with tikz

This is what I want to draw: Until now I have, with help of Diagramming Unit Circle and Sine Wave with TikZ the following code: \documentclass[a4paper]{article}% guessing (cfr) \usepackage[landscape,...
1
vote
1answer
40 views

pgfplots: conditional 'inner sep' for axis label

How can I set the inner sep of the xlabel to 0pt if it is empty and not xlabel=<text>? I mean sth. like \ifx\pgfkeysvalueof{/pgfplots/xlabel} \empty inner sep=0pt \else 5pt\fi \documentclass[...
1
vote
1answer
36 views

pgfplots: How to get coordinates, draws as a style

I draw these two points \fill[cyan] (yticklabel cs:0.5) coordinate[](X2) circle(2pt); \fill[red] (yticklabel* cs:0.5) coordinate[](X1) circle(2pt); So my question is: How could I have that as a ...
3
votes
1answer
220 views

How to graph a 3D surface with “holes”?

I would like to plot the surface over . I cannot figure out how to show the two "holes" of the surface that result due to its intersection with the plane. I tried the following but I ...
1
vote
1answer
35 views

exporting surface color data from MATLAB for usage within pgfplots code

I am writing a MATLAB program that exports MATLAB plots to tikz code. One of the features that I find very useful and that I would also like to implement is the specification of the surface color. In ...
1
vote
1answer
57 views

pgfplots wont graph my function

I would like to plot a graph like But my code simply does not work \begin{tikzpicture} \begin{axis}[ width=18cm, axis lines=middle, xmin=0,xmax=1.02, ymin=0.86,ymax=1.02,, xlabel=\Large $c$,...
2
votes
1answer
41 views

How to control the height accurately of two standalone plots with exponent

I used pgfplots package to draw two standalone plots. I want these two plots with the same height but I failed. Here is the image shown in my paper. As you see, the right one is a little higher than ...
0
votes
1answer
65 views

pgfplots: How to get the correct height of a label, if fontsize has changed

I set font=\Huge for a ylabel. With \pgfkeysvalueof{/pgfplots/ylabel} I get the label-text. But how to get the correct value while measuiring the height with \pgfmathsetlengthmacro\yLabelHeight{...
0
votes
3answers
59 views

pgfmath gives me a wrong computation

I am trying to do some plots with spherical coordinates and have a problem when computing some numbers in PGFPLOTS. I add a MWE here: \documentclass[12pt]{standalone} \usepackage[pdftex]{graphicx} \...
0
votes
1answer
22 views

x tick values truncated when y axis is in log mode

I have some code similar to this: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.17} \begin{filecontents}{data-fake.dat} xpos y date 1 1 09-01 2 3 09-02 3 ...
0
votes
0answers
31 views

pgfplots, groupplot: How to read out and set plot-lengths

I set width=33mm in a groupplot. How is this width to understand? I thought it has to be: "graph width" + label distance, but it seems to be another value. How can I read out the label ...
1
vote
2answers
28 views

Looking up strings by an index

I'm using \pgfplotsinvokeforeach{0,1,2} {...} and would like to somehow dispatch on #1 to get one of three strings: $s_A$ if #1 == 0 $s_B$ if #1 == 1 $s_C$ if #1 == 2 Is there an easy way to do ...
1
vote
1answer
43 views

PGFplots: fixed scale and fixed dimension

I have two pgfplots axes next to each other with the same dimensions. The axes should be aligned and use the same axis scaling. This leads to a situation where I specify width, height and the x and y ...
0
votes
2answers
43 views

Symbolic Coordinates not showing

So I'm just learning LaTeX so I'm sorry if this is a dumb question, but i've read the manual, watched youtube videos and read blogs and I still can't figure out why this is not working. I want to do a ...
0
votes
1answer
49 views

Bar plot with pgfplots: fit all bars on x axis

This is the result so far: \documentclass[border=10pt]{standalone} \usepackage{graphicx} \usepackage{pgfplots} \pgfplotsset{width=7cm,compat=1.8} \begin{document} \begin{tikzpicture} \begin{axis}[...
0
votes
1answer
70 views

PGFPlots: adding points and managing the labels

I want to draw following with Tikz/PGFplots: X = 0:12. Y = 0:30. \documentclass[10pt]{article} \usepackage{pgfplots} \pgfplotsset{compat=1.15} \usepackage{mathrsfs} \usepackage{float} \usetikzlibrary{...
1
vote
2answers
48 views

Can I add a table through PGF \nextgroupplot functionality?

I have made a minimal working example which shows how far I am right now: \RequirePackage{luatex85} \documentclass[tikz]{standalone} % Default preamble \usepackage{pgfplots} \pgfplotsset{compat=newest}...
1
vote
1answer
62 views

Draw “less than functions” in tikz graph [duplicate]

I would like to know how to draw the "less than" or "greater than" lines in a tikz graph. i found this nice graph but am unable to draw the "zebra-lines". Is there a ...
0
votes
1answer
23 views

Let custom mark depend on a variable

I am trying to create a custom mark to use in a scatterplot. pgfplots: problem in the legend using custom marks has provided a hint on how to proceed but I do not know how to make this mark depend on ...