I'm trying to shade in one third of this circle. Obviously, it's not working. What did I do wrong?
I got no error messages for either of my attempts in the code below, but neither filled anything in. Both just gave this circle.
\documentclass[12pt,letterpaper]{article}
\usepackage{tikz}
\usepackage{xcolor}
\begin{document}
How to shade in $\frac{1}{3}$ of this?
\begin{tikzpicture}
\draw (0,0) circle (3cm);
\draw (90:3)--(0,0);
\draw (210:3)--(0,0);
\draw (330:3)--(0,0);
\fill[gray] arc[start angle=-30, end angle =90, radius=3cm];
\end{tikzpicture}
% In this attempt, I put the color=gray part in the same square brackets as all the other stuff.
\begin{tikzpicture}
\draw (0,0) circle (3cm);
\draw (90:3)--(0,0);
\draw (210:3)--(0,0);
\draw (330:3)--(0,0);
\fill arc[color=gray, start angle=-30, end angle =90, radius=3cm];
\end{tikzpicture}
\end{document}
Best Answer
Considering the intended application, the following may be a useful starting point...
For more general shapes, one can assume that each division is the same shape (if it isn't it's going to get tricky). So, the minimum that is required is
Here is a reasonably general solution illustrated with a triangle style:
Reusing the
fraction
pic defined above (not shown below), it is then possible to be a bit more extravagant: