18

Considering the intended application, the following may be a useful starting point... \documentclass[tikz, border=5]{standalone} \newcount\segmentsleft \tikzset{pics/.cd, circle fraction/.style args={#1/#2}{code={% \segmentsleft=#1\relax \pgfmathloop \ifnum\segmentsleft<1\else \ifnum\segmentsleft<#2 \edef\n{\the\segmentsleft}\else\def\n{#2}\fi \...


15

Since pgfplots version 1.10 you can load library fillbetween: \documentclass{article} \usepackage{pgfplotstable} \pgfplotsset{compat=1.15}% current version is 1.15 \usepgfplotslibrary{fillbetween} \usepackage{filecontents} \begin{filecontents}{data.dat} 0 0.2 1 0.217 2 0.255 3 0.288 6 0.58 7 0.91 8 1.02 10 1.05 12 0.92 13 0.78 15 0.56 17 1.1 \end{...


15

Each "blob" can be drawn using a technique taken from this answer, but modified to use Hobby package which produces smoother results. In the next example I define a pic which draws one of these "blobs". Being a pic is very easy to rotate, scale and translate the shape, so I draw 35 of them in a regular grid. Instead of a regular grid you can use the random ...


12

The graph with "0" is out-of-bound in your plot ;-). If you change the second addplot+ to \addplot+[draw=none,name path=B, domain=500:1000, mark=none] {-130}; You'll have your shading. ...but BTW, if you use a fill opacity option: \addplot+[gray, fill opacity=0.4] fill between[of=A and B,soft clip={domain=500:1000}]; the result is much more sexy (in ...


11

Here is a suggestion using the fillbetween library and soft clip to domain y: \addplot[thick,name path=P] ({.5*(x-2)^2+.5},{x})node[pos=0.92,above]{x=f(y)}; \addplot[thick,name path=Q]({-.3*(x-2)^2+2},{x})node[pos=0.94,above]{x=g(y)}; \addplot[red!80!black!40] fill between [of=P and Q, soft clip={domain y=\C:\D},reverse=true]; Code: \documentclass[margin=...


11

There are really two problems. The first is that the arc construction must follow a coordinate specification. You cannot start an arc from nowhere. \documentclass[tikz,border=10pt,multi,12pt]{standalone} \begin{document} \begin{tikzpicture} \draw (0,0) circle (3cm) (90:3)--(0,0) (210:3)--(0,0) (330:3)--(0,0); \fill [gray] (330:3) arc[start ...


11

Use the even odd rule. Also, I changed to 1.14 just to compile in my local machine \documentclass[12pt]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \usetikzlibrary{patterns} \pgfplotsset{compat=1.14} %\usepackage{fouriernc} \begin{document} \begin{tikzpicture} \begin{axis}[ axis line style = very thick, axis lines = ...


11

Just for fun and learn, an option using let to calculate the angle of the shadow lines to draw from the top and bottom of the sun to certain distance to the planet (0,2) -- +(-\n1:9.5), then save this coordinate as coordinate (a) and the other from (0,-2) -- +(\n1:9.5) save as coordinate (b) to draw easily the shadow using the coordinates of the moon, also ...


10

I think pgfplots is too powerful for such simple three circles. Here is a normal TikZ solution. \documentclass[12pt,tikz]{standalone} \usetikzlibrary{patterns,arrows.meta} \usepackage{fouriernc} \begin{document} \begin{tikzpicture}[very thick,>=Stealth, dot/.style={circle,fill,inner sep=2pt}] \draw [pattern=north east lines] circle (4); \draw [fill=...


10

Note #1: your MWE is not complete: it requires the pgfplots package and the intersections TikZ library. Note #2: to avoid warnings, you must add the fill between/on layer=main option. First Version You can use a clip operation to limit the effect of the \tikzfillbetween macro: \documentclass{standalone} \usepackage{tikz,pgfplots} \usetikzlibrary{arrows,...


9

I think your case doesn't work as expected, because you draw all Gaussian plots in the full domain (from 1 to 4.5) and so a lot of points are very near together (at y = 0) which I think makes it really hard for TikZ/PGFPlots to calculate the intersections. When you provide a unique domain to each \addplot this has two advantages. The lines near y = 0 don't ...


8

You can use intersection segments: \fill[ intersection segments={ of=A and B, sequence={L1--R1[reverse]} }, pattern=north east lines, ]-- cycle; L1 is the first segement of the left path (in the example path A) and R1[reverse] is the reversed first segment of the right path (in the example path B). Code: \documentclass{article} \...


8

Here a workaround, you can divide your area on two parts: first between curve A and C, and the second between A and B and use soft clip to limit filling \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines=middle, xmin=-0.5,xmax=3.5,ymin=-0.5,...


8

This is because "scoping" is not allowed when layers are used which is true when you use fill between. As the PGFPlots manual (v1.15) states in section 4.27.2 (on page 407) Limitation: no environments or local TeX groups allowed. Standard usages as within the examples of this manual will always work. But since the layer name configuration is essentially ...


8

Here is another suggestion using nodes instead circles and the tangent cs: \documentclass[a4paper,twoside]{article} \usepackage{tikz} \usetikzlibrary{backgrounds} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \newcommand\winkel{75} \path[nodes={circle,outer sep=0pt}] (0,0) node(sonne)[fill=yellow,minimum size=4cm]{} (sonne.\winkel) ...


7

That is a bug in the intersections library of tikz/pgf as can be seen in the following minimal example. \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{intersections} \pgfplotsset{compat = newest} \begin{document} \begin{tikzpicture}[font=\normalsize] \gdef\softclippath{(axis cs:5,-1000) rectangle (axis cs:6,30000)} \begin{...


7

You can use intersection segments: \documentclass[margin=5pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.11} \usepgfplotslibrary{fillbetween} \begin{document} \begin{tikzpicture} % \pgfdeclarelayer{pre main} \pgfsetlayers{pre main,main} % \begin{axis}[axis equal,no markers,hide axis,samples=100] \addplot+[domain=360:0,name ...


7

fillbetween allows you to split the filling into the different segments made by intersections, and add individual styles to each, so you can do e.g. \addplot fill between[ of=A and B, split, every segment no 0/.style={pattern=north east lines}, every segment no 1/.style={fill=none}]; \documentclass{article} \usepackage{tikz,pgfplots} \...


7

You can fill the areas in layer axis background. Then their filling is behind the grid. Maybe its possible to use slightly different colors for the filling. Then you can fill the are between the curves with a color and then fill the area between one of the curves and the x axis white. In the last step you can color the area between the curves with a second ...


7

As an alternative you could consider drawing the left part with two tape nodes. This nodes accept a minimum width parameter but not minimum height, therefore I've forced their size with a phantom \rule as node contents. \documentclass[tikz,border=2mm]{standalone} \usetikzlibrary{positioning, arrows.meta, patterns, decorations.pathmorphing, intersections, ...


7

Adaptions: Set min=0,xmax=1,ymin=0,ymax=1 to get the desired area of the plots. Remove axis lines=middle to get default axis (rectangle around plots). Use \addplot [fill=blue!10] fill between[of=F and G]; to fill area between plots F and G. Code: \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.10} \usepgfplotslibrary{...


6

I did manage to get the tikz code working. Below is the code. Thanks for the hints everyone. \documentclass[tikz,border=5pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \usepgfplotslibrary{fillbetween} \usepgfplotslibrary{polar} \begin{document} \begin{tikzpicture}[scale=0.5] \begin{polaraxis}[hide axis] \begin{scope}[] ...


6

In the meantime, here is a solution with MetaPost. Since the syntax of Tikz and MetaPost have many similarities, it may help to provide the desired solution. The key point is to append the two spirals (one of them reverted), close the resulting path (--cycle instruction) and then fill it: fill spiral1--reverse spiral2--cycle withcolor .8white; I have ...


6

This looks a lot like a bug. You can work around it by not using the domain option to specify the soft clip, but instead using the rectangle option like so: soft clip={(axis cs:\qqq,0) rectangle (axis cs:\pgfkeysvalueof{/pgfplots/xmax},\pgfkeysvalueof{/pgfplots/ymax}*1.1)} Note that the upper right-hand corner of the rectangle has to be higher than the ...


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