本文整理汇总了Python中sympy.Plot.adjust_all_bounds方法的典型用法代码示例。如果您正苦于以下问题:Python Plot.adjust_all_bounds方法的具体用法?Python Plot.adjust_all_bounds怎么用?Python Plot.adjust_all_bounds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sympy.Plot
的用法示例。
在下文中一共展示了Plot.adjust_all_bounds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: plot_beam
# 需要导入模块: from sympy import Plot [as 别名]
# 或者: from sympy.Plot import adjust_all_bounds [as 别名]
def plot_beam(beam, **kwargs):
"""Plot the beam radius as it propagates in space.
Uses pyglet and ctype libraries
Parameters
==========
beam : BeamParameter for gaussian beam
z_range : plot range for the beam propagation coordinate
See Also
========
BeamParameter
plot_beam2
Examples
========
>>> from sympy.physics.gaussopt import BeamParameter, plot_beam
>>> b = BeamParameter(530e-9, 1, w=1e-5)
>>> plot_beam(b,z_range=2*b.z_r)
"""
if len(kwargs) != 1:
raise ValueError("The function expects only one named argument")
elif 'z_range' in kwargs :
z_range = sympify(kwargs['z_range'])
else :
raise ValueError(filldedent('''
The functions expects the z_range as a named argument'''))
x = symbols('x')
# TODO beam.w_0 *
# pyglet needs to have better zoom adjustment for geting a normal view
weist_d = sqrt(1+(x/beam.z_r)**2)
p = Plot(visible=False)
p[1] = weist_d, 'color=black', [x, -z_range, z_range, int(beam.w_0**-1)]
p[2] = -weist_d, 'color=black', [x, -z_range, z_range, int(beam.w_0**-1)]
p.adjust_all_bounds()
p.show()