操作系统:Ubuntu
rustup update
-->成功rutstup target install thumbv7m-none-eabi
-->成功cargo install cargo-flash
error: failed to run custom build command for `hidapi v1.4.2`
process didn't exit successfully: `/tmp/cargo-installgobLzf/release/build/hidapi-aad2646622c847a4/build-script-build` (exit status: 101)
error: could not find system library 'libudev' required by the 'hidapi' crate
error: failed to compile `cargo-flash v0.13.0`, intermediate artifacts can be found at `/tmp/cargo-installgobLzf`
Run Code Online (Sandbox Code Playgroud) 我想使用seaborn distplot制作一个配对直方图,如下所示。这种图也可称为此处所示的背对背直方图,或如此处所讨论的沿 x 轴反转/镜像的双直方图。
这是我的代码:
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
green = np.random.normal(20,10,1000)
blue = np.random.poisson(60,1000)
fig, ax = plt.subplots(figsize=(8,6))
sns.distplot(blue, hist=True, kde=True, hist_kws={'edgecolor':'black'}, kde_kws={'linewidth':2}, bins=10, color='blue')
sns.distplot(green, hist=True, kde=True, hist_kws={'edgecolor':'black'}, kde_kws={'linewidth':2}, bins=10, color='green')
ax.set_xticks(np.arange(-20,121,20))
ax.set_yticks(np.arange(0.0,0.07,0.01))
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
plt.show()
Run Code Online (Sandbox Code Playgroud)
当我使用此处讨论的方法(plt.barh)时,我得到了下面显示的条形图,这不是我想要的。
或者也许我还没有很好地理解解决方法......类似于这些类型的图的 python-seaborn-distplot 的简单/简短实现将是完美的。我编辑了上面第一个图的图,以显示我希望实现的图类型(尽管 y 轴没有颠倒):
任何线索将不胜感激。