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

Make plotting of window colorbar optional, return only figure #375

Merged
merged 4 commits into from
Jun 19, 2021

Conversation

hakonanes
Copy link
Member

@hakonanes hakonanes commented Jun 19, 2021

Description of the change

  • Address Allow not plotting a colorbar when plotting a Window #365 by adding a colorbar=True parameter to kikuchipy.filters.Window.plot().
  • Return only figure from kikuchipy.filters.Window.plot() if return_figure=True (default is False). Previous behaviour was to always return a tuple with figure, image array and colorbar. The image array and colorbar are obtainable from the figure.

Close #365.

Progress of the PR

Minimal example of the bug fix or new feature

>>> import kikuchipy as kp
>>> w = kp.filters.Window()
>>> w.plot(colorbar=False)
>>> fig = w.plot(return_figure=True)
>>> ax = fig.axes[0]
>>> im = ax.get_images()[0]
>>> cbar = im.colorbar

For reviewers

  • The PR title is short, concise, and will make sense 1 year later.
  • New functions are imported in corresponding __init__.py.
  • New features, API changes, and deprecations are mentioned in the
    unreleased section in doc/changelog.rst.

@hakonanes hakonanes added the enhancement New feature or request label Jun 19, 2021
@hakonanes hakonanes added this to the v0.4.0 milestone Jun 19, 2021
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
@hakonanes
Copy link
Member Author

Will merge when checks pass.

@hakonanes hakonanes merged commit b2480b0 into pyxem:master Jun 19, 2021
@hakonanes hakonanes deleted the enable-window-plot-no-colorbar branch June 19, 2021 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow not plotting a colorbar when plotting a Window
1 participant