Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.
直方图是一个可以快速展示数据概率分布的工具,直观易于理解,并深受数据爱好者的喜爱。大家平时可能见到最多就是 matplotlib,seaborn 等高级封装的库包,类似以下这样的绘图。 本篇博主将要总结一下使用Python绘制直方图的所有方法,大致可分为三大类 ...
import matplotlib.pyplot as plt import numpy as np #在x轴上,-1~1范围内分布50个点 x = np.linspace(-1,1,50) y = x**2 #创建画布 plt.plot(x,y) #展示画布 plt.show() 散点图需要调用matplotlib中的函数plt.scatter(),其中可传入的参数有x,y,s,c,marker ...