A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/ppinard/matplotlib-scalebar/issues/14 below:

Scale bar does not correspond to the actual size · Issue #14 · ppinard/matplotlib-scalebar · GitHub

Dear all,
first of all, thank you very much for this, scalebars are kinda mandatory in research and having this in python is really nice.
I am having some issues when using ScaleBar. The bar does not correspond to the actual size it would have; could you help me with that?
I'm using this code:

from matplotlib_scalebar.scalebar import ScaleBar
from skimage.io import imread

len_px = 0.00048223304582578836

image = imread('dur_grain1apatite01.tif', as_grey=True)

fig, ax = plt.subplots(figsize=(15, 10))
ax.imshow(testimg_apatite)
scalebar = ScaleBar(dx=len_px,
                    units='mm',
                    fixed_value=25,
                    fixed_units='um',
                    location=4,
                    box_alpha=0,
                    font_properties={'family' : 'monospace',
                                     'weight' : 'semibold',
                                     'size' : 20})
fig.gca().add_artist(scalebar)
plt.show()

This is the example image.
Thank you very much for your support.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4