I am trying to achieve the following picture using tikzpicture
environment:
The inner circle is x^2+y^2=1
and the other is x^2+y^2=4
.
What I have tried:
\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[a4paper,margin=1in,footskip=0.25in]{geometry}
\usepackage{amsmath}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\usepgfplotslibrary{fillbetween}
\begin{document}
\begin{center}
\begin{tikzpicture}
\begin{axis} [
axis on top,
axis lines = center,
axis equal image,
xticklabel style = {font=\tiny},
yticklabel style = {font=\tiny},
xlabel ={$\Re(z)$},
xtick={1,2},
ytick={1,2},
ylabel ={$\Im(z)$},
legend pos=outer north east,
legend style={cells={align=left}},
legend cell align={left},
clip=false
]
\addplot[very thick,red,smooth,domain=0:2*pi,dotted] ({cos((x) r)},{sin((x) r)});
\addplot[very thick,red,smooth,domain=0:2*pi,dotted] ({2*cos((x) r)},{2*sin((x) r)});
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}
I want to add pattern lines for x^2+y^2>1
and x^2+y^2>4
, but I do not know how to do it.
As a help you can rely on this example that I made a while ago:
\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[a4paper,margin=1in,footskip=0.25in]{geometry}
\usepackage{amsmath}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}
\usetikzlibrary{arrows.meta, patterns}
\begin{document}
\begin{center}
\begin{tikzpicture}
\pgfplotsset{ticks=none}
\begin{axis}[
axis equal image,
axis lines = center,
xlabel = $x$,
ylabel = $y$,
xmax=3,
xmin=-3,
legend pos=outer north east,
axis background/.style={%
preaction={
path picture={
\draw[pattern=north west lines, pattern color=red,draw=white] (axis cs:1,-3) rectangle (axis cs:3,3);
\draw[pattern=north east lines, pattern color=blue,draw=white] (axis cs:1,3) rectangle (axis cs:-3,-3);
}}},
xtick={1,2}
]
\node at (axis cs: 2,2.6) {$x^2+y$};
\node at (axis cs: -2,2.6) {$3x-y$};
\addplot[very thick, red] coordinates {(1,-3) (1,3)};
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}