Matplotlib根据loc参数而不是bbox调整插入_轴?

Matplotlib根据loc参数而不是bbox调整插入_轴?,matplotlib,Matplotlib,我正在使用inset\u axes()控制颜色条图例的位置。这个标签在情节上有一点悬垂。有没有一种方法可以在不必执行bbox\u to\u anchor()的情况下轻推它?从loc参数进行偏移的方法?我想把它放在左下角 import pandas as pd %matplotlib inline import matplotlib.pyplot as plt import matplotlib.colors as mcolors from mpl_toolkits.axes_grid1.inse

我正在使用
inset\u axes()
控制颜色条图例的位置。这个标签在情节上有一点悬垂。有没有一种方法可以在不必执行
bbox\u to\u anchor()
的情况下轻推它?从
loc
参数进行偏移的方法?我想把它放在左下角

import pandas as pd
%matplotlib inline
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
from mpl_toolkits.axes_grid1.inset_locator import inset_axes

set1 = ax2.scatter(df.x, df.y, 
            edgecolors = 'none', 
            c = df.recommended_net_preferred_for_analysis_meters,
            norm = mcolors.LogNorm(), cmap='jet')

cbaxes = inset_axes(ax2, width="30%", height="3%", loc=3)
plt.colorbar(set1, cax=cbaxes, format = '%1.2f', orientation='horizontal')
cbaxes.xaxis.set_ticks_position("top")

也许您会发现基本库插入轴更容易一些?我尝试了很多方法,但仍然只是
bbox\u-to\u-anchor
。也许你会发现基本库的插入轴更容易一些?我尝试了很多方法,但仍然只是
bbox\u-to\u-anchor