Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Deprecated the set_colorbar method on a scalar mappable.#2055

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mdboom merged 2 commits intomatplotlib:masterfrompelson:mappable_colorbar_attribute
May 24, 2013

Conversation

pelson
Copy link
Member

No description provided.

'set the colorbarimageand axes associated with mappable'
self.colorbar = im, ax
"""set the colorbar and axesinstancesassociated with mappable"""
self.colorbar = im
Copy link
Member

Choose a reason for hiding this comment

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

I must have missed some other PR... there weren't any old code that would have queried and expected a tuple from the colorbar attribute, right?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

No. I don't think anything is making use of it (at least, there are no tests which exercise it, and a thorough grepping didn't throw anything up)

@efiring
Copy link
Member

It looks like part of the point here is that a colorbar always has an axes attribute, so there is no need for a tuple in the ScalarMappable colorbar attribute.

Looks like a good cleanup--but it is a bit dangerous, and I don't know how to handle that. The danger, of course, is that some user code is expecting the attribute to hold a tuple. Maybe it will be adequate to simply flag this prominently in the description of API changes.

@pelson
Copy link
MemberAuthor

Looks like a good cleanup--but it is a bit dangerous, and I don't know how to handle that. The danger, of course, is that some user code is expecting the attribute to hold a tuple. Maybe it will be adequate to simply flag this prominently in the description of API changes.

Agreed. Indeed I have code which doescb = scalarmappable.colorbar[0]. But I'm prepared to accept the fact that this is a backwards incompatible change - having anything but a colorbar instance in a colorbar attribute is just wrong. Anapi_changes.rst entry is the best I can come up with too - but I think this attribute is sufficiently opaque that you would only know about it if you read the source code ofcm.ScalarMappable.

@pelson
Copy link
MemberAuthor

Think this is good to go.

mdboom added a commit that referenced this pull requestMay 24, 2013
Deprecated the set_colorbar method on a scalar mappable.
@mdboommdboom merged commit148ed82 intomatplotlib:masterMay 24, 2013
of ``(colorbar_instance, colorbar_axes)`` but is now just
``colorbar_instance``. To get the colorbar axes it is possible to just use
the :attr:`~matplotlib.colorbar.ColorbarBase.ax` attribute on a colorbar
isntance.
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Ah. Sorry - typo.

Copy link
Member

Choose a reason for hiding this comment

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

No worries. We can just push that fix directly to master.

@dmcdougall
Copy link
Member

As a note, since this is a backwards incompatible change, should the next version number be2.0.x?

@mdboom
Copy link
Member

Since 1.0, we have allowed backward incompatible changes of this magnitude for minor point releases, with a note inapi_changes.rst and a deprecation process when necessary. So I don't think this requires2.0.x. I think we should save that for the time when a significant portion of user code would require changes -- this is a bit of a corner case.

tacaswell added a commit to tacaswell/matplotlib that referenced this pull requestJan 10, 2015
tacaswell added a commit to tacaswell/matplotlib that referenced this pull requestJan 10, 2015
tacaswell added a commit to tacaswell/matplotlib that referenced this pull requestJan 10, 2015
tacaswell added a commit to tacaswell/matplotlib that referenced this pull requestJan 11, 2015
tacaswell added a commit to tacaswell/matplotlib that referenced this pull requestJan 22, 2015
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v1.3.x
Development

Successfully merging this pull request may close these issues.

5 participants
@pelson@efiring@dmcdougall@mdboom@WeatherGod

[8]ページ先頭

©2009-2025 Movatter.jp