I want to create a picture like the one attached below using tikzpicture. I could only draw two concentric circles. How do I colour them as in the picture?
Can anyone help me? I am pretty new to usage of TikZ.
I want to create a picture like the one attached below using tikzpicture. I could only draw two concentric circles. How do I colour them as in the picture?
Can anyone help me? I am pretty new to usage of TikZ.
Here is a suggestion using the even odd rule to fill the orange area, i.e. the rectangle without the outer circle.
\documentclass[margin=5mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\path[fill=orange,even odd rule]
(-4, -4) rectangle (4,4)
(0,0)circle[radius=2]
;
\path[fill=blue]
(0,0) circle [radius=1.5]
;
\path[draw,very thick]
(0,0) foreach \r in {1.5,2}{circle [radius=\r]}
;
\end{tikzpicture}
\end{document}
A PSTricks solution:
\documentclass{article}
\usepackage{pstricks}
\begin{document}
\begin{pspicture}(4,3)
\psset{fillstyle = solid}
\psframe[fillcolor = orange](0,0)(4,3)
\pscircle(2,1.5){1}
\pscircle[fillcolor = cyan](2,1.5){0.8}
\end{pspicture}
\end{document}
In case you want the fill color of the ring to be the same as the background color, you can do the following:
\documentclass{article}
\usepackage{pstricks}
\usepackage{pagecolor}
\def\bgcolor{green!50} % background color
\pagecolor{\bgcolor}
\begin{document}
\begin{pspicture}(4,3)
\psset{fillstyle = solid}
\psframe[fillcolor = orange](0,0)(4,3)
\pscircle[fillcolor = \bgcolor](2,1.5){1}
\pscircle[fillcolor = cyan](2,1.5){0.8}
\end{pspicture}
\end{document}
I think it's easiest to do this by shading the whole picture, and then drawing a white circle and a blue one.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
% fills entire rectangle
\fill[orange] (-4, -4) rectangle (4,4);
% removes filling inside circle
\filldraw[fill=white, draw=black, very thick] (0,0) circle (2cm);
% adds blue circle
\filldraw[fill=blue, draw=black, very thick] (0,0) circle (1.5cm);
\end{tikzpicture}
\end{document}
\filldraw[blue] (0,0) circle (1cm);does not work? I assume, you meanfill, not shading – Apr 17 '16 at 19:56...before they can even see what the problem is with the last arrow, which they might not be able to help with anyway. ;) – cfr Apr 17 '16 at 20:23