gpt4 book ai didi

python - hist2d 中的 vmin 和 vmax

转载 作者:行者123 更新时间:2023-12-02 18:53:36 26 4
gpt4 key购买 nike

我正在使用 hist2d 在 python 中绘制一些数据。对于色标的标准化,我使用参数

norm=matplotlib.colors.LogNorm().

如何获得(后验)matplotlib 分配给该图的 vmin 和 vmax 值?我希望 matplotlib 选择它们(范围通常是精心选择的),然后获取它们并将这些值准确应用到第二个图,即,我将使用:

norm=matplotlib.colors.LogNorm(vmin=vmin1, vmax=vmax1)

最佳答案

您可能应该提供一个更详细的示例。无论如何,以下方法可能会解决问题:

import matplotlib.pyplot as plt
hist = plt.hist2d(x, y)
vmin,vmax = hist[-1].get_clim()

关于python - hist2d 中的 vmin 和 vmax,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66443606/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com