python plotly smith 图表函数行为与 scikit-rf 不同

标签 python plotly

有人可以解释为什么这两个 smith chart plot function for exactly same circle of plotly 和 scikit-rf 如此不同吗? 我怎样才能像 scikit-rf 那样绘制 plotly plot,因为我需要从 smith chart 读取值,而 scikit-rf plot 并不容易?

def calc_circle(c, r):
  theta = np.linspace(0, 2*np.pi, 1000)
  return c + r*np.exp(1.0j*theta)

c,r=0.4,0.2
fig = go.Figure(go.Scattersmith(imag=np.imag(calc_circle(c, r)), real=np.real(calc_circle(c, r)),marker_color="green",showlegend=True,name='Hello'))
fig.show()

This is what plotly plot

    n = rf.Network(name="out", s=calc_circle(c, r))
    n.plot_s_smith(lw=2,draw_labels=True)

This is what scikit-rf plot

最佳答案

Plotly Scattersmith 要求以归一化阻抗值而不是反射系数值的形式提供图像和实际数据。这意味着您的函数 calc_circle 的结果需要使用简单公式 z = (1 + rho)/(1 - rho) 进行转换,其中 z 是归一化阻抗,rho 是您使用 calc_circle 函数获得的反射系数。

关于python plotly smith 图表函数行为与 scikit-rf 不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70649445/

相关文章:

python - 使用 Python 将数百万条记录插入 MySQL 数据库

python - 如何在 Zeppelin 中使用 Plotly

python - Plotly 不显示轴标签或标题

python - Plotly Choropleth Map Plots 的下拉菜单

python - 将 Python MeshGrid 拆分为单元格

python - Pandas 在多索引中连接级别

python - Flask 蓝图找不到静态文件夹

python - argparse subparser --help 输出不显示子解析器的描述

Python/plotly : How to print y-trend values from LOWESS line?

javascript - 如何在绘图中设置小刻度