Giter VIP home page Giter VIP logo

matplotlib-scalebar's Introduction

matplotlib-scalebar

CI PyPI


Documentation: See below

Source Code: https://github.com/ppinard/matplotlib-scalebar

Cheat sheet: https://kolibril13.github.io/plywood-gallery-matplotlib-scalebar


Provides a new artist for matplotlib to display a scale bar, aka micron bar. It is particularly useful when displaying calibrated images plotted using plt.imshow(...).

Example of scale bar

The artist supports customization either directly from the ScaleBar object or from the matplotlibrc.

Installation

Easiest way to install using pip:

pip install matplotlib-scalebar

For development installation from the git repository:

git clone [email protected]:ppinard/matplotlib-scalebar.git
cd matplotlib-scalebar
pip install hatch
hatch env create
hatch run test

Getting started

There are many ways to customize the scale bar. Examples and explanations of the arguments of the ScaleBar class are given below, but here is a quick start guide.

The constructor arguments dx and units specify the pixel dimension. For example ScaleBar(0.2, 'um') indicates that each pixel is equal to 0.2 micrometer. By default, the scale bar uses SI units of length (e.g. m, cm, um, km, etc.). See examples below for other system of units.

In this example, we load a sample image from the matplotlib library, create a subplot, plot image, create scale bar and add scale bar as an "artist" of the subplot.

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
from matplotlib_scalebar.scalebar import ScaleBar

# Load image
with cbook.get_sample_data("s1045.ima.gz") as dfile:
    im = np.frombuffer(dfile.read(), np.uint16).reshape((256, 256))

# Create subplot
fig, ax = plt.subplots()
ax.axis("off")

# Plot image
ax.imshow(im, cmap="gray")

# Create scale bar
scalebar = ScaleBar(0.08, "cm", length_fraction=0.25)
ax.add_artist(scalebar)

# Show
plt.show()

Example of scale bar

Cheat Sheet

An example gallery for the matplotlib-scalebar package: https://kolibril13.github.io/plywood-gallery-matplotlib-scalebar/

citurs

ScaleBar arguments

Here are arguments of the ScaleBar class constructor and examples how to use them.

scalebar = ScaleBar(
        dx,
        units="m",
        dimension="si-length",
        label=None,
        length_fraction=None,
        height_fraction=None,
        width_fraction=None,
        location=None,
        pad=None,
        border_pad=None,
        sep=None,
        frameon=None,
        color=None,
        box_color=None,
        box_alpha=None,
        scale_loc=None,
        label_loc=None,
        font_properties=None,
        label_formatter=None,
        scale_formatter=None,
        fixed_value=None,
        fixed_units=None,
        animated=False,
        rotation=None,
        bbox_to_anchor=None,
        bbox_transform=None,
    )

Each argument can also be changed afterwards using their respective property.

scalebar.dx = 2.0

The following schematic illustrates the nomenclature used in the definition of the arguments.

nomenclature

dx (required)

Size of one pixel in units specified by the next argument.

Set dx to 1.0 if the axes image has already been calibrated by setting its extent.

fig, ax = plt.subplots()
ax.axis("off")

ax.imshow(im, cmap="gray", extent=[0, 20.48, 0, 20.48])

scalebar = ScaleBar(1, "cm", length_fraction=0.25)
ax.add_artist(scalebar)

dx with extent

Special notes for geospatial plots: If you are plotting geospatial coordinates (such as scatterplots of the location of structures, geopandas geodataframe plots, etc.), dx needs to be set differently depending on the coordinate system:

  • For UTM based coordinate system, where the X and Y are in meters, simply set dx = 1.
  • For WGS or NAD based coordinate system, where X and Y are in latitude (Y) and longitude (X), compute the distance between two points at the latitude (Y) you wish to have the scale represented and are also one full degree of longitude (X) apart, in meters. For example, dx = great_circle_distance((X, Y), (X + 1, Y))

units

Units of dx. The units needs to be valid for the specified dimension. Default: m.

dimension

Dimension of dx and units. It can either be equal:

  • si-length (default): scale bar showing km, m, cm, etc.
  • imperial-length: scale bar showing in, ft, yd, mi, etc.
  • si-length-reciprocal: scale bar showing 1/m, 1/cm, etc.
  • pixel-length: scale bar showing px, kpx, Mpx, etc.
  • angle: scale bar showing °, ʹ (minute of arc) or ʹʹ (second of arc)
  • a matplotlib_scalebar.dimension._Dimension object
fig, ax = plt.subplots()
ax.axis("off")

ax.imshow(im, cmap="gray")

scalebar = ScaleBar(0.0315, "in", dimension="imperial-length", length_fraction=0.25)
ax.add_artist(scalebar)

imperial dimension

label

Optional label associated with the scale bar. Default: None, no label is shown. The position of the label with respect to the scale bar can be adjusted using label_loc argument.

length_fraction

Desired length of the scale bar as a fraction of the subplot's width. Default: None, value from matplotlibrc or 0.2. The actual length of the scale bar is automatically determined based on the specified pixel size (dx and units) and the contraint that the scale value can only take the following numbers: 1, 2, 5, 10, 15, 20, 25, 50, 75, 100, 125, 150, 200, 500 or 750. If you want a specific value, see fixed_value and fixed_units.

In the example below, the scale bar for a length_fraction of 0.25 and 0.5 is the same because the scale cannot have a value between 2 and 5 mm.

length fraction

height_fraction

Deprecated, use width_fraction.

width_fraction

Width of the scale bar as a fraction of the subplot's height. Default: None, value from matplotlibrc or 0.01.

location

A location code, same as matplotlib's legend, either: upper right, upper left, lower left, lower right, right, center left, center right, lower center, upper center or center. Default: None, value from matplotlibrc or upper right.

loc

Alias for location.

pad

Padding inside the box, as a fraction of the font size. Default: None, value from matplotlibrc or 0.2.

border_pad

Padding outside the box, fraction of the font size. Default: None, value from matplotlibrc or 0.1.

sep

Separation in points between the scale bar and scale, and between the scale bar and label. Default: None, value from matplotlibrc or 5.

frameon

Whether to draw a box behind the scale bar, scale and label. Default: None, value from matplotlibrc or True.

color

Color for the scale bar, scale and label. Default: None, value from matplotlibrc or k (black).

box_color

Background color of the box. Default: None, value from matplotlibrc or w (white).

box_alpha

Transparency of box. Default: None, value from matplotlibrc or 1.0 (opaque).

scale_loc

Location of the scale with respect to the scale bar. Either bottom, top, left, right, none. Default: None, value from matplotlibrc or bottom. If "none", no scale is shown.

scale_loc

label_loc

Location of the label with respect to the scale bar. Either bottom, top, left, right, none. Default: None, value from matplotlibrc or top. If "none", no label is shown.

font_properties

Font properties of the scale and label text, specified either as dict or str. See FontProperties for the arguments. Default: None, default font properties of matplotlib.

label_formatter

Deprecated, use scale_formatter.

scale_formatter

Custom function called to format the scale. Needs to take 2 arguments - the scale value and the unit. Default: None which results in

scale_formatter = lambda value, unit: f"{value} {unit}"

fixed_value

Value for the scale. The length of the scale bar is calculated based on the specified pixel size dx. Default: None, the value is automatically determined based on length_fraction.

fixed_units

Units of the fixed_value. Default: None, if fixed value is not None, the units of dx are used.

animated

Animation state. Default: False

rotation

Whether to create a scale bar based on the x-axis (default) or y-axis. rotation can either be horizontal or vertical. Note you might have to adjust scale_loc and label_loc to achieve desired layout. Default: None, value from matplotlibrc or horizontal.

fig, ax = plt.subplots()
ax.axis("off")

ax.imshow(im, cmap="gray")

scalebar = ScaleBar(
    0.08,
    "cm",
    length_fraction=0.25,
    rotation="vertical",
    scale_loc="right",
    border_pad=1,
    pad=0.5,
)
ax.add_artist(scalebar)

rotation

bbox_to_anchor and bbox_transform

Use a different bounding box than the plot axes to anchor the scale bar. The bbox_transform defines the transform applied to the bbox_to_anchor value. Note that the location will influence the position of the scale bar relative to the anchor (see example below). Default: None, the plot axes bounding box is used.

fig, ax = plt.subplots()

scalebar = ScaleBar(
    1,
    "cm",
    length_fraction=0.25,
    bbox_to_anchor=(0.5, 0.5),
    bbox_transform=ax.transAxes,
    location="lower left",
    label="lower left",
    box_color="0.8",
)
ax.add_artist(scalebar)

scalebar = ScaleBar(
    1,
    "cm",
    length_fraction=0.25,
    bbox_to_anchor=(0.5, 0.5),
    bbox_transform=ax.transAxes,
    location="upper right",
    label="upper right",
    box_color="0.8",
)
ax.add_artist(scalebar)

rotation

Release notes

Dev

  • Update tooling (#53)
  • Add example gallery (#50)
  • Add bbox_anchor and bbox_transform (#40)

0.8.1

  • Remove useless shebangs (#47)
  • Correct License trove classifier (#48)

0.8.0

  • Fix missing _all_deprecated in future matplotlib (> 3.5) (#44)
  • Add ability to hide scale and label (#41)

0.7.2

  • Fix deprecation warning in matplotlib >= 3.4 of minimumdescent (#36)

0.7.1

  • Fix scalebar location validation from rcParams (#35)

0.7.0

  • Add rotation to display scale bar for the y-axis (#30)
  • New documentation (#32)
  • Deprecate argument height_fraction, replaced by width_fraction (#32)
  • Deprecate argument label_formatter, replaced by scale_formatter (#32)
  • Add alias loc for location (#32)
  • Fix deprecation warning in matplotlib >= 3.3 of validate_legend_loc (#33)

0.6.2

  • Fix reciprocal unit (#29)

0.6.1

  • Add notes about for geospatial plots (#20)

0.6.0

  • Add angular units (#19)
  • Add blit support and fix documentation (#22)
  • Fix issue with getting the wrong preferred values for the scale bar (#23)
  • Package LICENSE file to distribution (#24)

0.5.1

  • Remove leftover print statement (#18)

0.5.0

  • Add pixel unit (#12)
  • Display micro symbol in text mode (#15)
  • Fix error in length of scale bar; the bar was drawn with an edge around it which made it longer than the actual size (#14)

0.4.1

  • Fix deprecated usage of is_string_like (#11)

0.4.0

  • Add possibility to specified a fixed value for the scale bar (#9)

Contributors

@maweigert, @crosbyla, @joschkazj, @AKuederle, @habi, @huangziwei, @SirJohnFranklin, @alexandrejaguar, @parishcm, @wiai, @cosmicshear, @ericore, @seangrogan, @PhilipeRLeal, @din14970, @SarthakJariwala, @k1moradi, @anntzer, @bugalo, @musicinmybrain, @kolibril13, @ilopata1

License

License under the BSD License, compatible with matplotlib.

Copyright (c) 2015-2023 Philippe Pinard

matplotlib-scalebar's People

Contributors

akuederle avatar anntzer avatar din14970 avatar ericpre avatar ilopata1 avatar kolibril13 avatar musicinmybrain avatar ppinard avatar sarthakjariwala avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

matplotlib-scalebar's Issues

Matplotlib-Scalebar does not fully supports geopandas geodataframe plots

Dear all,

I have recently tried the matplotlib-scalebar module over some geopandas geodataframe plot. I noticed that the the given module does not well support the plot. This is due to the "dx" argument. Since the geopandas plot does not have a size of pixel, the "dx" setting is akward, and prone to errors.

Sincerely yours,

Philipe Leal

Incorrect prefix with recyprocal units when it needs to convert

I noticed that the scalebar incorrectly handles the prefix for reciprocal units, I noticed this when I was trying to measure distances in a Fourrier transform of an image. My original image has a pixel size of 0.007 nm/pixel, but everything is stored in meters, so 7e-12 m. The scalebar has no problem interpreting this value and puts a scalebar in nm on the image.

To calculate the scale of my Fourrier transform, I take the meters value and convert. My image is 4096x4096 pixels so the scale in the FFT is 1/(7e-12 * 4096)=3.4e7 m^-1/pixel. This is equivalent to 0.034 nm^-1/pixel. When I pass the scale in nm^-1 to the scalebar, it uses the correct nm^-1 units. However, when I pass the scale in m^-1, the scalebar uses Gm^-1.

Warning Issued on calling Scalebar

Every time I import ScaleBar as here,
%matplotlib inline import matplotlib.pyplot as plt from matplotlib_scalebar.scalebar import ScaleBar

I get the following warning

C:\Anaconda2\lib\site-packages\matplotlib_init.py:1357: UserWarning: This call to matplotlib.use() has no effect
because the backend has already been chosen;
matplotlib.use() must be called before pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.
warnings.warn(use_error_msg)

Can you please check what is going on here. I am on Windows 10 with Anaconda 32 bit Python 2.7

Force certain scale bar length

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?

North Arrows and Scale Bars

Less of an issue, more of an announcement for people using this library for cartographic visualization:

I just developed a package (matplotlib-map-utils) for adding print-ready north arrows to matplotlib plots. It includes a bevy of customization options, as well as the ability to automatically calculate the direction to "true north" if provided a CRS.

It is heavily inspired by this package, and thought it might be of interest to those using matplotlib-scalebar to create scale bars for maps specifically.

It seems development has also slowed on this package. I am hopeful that v2 of my package will include functionality for creating cartographic scale bars (like what is available in ArcGIS and QGIS) - if this is something you would use, feel free to drop a comment! I am not currently committing to any timeline for releasing v2, but if enough interest is expressed, I am happy to prioritize it over my other personal projects.

Most of all though, thank you to the developers of this package, as I was able to puzzle out a fair bit of functionality I re-used in my package thanks to the source code shared here!

dimensions="imperial-length" won't display in Miles unless sufficiently zoomed out

I am in the USA, and few people here are good at meters / kilometers, so I do have to use the Scalebar's imperial-length dimension when creating maps in geopandas. Unfortunately, the scale won't stay in miles if you are zoomed in such that the extent of the map is now at a sub-mile level. So at that point the scalebar shows furlongs or chains instead of fractions of a mile, and furlongs and chains are not something anyone here is familiar with.

It would be very nice to be able to display in fractions of a mile (to the tenth's place, unless it is 0.25 or 0.75) instead of in furlongs or chains. It also works to display in feet (10ft, 30ft, 50ft, 100ft, 200ft, 500ft, 1000ft, 2000ft). I really hope this can be a feature that is added to this otherwise wonderful scalebar.

I've attached this map as an example of how the scalebar displays chains (ch) or furlongs (fur) instead of miles or feet:
PeninsulaOpenSpaceTrust_Sonntag

font_properties arg acts unexpected

The font_properties argument in the ScaleBar constructor behaves different from the doc

from matplotlib.font_manager import FontProperties
gca().add_artist(ScaleBar(.1, font_properties=FontProperties(size = 12)))

results in an error ("TypeError: 'FontProperties' object is not iterable").

I assume the reason is in the line

self.font_properties = FontProperties(font_properties)

which is

self.font_properties = FontProperties(font_properties)

but should be

self.font_properties = font_properties

(after changing that, everything works fine)

PS:
Thanks for the package!

Latex representation mu does not work

Hey, it looks like the latex representation of micro does not work, because the _Dimension.calculate_preferred will overwrite the "µm" unit with "um".

I fixed it by monkey patching this method for now, but I a proper solution would be better :D

add 'pixel' as unit?

Hi,

Sometimes I don't really know the unit of the picture and the axis is turned off for aesthetic reason. It would be nice to have a scale bar just for showing how many pixels a certain length of the picture spanned.

Scale bar does not correspond to the actual size

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.

Draw the scalebar without any text

I'm trying to plot just a scalebar without any associated text that says what's the length and unit of scale bar. What's the best way to do this?

bbox_to_anchor keyword

This package is exactly what I've been looking for years, for use with geopandas. Thanks you!

Would it be possible to add the bbox_to_anchor, in addition to location? The documentation looks like it works but I got the following error: TypeError: ScaleBar.init() got an unexpected keyword argument 'bbox_to_anchor'.

x y scale bar

Hi,

I was wondering is it possible to add two scale bars: one for the x-axis and another one for the y-axis. The x-axis of my plot is in milliseconds and the y-axis in pico ampers.

I have generated the following plot but, I want the unit of the plot being "ms" which the program does not allow. I also want to add another scalebar for the y-axis, so that I can hide the axis.

scalebar = ScaleBar(1, label='ms', location='lower right')
plt.gca().add_artist(scalebar)

image

Option to add scalebar without scale

It is sometimes useful to have a scalebar without scale or label, just the line. For example, if you already mention the scale in the figure caption. I have not found a way to hide the scale. Is it possible to implement it?

Thanks.

Latex mu not being affected by rcParams

Can you change the definition of the symbol of greek mu (as in the micrometer) such that it uses the font defined in the script in which matplotlib-scalebar is being imported? Using the \mathregular command should be enough. e.g. mu = '\mathregular{ \mu }'

Reloading matplotlib overwrites custom settings

Hi it seems like reloading matplotlib using imp as you do on line 81 in scalebar.py causes some issues with custom settings.
For example:

from matplotlib_scalebar.scalebar import ScaleBar
from matplotlib_scalebar.dimension import _Dimension
import matplotlib as mpl

import matplotlib.pyplot as plt
mpl.rcParams.update({'font.family': 'serif'})

will lead to
image

As you can see the fonts are sans-serif and not serif.
Doing the same without importing matplotlib_scalebar, will lead to the expected result:

# from matplotlib_scalebar.scalebar import ScaleBar
# from matplotlib_scalebar.dimension import _Dimension
import matplotlib as mpl

import matplotlib.pyplot as plt
mpl.rcParams.update({'font.family': 'serif'})

image

By playing around with a local install of your package I could verify, that reloading matplotlib (line 81) causes this issue.

imp.reload(sys.modules['matplotlib'])

Removing that line resolves the issue and does not seem to change anything else. (all test still work and all other things I tested, too)
Could you explain what the original intention of this line was?

Best regards,
Arne

(PS: awesome package otherwise! Saved me a lot of time!)

Scalebar with multiple patches (horizontally concatenated)

Dear developers,

I would like to thank you for the amazing package you have developed.

I was wondering if it would be possible to enhance it in order to accomodate multiple patches within a same scalebar. Something like Quantum-GIS does (see example below).

Scalebar example:
scalebar_example

I created a discussion in StackOverflow regarding the use of the matplotlib.offset VPacker and HPacker on this regard (in here).

Sincerely,

How to add a scalebar using matplotlib-scalebar in geemap cartoee plot?

Hi,
I am trying to add a scalebar using the sample scripts in geemap. But I am getting wrong results. The pixel size of the satellite imagery is 10m.The output is coming as

image

Which is wrong,

The script which I used is,

oi =m.draw_last_feature
geom = roi.geometry()
coords = geom.coordinates().getInfo()
zoom_region = [coords[0][0][0], coords[0][0][1], coords[0][2][0], coords[0][2][1]]

fig = plt.figure(figsize=(10,20))

vis = {
    "bands":["VV"],
    "min":-25,
    "max":0,
    "palette":['aqua', 'black']
}

# use cartoee to get a map
ax = cartoee.get_map(Sentinel_1,vis_params=vis,region=zoom_region)

# add gridlines to the map at a specified interval
cartoee.add_gridlines(ax,interval=[0.005,0.005],linestyle=":")

ax.set_title(
    label = 'Sentinel-1, October 5,2020 ',
    fontsize = 15
)

scalebar = ScaleBar(10) # 1 pixel = 0.2 meter
ax.add_artist(scalebar)
plt.show()

Kindly suggest ways to fix it.
Thank you.

Fine adjustment of the scalebar position.

Is there a way to fine adjust the scalebar position? I need to place the scalebar at the lower right of a image, but there is a label that also needs to be there and I´d like to raise the scalebar a few pixels, so both will be on the lower right but not overlapping each other.

Add angular units

It would be very useful for astronomers to have a scale bar showing angular scales such as degree (°), arcmin (') and arcsec ('').

For example, this can be done by adding the so-called pixel scale in the units of arc seconds per pixel (or even more available units) as an input. For example pixel scale = 0.2 implies that each pixel spans 0.2 arcsec. Here is the best I could do with the current version of matplotlib-scalebar.

scalebar

print statement in scalebar.py

Hi Philippe,
there is a print() statement in line 322 of scalebar.py which leads to some uncalled-for output e.g. in jupyter notebooks etc. when using the scalebar. I guess this is left over from debugging/testing and could be removed...
Best regards,
Aimo.

Save image in original resolution

Hi!
I want to save my plot with the ScaleBar, here is my code:

fig, ax = plt.subplots()
ax.axis("off")
ax.imshow(my_slice3, cmap="gray")
scalebar = ScaleBar(650, "nm", length_fraction=0.25, location= "lower right")
ax.add_artist(scalebar)
plt.savefig('foo.png')

When I save the image, the resolution is not anymore the resolution of the original image.
At Stack Overflow I found the hint, that one can use imsave , but that is not working with the Scalebar.
https://stackoverflow.com/questions/31544130/saving-an-imshow-like-image-while-preserving-resolution
I know that I can increase the resolution e.g. with
plt.rcParams['figure.dpi'] = 300 .
But that is not leading to the exact pixel-by-pixel image.
Any idea how to solve this?

Question: Get value from scalebar object?

First, thanks for the great package!

I just ran into a use case that I hadn't before, and I'm wondering if there's a way to deal with it. I'm trying to get the scalebar value from a scalebar object created with length_fraction (and thus an automatically chosen value) so that I can use it in another place. Eg, in the below plot, I want to get the value of 25 or 25 m out so that I can use it. Is there a way to do this?

import matplotlib_scalebar.scalebar as scalebar
import matplotlib.pyplot as plt

fig, ax = plt.subplots()
ax.plot(np.arange(100))
scale_bar = mpu.add_traj_scalebar(ax, dx=1, length_fraction=0.3, location="lower right")

# How can I do this?
# scale_bar_value = scale_bar.

text above scale bar

Hi, Is it currently possible to place the text above the scale bar? The README mentions setting the scalebar.label_top rcParam but there is no reference to this in the code and it doesn't seem to do anything when I try it. I'm also unclear on what the scale_loc and label_loc parameters are for; I don't see any effect from those.

-- edit --

Just after creating this question, I discovered that I can enter a negative value for the sep parameter and this places the text above the scalebar. I don't suppose this is intentional but I'll do this as a workaround for the moment.

Change \mu to \textmu

Hey,

nice package!
One thing came to my mind using it: The \mu for micrometer is of italic type which is not correct in my opinion.

You could change:
latexrepr = '$\\mu$m'
to
latexrepr = '$\\mathrm{\\mu}$m'

in dimensions.py, line 88.

Best,
SJF

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.