Ask Your Question
0

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

asked 2014-01-08 12:09:50 +0200

alexm gravatar image

updated 2015-01-14 10:13:57 +0200

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?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
4

answered 2014-01-08 14:11:36 +0200

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
edit flag offensive delete link more
0

answered 2014-01-08 15:12:53 +0200

alexm gravatar image

Wow!

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

Thank you very much!

edit flag offensive delete link more

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: 2014-01-08 12:09:50 +0200

Seen: 708 times

Last updated: Jan 08 '14