python - bbox_to_anchor and loc in matplotlib -


I've come to the matplotlib code that customizes the legend macro by using keywords "loc" and "bbox_to_anchor". For example:

fig.legend ([line1, line2], ['series1', 'series2'], bbox_to_anchor = [0.5, 0.5], loc = 'center', ncol = 2)

< P> I have seen the above variety where "bbox_to_anchor" is used after "loc".

I understand differently for the purpose of using "bbox_to_anchor" and "loc" However, is there any benefit to using both in the same mythology specification? By my understanding and use, it seems to me that if "bbox_to_anchor" is specified, the "public" parameter does not care too much.

Can anyone confirm this? I do not see any document about this.

When using bbox_to_anchor and public Metalogy will be reported in the Folk argument, which should be placed on the logic of the legend of the legendary box of bbox_to_anchor . For example (I have simplified the command slightly), the three options below will produce different places for your legend,

  fig. (Base), [[line1], ['series1'], bbox_to_anchor = [0.5, 0.5], public = 'center') fig.legend ([line1], ['series1'], bbox_to_anchor = [0.5, 0.5] , Loc = 'center left') fig.legend ([line1], ['serial 1'], bbox_to_choor = [0.5, 0.5], public = 'center right')  

first The center of the bounding box will be placed at 0.5.0.5 on the command axes. Second, in the same coordinates, the left edge of the bounding box will be placed (i.e. move the legend to the right). Finally, the third option will be placed on the coordinates the right edge of the center of the bounding box (i.e. move bilateral to the left).


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -