Graphics, Figures & TablesColoring regions with Pstricks

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
eakyar
Posts: 2
Joined: Wed May 25, 2011 12:34 pm

Coloring regions with Pstricks

Post by eakyar »

Hi all,

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

Recommended reading 2024:

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

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

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Coloring regions with Pstricks

Post by localghost »

A complete but minimal example would be the first step to get closer to a solution.


Best regards and welcome to the board
Thorsten
eakyar
Posts: 2
Joined: Wed May 25, 2011 12:34 pm

Coloring regions with Pstricks

Post by eakyar »

Dear Thorsten,

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} 
Post Reply