python - Matplotlib.pyplot:如何增加 streamplot 产生的流线的长度?
问题描述
运行此 python 代码:
import matplotlib.pyplot as plt
import numpy as np
nx = 128
x_min = -2
x_max = 2
x = np.linspace(x_min, x_max, nx)
ny = 128
y_min = -2
y_max = 2
y = np.linspace(y_min, y_max, ny)
X, Y = np.meshgrid(x, y)
U = -Y
V = X
fig = plt.figure()
ax = fig.add_subplot(111)
ax.streamplot(X, Y, U, V, density = 0.5)
ax.set_xlim(x_min, x_max)
ax.set_ylim(y_min, y_max)
ax.set_aspect('equal')
plt.savefig('circle_streamlines.png')
解决方案
推荐阅读
- javascript - 得到已由 setAttribute() 使用 getElementById() 动态设置的 ID
- javascript - 未捕获的类型错误:file.open 不是函数
- python - python中深度图的表面法线计算
- java - AWS Elastic Beanstalk - tomcat java spring boot 应用程序的问题
- php - 无法从表单接收电子邮件地址
- python - 多次查找真值的数量
- ios - TableView中的搜索栏无法调用数组
- xml - 如何在 XSL 中显示图像
- javascript - 在 JavaScript 中获取“未捕获的 SyntaxError:无效或意外令牌”
- android - 使用 FCM 在 Android 中自定义点对点通信