本文整理匯總了Python中sage.plot.graphics.Graphics._extra_kwds['aspect_ratio']方法的典型用法代碼示例。如果您正苦於以下問題:Python Graphics._extra_kwds['aspect_ratio']方法的具體用法?Python Graphics._extra_kwds['aspect_ratio']怎麽用?Python Graphics._extra_kwds['aspect_ratio']使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sage.plot.graphics.Graphics
的用法示例。
在下文中一共展示了Graphics._extra_kwds['aspect_ratio']方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: plot3d
# 需要導入模塊: from sage.plot.graphics import Graphics [as 別名]
# 或者: from sage.plot.graphics.Graphics import _extra_kwds['aspect_ratio'] [as 別名]
def plot3d(self,depth=None):
# FIXME: refactor this before publishing
from sage.plot.graphics import Graphics
from sage.plot.point import point
from sage.misc.flatten import flatten
from sage.plot.plot3d.shapes2 import sphere
if self._n !=3:
raise ValueError("Can only 3d plot fans.")
if depth == None:
depth = self._depth
if not self.is_finite() and depth==infinity:
raise ValueError("For infinite algebras you must specify the depth.")
colors = dict([(0,'red'),(1,'green'),(2,'blue'),(3,'cyan')])
G = Graphics()
roots = self.d_vectors(depth=depth)
compatible = []
while roots:
x = roots.pop()
for y in roots:
if self.compatibility_degree(x,y) == 0:
compatible.append((x,y))
for (u,v) in compatible:
G += _arc3d((_normalize(vector(u)),_normalize(vector(v))),thickness=0.5,color='black')
for i in range(3):
orbit = self.ith_orbit(i,depth=depth)
for j in orbit:
G += point(_normalize(vector(orbit[j])),color=colors[i],size=10,zorder=len(G.all))
if self.is_affine():
tube_vectors=map(vector,flatten(self.affine_tubes()))
tube_vectors=map(_normalize,tube_vectors)
for v in tube_vectors:
G += point(v,color=colors[3],size=10,zorder=len(G.all))
G += _arc3d((tube_vectors[0],tube_vectors[1]),thickness=5,color='gray',zorder=0)
G += sphere((0,0,0),opacity=0.1,zorder=0)
G._extra_kwds['frame']=False
G._extra_kwds['aspect_ratio']=1
return G