Grafici con Tikz numero 18

Linguaggio LaTeX

Home » Grafici con Tikz numero 18
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
post
page


Prima di ogni figura ricordare di mettere

\documentclass[usenames,dvipsnames]{article}
\usepackage{pgfplots}

Figura

Rendered by QuickLaTeX.com

codice figura

\begin{tikzpicture}
\begin{axis}[
scale=2,
axis x line=center,
axis y line=center,
xmin = -4.5,
xmax = 4.5,
ymin = -4.5,
ymax = 4.5,
xlabel = {$x$},
ylabel = {$y$},
extra x ticks = {0},
extra x tick label = {$\hspace{0.5cm}O$},
axis equal image,
axis on top,
disabledatascaling
]

\addplot[ultra thick] coordinates {(0,s{qrt(2)}) (0,{sqrt(12)})};
\addplot[ultra thick] coordinates {(1,1) (1,{sqrt(11)})};
\addplot[ultra thick, dashed] coordinates {(1,1) (1,0)};
\addplot[ultra thick, dashed] coordinates {({sqrt(3)},0) ({sqrt(3)},3)};

\draw[ultra thick,color=red] (axis cs:0,0) circle[radius=sqrt(2)];
\draw[ultra thick,color=red] (axis cs:0,0) circle[radius=sqrt(12)];
\addplot[draw=none,name path=smallcircle, domain=-sqrt(2):sqrt(2), samples=100] {sqrt(abs(2-x^2))};
\addplot[draw=none,name path=largecircle, domain=-sqrt(12):sqrt(12), samples=100] {sqrt(abs(12-x^2))};
\addplot[ultra thick,color=blue,samples=100,domain=-3:3,name path=parabola] {x^2};

\addplot[Goldenrod!50] fill between[of=parabola and largecircle, soft clip={domain=-3^0.5:-1}];
\addplot[Goldenrod!50] fill between[of=smallcircle and largecircle, soft clip={domain=-1:1}];
\addplot[Goldenrod!50] fill between[of=parabola and largecircle, soft clip={domain=1:3^0.5}];
\addplot[pattern=dots] fill between[of=smallcircle and largecircle, soft clip={domain=0:1}];
\addplot[pattern=north east lines] fill between[of=parabola and largecircle, soft clip={domain=1:3^0.5}];
% \addplot[Purple!50] fill between[of=parabola and largecircle, soft clip={domain=1:3^0.5}];
% \addplot[BurntOrange!50] fill between[of=parabola and largecircle, soft clip={domain=-3^0.5:-1}];
% \addplot[BurntOrange!50] fill between[of=smallcircle and largecircle, soft clip={domain=-1:0}];
% \addplot[SeaGreen!50] fill between[of=smallcircle and largecircle, soft clip={domain=0:1}];
% \addplot[Purple!50] fill between[of=parabola and largecircle, soft clip={domain=1:3^0.5}];

\addplot[mark=*] coordinates {(1,0)};
\addplot[mark=*] coordinates {(sqrt(12),0)} node[above right] {$\sqrt{12}$};
\addplot[mark=*] coordinates {(sqrt(3),0)} node[above right] {$\sqrt{3}$};
\addplot[mark=*] coordinates {(0,{-sqrt(2)})} node[below right] {$-\sqrt{2}$};
\addplot[blue] coordinates {(2.25,3.75)} node[rotate=71.6] {$y=x^2$};
\addplot[draw=none] coordinates {(-0.85,2.3)} node {$D$};
\addplot[draw=none] coordinates {(0.5,2.5)} node {\colorbox{Goldenrod!50}{$D_1$}};
\addplot[draw=none] coordinates {(1.3,2.7)} node {\colorbox{Goldenrod!50}{$D_2$}};

\setlength{\fboxsep}{0.75pt}
\addplot[draw=none] coordinates {(0.9,3.5)} node[rotate=165] {$\underbrace{\phantom{xxxxxxxxxx}}$};
\addplot[draw=none] coordinates {(1.0,3.85)} node {$D^+$};
\end{axis}

\end{tikzpicture}