Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force certain scale bar length #9

Closed
habi opened this issue May 5, 2017 · 5 comments
Closed

Force certain scale bar length #9

habi opened this issue May 5, 2017 · 5 comments

Comments

@habi
Copy link

habi commented May 5, 2017

First; thanks for making this!

I'm plotting several images together in a subplot, as seen in the image below (for science reasons some information is blurred).

issue

For sake of consistency I'd like to have a 1 mm scale bar on all the images.
Is this possible?

@habi
Copy link
Author

habi commented May 5, 2017

I suspect the label_formatter is used for this, but I cannot seem to find out how...

@ppinard
Copy link
Owner

ppinard commented May 5, 2017

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.

@habi habi changed the title Force certain length Force certain scale bar length May 5, 2017
@habi
Copy link
Author

habi commented May 5, 2017 via email

@habi
Copy link
Author

habi commented Jul 14, 2017

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.
scalebars

@habi habi closed this as completed Jul 14, 2017
@pskeshu
Copy link

pskeshu commented Jul 27, 2017

Works as expected! I ❤️ matplotlib-scalebar! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants