我修改了scatter_hist.py示例,发现here要绘制两个数据集。
我想使用“stepfilled”类型的直方图,但是如果我设置“stepfilled”类型,则Y轴直方图(orientation=“horizontal”)不起作用。
有没有其他方法可以使直方图看起来像“逐步填充”样式,或者我做错了什么?
这是我的histtype=“bar”代码,它显示了我的想法。把它改成histtype="stepfilled"
要得到奇怪的直方图:import numpy as np
import matplotlib.pyplot as plt
# the random data
x = np.random.randn(1000)
y = np.random.randn(1000)
x_vals = [x]
y_vals = [y]
x_vals.append( np.random.randn( 300 ) )
y_vals.append( np.random.randn( 300 ) )
fig = plt.figure(1, figsize=(5.5,5.5))
from mpl_toolkits.axes_grid1 import make_axes_locatable
colour_LUT = ['#0000FF',
'#00FF00']
# the scatter plot:
xymax = np.max(np.fabs(x))
colors = []
axScatter = plt.subp