Skip to content

Fix imshow call in edtools.find_rotation_axis #13

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

Merged
merged 2 commits into from
Aug 22, 2021

Conversation

dagewa
Copy link
Contributor

@dagewa dagewa commented Aug 20, 2021

edtools.find_rotation_axis XDS.INP crashed for me with

Traceback (most recent call last):
  File "/home/fcx32934/sw/cctbx/conda_base/bin/edtools.find_rotation_axis", line 8, in <module>
    sys.exit(main())
  File "/home/fcx32934/sw/cctbx/conda_base/lib/python3.8/site-packages/edtools/find_rotation_axis.py", line 362, in main
    plot_histo(H, xedges, yedges, title=f"omega={omega_final:.2f}$^\circ$ | var={var:.2f}")
  File "/home/fcx32934/sw/cctbx/conda_base/lib/python3.8/site-packages/edtools/find_rotation_axis.py", line 81, in plot_histo
    plt.imshow(H.T, interpolation='nearest', origin='low',
  File "/home/fcx32934/sw/cctbx/conda_base/lib/python3.8/site-packages/matplotlib/pyplot.py", line 2724, in imshow
    __ret = gca().imshow(
  File "/home/fcx32934/sw/cctbx/conda_base/lib/python3.8/site-packages/matplotlib/__init__.py", line 1447, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "/home/fcx32934/sw/cctbx/conda_base/lib/python3.8/site-packages/matplotlib/axes/_axes.py", line 5519, in imshow
    im = mimage.AxesImage(self, cmap, norm, interpolation, origin, extent,
  File "/home/fcx32934/sw/cctbx/conda_base/lib/python3.8/site-packages/matplotlib/image.py", line 902, in __init__
    super().__init__(
  File "/home/fcx32934/sw/cctbx/conda_base/lib/python3.8/site-packages/matplotlib/image.py", line 246, in __init__
    cbook._check_in_list(["upper", "lower"], origin=origin)
  File "/home/fcx32934/sw/cctbx/conda_base/lib/python3.8/site-packages/matplotlib/cbook/__init__.py", line 2266, in _check_in_list
    raise ValueError(
ValueError: 'low' is not a valid value for origin; supported values are 'upper', 'lower'

This PR fixes that for the version of matplotlib I am using (3.3.4). I checked the docs for the minimum version for edtools (3.2.1), and the form origin="lower" appears to be fine there too.

@Taimin Taimin merged commit 128906d into instamatic-dev:master Aug 22, 2021
@Taimin
Copy link
Contributor

Taimin commented Aug 22, 2021

It's looking great! Thanks a lot, David.

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.

2 participants