Python,绘图外推图形以获得Yaxis截距

2024-04-30 03:11:15 发布

您现在位置:Python中文网/ 问答频道 /正文

是否可以外推绘图仪以获得Y轴截距

这是我的代码,我使用了Plotly express,但也可以使用其他类型:

import pandas as pd
import numpy as np
import plotly.express as px
a = np.array([[0.5,1,2,3,5,7], [68,54,30,18.5,6,1.8]])
a = pd.DataFrame(a.T, columns = ["t", "c"])
a.set_index("t")

fig = px.scatter(a, x= a["t"], y=a["c"], log_y=True)
fig.update_traces(mode="lines+markers")
fig.show()

enter image description here


Tags: 代码importnumpy类型pandasasnpfig