python matplotlib频率分布(累计)直方图

先上效果图

代码:

import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib.ticker import MultipleLocator


class Histplot:
    def __init__(self, y_data, x_data, linetype='ro-', legends=None,title=None, xlabel=None,
                 ylabels=None, fsize=(20, 15), df_line=1):
        """
        :param x_data: 数据x列表
        :param x_data: x的分组数
        :param linetype: 累计频率曲线的样式,默认为红色实心点
        :param legends: 图例名,默认为 "线性拟合结果", "实测值"
        :param xlabel:x坐标轴标题名,默认为 "数据x"
        :param ylabels:双y坐标轴标题名,默认为 "计数", "累计频率"
        :param df_line:是否显示累计频率曲线
        """
        if legends is None:
            legends = ["频率", "累计频率"]
        if xlabel is None:
            xlabel = "延时"
        if ylabels is None:
            ylabels = ["频率", "累计频率"]
        self.y_data = y_data
        self.x_data = x_data
        self.linetype = linetype
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值