4

Here's an alternative solution with pgfplots, I haven't changed your plot command. Output Code \documentclass[margin=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.17} \begin{document} \begin{tikzpicture} \begin{axis}[% domain=-1:6, yscale=2, axis lines=middle, xlabel={\large $x$}, ...


4

Culprits of your problem is \x^2 in your function. Correct is (\x)^2. Try: \documentclass[tikz,border=2mm]{standalone} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[ arr/.style = {very thick, draw=gray, -{Straight Barb[length=1mm]}}, domain=-1:6, samples=70 ] \draw[very thin, color=green, step=0.2cm](-2,-3) ...


2

TikZ has a function to invoke a command multiple times. It's called with \foreach \i in {1,...,10}{ do something }. Unfortunately, inside the axis environment, this function has some problems, thus the use of \pgfplotsinvokeforeach{1,...,10}{ do something } is encouraged. Using this as a starting point, I calculated an increment for your arrows, e.g. (18....


2

Well, I'm not sure if intersection segments is a bit buggy, because some paths are being added that shouldn't be there and that make this process harder than it should be. Or maybe it's just hard to use. See here: As you can notice, we could do L1--L0--R0 but these lines create issues as without them, the fills will have thin holes (the lines that my arrows ...


2

You can add lines within the axis environment using: \draw (axis cs:x1,y1)--(axis cs:x2,y2); With (x1,y1) and (x2,y2) the coordinates of your lines. In the axis environment, you can fill the area between paths. Start by creating paths: \path[name path = name_of_your_path] (axis cs:x1,y1) -- (axis cs:x2,y2); Then fill the area between two paths: \addplot [...


2

1- For Dec, add a dummy value with zero to the symbolic x coords, say a. 2- For a minor grid lines, use grid style and major grid style options in axis environment, like: grid=major, grid=both, grid style={line width=.1pt, draw=gray!30}, major grid style={line width=.2pt,draw=gray!60}, minor tick num=5 Also add xmin=Jan, xmax=a, ymin=0, ymax=5 3- For ...


2

You can draw arrows precisely following a path at a specific place using path decorations based on this answer. I define the blue curves using parametric representation in \addplot inside the axis environment. The sine function makes it easy to obtain the wave shape (\addplot[domain=...] ({0.25 - 0.2*sin(120*x)}, 18.300 - x)). The arrows are placed according ...


1

You could draw the second axes with specified dimensions in the same tikzpicture: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis} \addplot3[surf, samples=5, patch type=rectangle, opacity=.8, domain=-1.5:1.5, y domain=-1.5:1.5] ({x},{y},{x+y}); \node [circle,fill,inner sep=...


1

Don't ask me too much why, but after reading the pgfplots manual trying to find out why your example doesn't work, I discovered that colormap access=direct works fine here if one uses \addplot[point meta=explicit symbolic, ...] table[meta index=2] .... Using explicit instead of explicit symbolic brings back the same error as in your example. I find this is a ...


1

Full PGF-TikZ solution I was searching a full PGF-TikZ solution. I got it by the following ideas and the help of pgfplots and pgfplotstable packages. A straight line function between A(a1,a2) and B(b1,b2) is defined (as g.kov's answer) by f(x)=(x-a1)/(a2-a1)*(b2-b1)+b2 To plot "piece by piece" the composition function g(f(x)) (here g(x)=2^x). ...


1

This is one way such piecewise plot can be constructed in Asymptote: // // "gpiecewise.asy" // // run // asy gpiecewise.asy // // to get a standalone // "gpiecewise.pdf" // settings.tex="pdflatex"; import graph; import math; import fontsize;defaultpen(fontsize(8pt)); texpreamble("\usepackage{lmodern}"+"\...


1

If I understand correctly, you want to achieve the result from below (and your question is a duplicate). Maybe I do not understand, as you want the intersection points for something!? -also you are not using PGFPlots or fillbetween at all. \documentclass[tikz, border=1 cm]{standalone} \begin{document} \begin{tikzpicture} \draw (1,0) circle (2cm); \draw plot[...


1

You need to expand \clabel as the argument for \addlegendentry, since the legend itself is created after the plots are complete. By that point, the local value of \clabel has been lost. \documentclass[tikz,border=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{ compat=1.16, } \begin{document} \begin{tikzpicture} \begin{axis}[] \foreach ...


Only top voted, non community-wiki answers of a minimum length are eligible