Ask Your Question
0

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

asked 11 years ago

alexm gravatar image

updated 10 years ago

FrédéricC gravatar image

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?

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
4

answered 11 years ago

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
Preview: (hide)
link
0

answered 11 years ago

alexm gravatar image

Wow!

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

Thank you very much!

Preview: (hide)
link

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 11 years ago

Seen: 915 times

Last updated: Jan 08 '14