使用plotly绘制y=3x^2的曲线x范围为0到10间距05图片尺寸为600X600pxX轴名称空气流量$q$Y轴名称压力$p$曲线颜色为红色
import plotly.graph_objs as go
import numpy as np
x = np.arange(0, 10.5, 0.5)
y = 3 * x ** 2
fig = go.Figure(
go.Scatter(x=x, y=y, mode='lines', line=dict(color='red'))
)
fig.update_layout(
width=600,
height=600,
xaxis_title='空气流量$q$',
yaxis_title='压力$p$'
)
fig.show()
结果如下:

原文地址: https://www.cveoy.top/t/topic/bekT 著作权归作者所有。请勿转载和采集!