PtQt5及Matplotlib学习经验汇总(二)

目录

一、在PyQt5设计的GUI界面中显示matplotlib绘制的图形

self.verticalLayout_21.addWidget(self.ntb)  # 工具条布局
self.verticalLayout_21.addWidget(self.canvas)  # 画布布局
  • 参数介绍:无

二、曲线拟合方法的使用(S-G平滑去燥)

# 插值拟合坐标值
def interpolate(self):
     # TODO 第二种拟合方法:贝塞尔插值拟合:精度比之前高
     x, y = self.x,self.y
     i = np.arange(len(x))
     interp_i = np.linspace(0, i.max(), self.density * i.max())
     # 三次样条插值法
     xi = interp1d(i, x, kind='cubic')(interp_i)
     yi = interp1d(i, y, kind='cubic')(interp_i)
     data_count = len(xi)
     self.lineEdit_p_num.setText(str(data_count))
     return xi, yi
  • 参数介绍:无

三、matplotlib 使用简明教程(四)-辅助性元件

四、向量的点乘、叉乘以及点到直线的距离计算

def dist(x, y):
    d = x - y
    return np.sqrt(np.dot(d, d))
def dist_point_to_segment(p, s0, s1):
    p = np.array(p)
    s0 = np.array(s0)
    s1 = np.array(s1)
    v = s1 - s0
    w = p - s0
    c = np.dot(w, v)
    d_init = dist(s1,s0)
    d_long = dist(p,s0)
    d_heng = c/d_init
    d = np.sqrt(d_long**2-d_heng**2)
    return d
  • 参数介绍:无

五、matplotlib 使用简明教程(四)-辅助性元件

六、matplotlib 使用基础汇总

七、Python–读写CSV文档

八、Python绘图总结(Matplotlib篇)之坐标轴及刻度

九、B样条曲线拟合原理

十、Python matplotlib高级绘图详解

十一、调用smooth函数进行加噪数据的平滑处理

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值