Power BI中Python热力图:如何让Pandas/Matplotlib图例符号居标签上方
问题:调整Power BI中Python视觉对象图例的符号与标签对齐方式
我正在Power BI中使用Python视觉对象制作自定义热力图,需要调整图例内元素的对齐方式,让图例符号位于标签上方,以此匹配成品样式。之前尝试用set_x和set_y方法将文本移至符号下方,虽然能移动文本,但无法让元素与整个图例框良好对齐,相关代码如下:
osLegend = fig.legend( labels = ma, loc="center", bbox_to_anchor = (.8, .3), ncol = 3, labelspacing = 1, title = "Opportunity Size", markerscale = .5, markerfirst = False, columnspacing = .8) for text in osLegend.get_texts(): text.set_x(75) text.set_y(-30)
当前效果如图:
内容的提问来源于stack exchange,提问作者Krishan Patel
相关产品推荐
相关产品推荐

