3

I'm trying to shade under a polar graph. I'm using this code:

\documentclass{exam}
\usepackage{graphicx}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}
\fill[fill=gray] plot[domain=pi/8:pi/4] (xy polar cs:angle=\x r,radius= {3*cos(pi/8 r)});
\end{tikzpicture}
\end{center}
\end{document}

The result doesn't fill all the way to the origin as it should. I'm getting this:

enter image description here

How do I make it shade all the way to the origin?

  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Adam Liter Apr 21 '15 at 1:31
  • I completed the code. – adam Apr 21 '15 at 1:42
  • 2
    Your code doesn't produce the picture in your question! The idea of MWE is to help people help you. Asking us to recreate your picture (almost) from scratch seems a little pointless... – Andrew Apr 21 '15 at 5:08
1
\documentclass{exam}
\usepackage{graphicx}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}
\fill[fill=gray] (0,0) -- ++({pi/8}:{3*cos(pi/8 r)}) plot[domain=pi/8:pi/4] (xy polar cs:angle=\x r,radius= {3*cos(pi/8 r)})--(0,0)--cycle;
\end{tikzpicture}
\end{center}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.