Ask Your Question

# How to plot TWO polygons in ONE (2d) graphic?

Hi! I'd like to plot some Polygons. Plotting every single polygon works fine, but i want to plot two Polygons in one 2d graphic; with different Colors. I tried it with polygon() and polygon2d(), but it seems that they can only plot one polygon. Has anyone here an idea how to solve that?

edit retag close merge delete

## 2 answers

Sort by » oldest newest most voted

According to the Sage tutorial:

You can combine several plots by adding them.

So try:

sage: P = polygon([(0,0), (1,1), (0,1)])
sage: Q = polygon([(1,0), (1,1), (1.5,2)], color='red')
sage: C = circle((0,1), 2)
sage: P + Q + C

more

Wow!

Thx a lot! I tried so many difficult things... and your solution is so easy.

Thank you very much!

more

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2014-01-08 05:09:50 -0500

Seen: 343 times

Last updated: Jan 08 '14