Graphics, Figures & Tablesfilling a region

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
kent
Posts: 57
Joined: Thu Oct 20, 2016 3:41 pm

filling a region

Post by kent »

See the attached latex code where I would like to shade the region between the drawn parabola and ellipse.
Anybody knoes how to do this?
I have tried several combinations using \clip, \scope etc. without success.
Best regards,
Kent
Attachments
forum.tex
(1005 Bytes) Downloaded 302 times
forum.pdf
(3.88 KiB) Downloaded 206 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10329
Joined: Mon Mar 10, 2008 9:44 pm

filling a region

Post by Stefan Kottwitz »

Hi Kent,

start, filling between ellipse and parabola2, adding:

Code: Select all

\begin{scope}
  \clip (S) ellipse (\a cm and \b cm);
  \filldraw[rotate=90,fill=yellow] (T) parabola (PP2) -- (9,0);
\end{scope}

Stefan
LaTeX.org admin
kent
Posts: 57
Joined: Thu Oct 20, 2016 3:41 pm

filling a region

Post by kent »

Stefan, thanks for help!
May be I was not precise enough to define what I wanted to achieve.
I want the shading to be as indicated in black in the attached file.
Kent
Attachments
image2017-11-02-191233.pdf
(51.41 KiB) Downloaded 198 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10329
Joined: Mon Mar 10, 2008 9:44 pm

filling a region

Post by Stefan Kottwitz »

Ok, then this should do it:

Code: Select all

\begin{scope}
  \clip (S) ellipse (\a cm and \b cm);
  \filldraw[rotate=90,fill=yellow] (T) parabola (PP2) -- (-5,0);
  \filldraw[rotate=90,fill=yellow] (T) parabola (PP)  -- ( 5,0);
\end{scope}
ellipse.png
ellipse.png (11.45 KiB) Viewed 2775 times
Stefan
LaTeX.org admin
kent
Posts: 57
Joined: Thu Oct 20, 2016 3:41 pm

filling a region

Post by kent »

Thank you very much!
Your support is highly appreciated.
Post Reply