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

Fix issue with getting the wrong preferred values for the scale bar. #23

Merged
merged 1 commit into from
Jul 12, 2019

Conversation

ericpre
Copy link
Contributor

@ericpre ericpre commented Jul 7, 2019

Fixes the following issue:

import matplotlib.pyplot as plt
import numpy as np
from matplotlib_scalebar.scalebar import ScaleBar
plt.figure()
image = np.arange(25).reshape((5, 5))
plt.imshow(image)
scalebar = ScaleBar(1, units='px', dimension='pixel-length')
plt.gca().add_artist(scalebar)

image

While we would expect:

image

It seems that the wrong preferred value is picked up when looking up the _PREFERRED_VALUES list.

@codecov-io
Copy link

codecov-io commented Jul 7, 2019

Codecov Report

Merging #23 into master will increase coverage by 0.15%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #23      +/-   ##
==========================================
+ Coverage   52.07%   52.23%   +0.15%     
==========================================
  Files           4        4              
  Lines         603      605       +2     
==========================================
+ Hits          314      316       +2     
  Misses        289      289
Impacted Files Coverage Δ
matplotlib_scalebar/scalebar.py 91.69% <100%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ba8ca4d...704a7e6. Read the comment docs.

@ppinard
Copy link
Owner

ppinard commented Jul 12, 2019

Good catch! Thank you for the fix

@ppinard ppinard merged commit 8c9f31a into ppinard:master Jul 12, 2019
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

Successfully merging this pull request may close these issues.

3 participants