SourceForge logo
SourceForge logo
Menu

matplotlib-devel

From: Matěj T. <mat...@gm...> - 2012年11月18日 14:16:45
Dear developers,
I use Matplotlib to process and display images acquired by microscopes.
It is quite common to indicate dimensions by displaying scale bar in the
image rather than using axes with labels. Although axes enable you to
refer to specific location in the image, they take up space around the
image, so if you only need to show the scale, scale bar is better.
What is needed:
 - The scale bar of given dimension (data units), possibly with bars at
its ends.
 - Text (presumably centered under the bar), text size as well as
vertical offset in physical units (= units reflecting the actual image
size, like the font size)
 - Semi-transparent rectangle, so the scale and label are more readable
 - Dark/bright theme might be a good idea.
I have made an svg file in Inkscape, so you can see what I mean.
First of all, I tried to implement the stuff myself, but later I have
found out that there is something on github. I have forked it, made some
minor modifications, and I think that it is "almost done". 
https://gist.github.com/4100881 (the add_scalebar function there is
broken ATM)
I also attach the test code for your convenience. You need to run it
with scalebars.py in the same directory.
You are supposed to see a tiny bright scalebar at the bottom right
corner.
There are some outstanding issues, though:
 - I have a feeling that bars at the end of the scale bar should be
related to the font size, as well as the actual width of the scale bar.
How to achieve this?
 - How to make the semi-transparent background for the bar and label in
a smart way?
Could you help me with those? I would like this to appear in matplotlib
since it is IMO a useful feature, what needs to be done?
Regards,
Matěj Týč
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /