ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 08 Jan 2014 08:12:53 -0600How to plot TWO polygons in ONE (2d) graphic?http://ask.sagemath.org/question/10895/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?Wed, 08 Jan 2014 05:09:50 -0600http://ask.sagemath.org/question/10895/how-to-plot-two-polygons-in-one-2d-graphic/Answer by John Palmieri for <p>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?</p>
http://ask.sagemath.org/question/10895/how-to-plot-two-polygons-in-one-2d-graphic/?answer=15895#post-id-15895According to the [Sage tutorial](http://www.sagemath.org/doc/tutorial/tour_plotting.html):
> 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
Wed, 08 Jan 2014 07:11:36 -0600http://ask.sagemath.org/question/10895/how-to-plot-two-polygons-in-one-2d-graphic/?answer=15895#post-id-15895Answer by alexm for <p>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?</p>
http://ask.sagemath.org/question/10895/how-to-plot-two-polygons-in-one-2d-graphic/?answer=15896#post-id-15896Wow!
Thx a lot! I tried so many difficult things... and your solution is so easy.
Thank you very much!Wed, 08 Jan 2014 08:12:53 -0600http://ask.sagemath.org/question/10895/how-to-plot-two-polygons-in-one-2d-graphic/?answer=15896#post-id-15896