On 2/18/12 7:30 PM, Goebbe wrote:
Using sage 4.8 in the notebook environment I have problems to scale
polygons:

For example, the following code generates a graphs that seems to be to
small (not high enough):

polygon2d([[0,0],[0,1],[-1,0]], rgbcolor=(1,0,1),xmin=-4, xmax=4,
ymin=0, ymax=1)

Use aspect_ratio='automatic'. By default, polygon aspect ratio is 1 (i.e., 1 unit in the x direction is the same as 1 unit in the y direction).

http://aleph.sagemath.org/?z=eJwViFEKgCAQBa_iXwUruNGvJxEJswhBWzEDvX3rz8yblyn2m571nI1RoCwwkSmRw4Io9-EpUtEzH4ALtBQeLTcQLbmm2X0capgbQbg3X77uxdVAenJfpcTTT8sP3LMhpQ



The final goal is to fill (non trivial) areas in plots, but when
trying this the plots are much too small.
here is the large example:
signi = 0.1
lu = NV01.cum_distribution_function_inv(signi/2)
lo = NV01.distribution_function(lu)
ru = NV01.cum_distribution_function_inv(1-(signi/2))
ro = NV01.distribution_function(ru)
p = NV01.plot((x,-4,4), fill='axis',fillcolor='blue',fillalpha='0.2')
p += polygon([(lu,0),(lu,NV01.distribution_function(lu))] +
[(x,NV01.distribution_function(x)) for x in [lu-0.1,lu-0.2,..,-2]] +
[(-4,0),(lu,0)], rgbcolor=(1,0,0), alpha=0.3)
p += polygon([(ru,0),(ru,NV01.distribution_function(ru))] +
[(x,NV01.distribution_function(x)) for x in [ru+0.1,ru+0.2,..,2 ]] +
[ (4,0),(ru,0)], rgbcolor=(1,0,0), alpha=0.3)
p.show()


This doesn't work for me because you do not define NV01. My guess is that if you use p.show(aspect_ratio='automatic'), it will look right.

This change to default aspect ratio for polygons was merged in 4.8:

http://trac.sagemath.org/sage_trac/ticket/12222

Do you think that the aspect ratio for polygons should not default to 1?

Thanks,

Jason

--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to