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

Adding colorbar functionality to plot #80

Merged
merged 3 commits into from
Nov 11, 2022
Merged

Conversation

hayesla
Copy link
Member

@hayesla hayesla commented Oct 25, 2022

PR Description

Fixes #79

now you can do:

my_spec.plot()
plt.colorbar()

example

@samaloney
Copy link
Contributor

I wonder what the return type of the plot method should be the figure, axis or the output from pcolor mesh? what does sunpy do?

Comment on lines 181 to 182
plt.sca(axes)
plt.sci(im)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I guess this sets the active axis and active image? I wonder why this is even necessary but I'm not matplotlib expert

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how we do it in sunpy core so its good enough for me

@nabobalis nabobalis merged commit 3d75971 into sunpy:main Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plot should return the mappable so that a colorbar can be plot
3 participants