Force certain scale bar length
habi opened this issue · 5 comments
I suspect the label_formatter
is used for this, but I cannot seem to find out how...
No the label_formatter
won't do what you are looking for. It only changes the way the text is displayed and not the length of the scale bar. I think what you described would be a very nice addition but I have to think the proper way of implementing it.
I guess the constructor would need two additional arguments: desired_value
and desired_unit
. In your example, deaired_value=1
and desired_unit='mm'
. I am just wondering what would happen if someone selects a combination where the scale bar is either too long for the subplot or too small to be visible.
Thanks for implementing this (in the relevant branch), it works as intended!
Attached is an overview of several differently sized images (again, blurred for science reasons) which all have the same-length scale bar on them.
Works as expected! I ❤️ matplotlib-scalebar! :D