Graphics, Figures & Tables ⇒ Coloring regions with Pstricks
Coloring regions with Pstricks
I would like to colored the regions formed by many circles in the plane such a way that any two regions that share a common boundary arc will be colored differently.
It is very difficult task via \pscustom command. Because, first I have to calculate the each intersection point and angles.
Are there another easy way?
Best wishes,
Emrah Akyar
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Coloring regions with Pstricks
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Coloring regions with Pstricks
I have prepared an example with just 3 circles. It was really difficult. I have calculated each intersection point and angle.
I wonder that is it possible to get same output easily?
Emrah
Code: Select all
\listfiles
\documentclass{article}
\usepackage{pstricks}
\begin{document}
\begin{pspicture}(0,0)(6,5)
\psset{fillstyle=solid,linewidth=0pt}
\psframe[fillcolor=blue](0,0)(6,5)
\pscircle[fillcolor=red](2,2){1.5}
\pscircle[fillcolor=red](4,2){1.5}
\pscircle[fillcolor=red](3,3){1.5}
\pscustom[fillcolor=blue]{
\psarc[linewidth=3pt](4,2){1.5}{197}{229}
\psarc[linewidth=3pt](2,2){1.5}{312}{343}
\psarcn[linewidth=3pt](3,3){1.5}{287}{253}
}
\pscustom[fillcolor=blue]{
\psarc(3,3){1.5}{-73}{17}
\psarc(4,2){1.5}{73}{131}
\psarcn(2,2){1.5}{48}{-17}
}
\pscustom[fillcolor=blue]{
\psarcn(4,2){1.5}{-163}{131}
\psarc(2,2){1.5}{48}{106}
\psarc(3,3){1.5}{163}{-107}
}
\end{pspicture}
\end{document}