Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Include scatter plots in Qt figure options editor. #12779

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 1 commit into from
Dec 10, 2018

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Nov 8, 2018

Essentially all the image-handling code can be reused; the only
difference is that collections don't have an interpolation field so we
need to check for that.

The rest of the PR is just replacing "image" by "sm" ("ScalarMappable")
throughout...

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer added the GUI: Qt label Nov 8, 2018
@anntzer anntzer added this to the v3.1 milestone Nov 8, 2018
if images:
datalist.append((images, "Images", ""))
if sms:
datalist.append((sms, "Images, etc.", ""))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggestions for the user-facing label here are welcome.

@anntzer anntzer force-pushed the scalarmappables-figureoptions branch from 731ad32 to 34b74da Compare November 8, 2018 20:48
label = image.get_label()
# Get ScalarMappables.
smdict = {}
for sm in [*axes.images, *axes.collections]:
Copy link
Member

Choose a reason for hiding this comment

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

sm is a quite obscure name and not used anywhere else in the code.

I'd prefer mappable or smappable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@anntzer anntzer force-pushed the scalarmappables-figureoptions branch from 34b74da to 6ffa253 Compare November 9, 2018 17:39
label = image.get_label()
if label == '_nolegend_':
# Get ScalarMappables.
mappabledict = {}
Copy link
Member

Choose a reason for hiding this comment

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

Would probably do mappable_* instead of mappable* on compounds for better readability.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's also curvedict/curvedata/etc. for Line2D instances (just above), so if you want to get to change both of them...

for image in axes.get_images():
label = image.get_label()
if label == '_nolegend_':
# Get ScalarMappables.
Copy link
Member

Choose a reason for hiding this comment

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

Minor formatting nitpicking. I think we would usually do # get ScalarMappables. Same with the set below.

Copy link
Contributor Author

@anntzer anntzer Nov 9, 2018

Choose a reason for hiding this comment

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

I capitalize (nearly) all my comments and include final stops (Matplotlib or not)...

@anntzer anntzer force-pushed the scalarmappables-figureoptions branch from 6ffa253 to 812d826 Compare December 10, 2018 20:18
Essentially all the image-handling code can be reused; the only
difference is that collections don't have an `interpolation` field so we
need to check for that.

The rest of the PR is just replacing "image" by "sm" ("ScalarMappable")
throughout...
@anntzer anntzer force-pushed the scalarmappables-figureoptions branch from 812d826 to 3c345ec Compare December 10, 2018 20:22
@timhoffm timhoffm merged commit 8e72069 into matplotlib:master Dec 10, 2018
@anntzer anntzer deleted the scalarmappables-figureoptions branch December 10, 2018 22:47
Stephen-Chilcote pushed a commit to Stephen-Chilcote/matplotlib that referenced this pull request Dec 11, 2018
Essentially all the image-handling code can be reused; the only
difference is that collections don't have an `interpolation` field so we
need to check for that.

The rest of the PR is just replacing "image" by "sm" ("ScalarMappable")
throughout...
raamana added a commit to raamana/matplotlib that referenced this pull request Dec 13, 2018
* upstream/master: (1723 commits)
  Correctly get weight & style hints from certain newer Microsoft fonts (matplotlib#12945)
  Remove some checks for Py<3.6 in the test suite. (matplotlib#12974)
  Fail-fast when trying to run tests with too-old pytest.
  Include scatter plots in Qt figure options editor. (matplotlib#12779)
  ENH: replace deprecated numpy header
  Minor simplifications.
  tickminorvisible-fix (matplotlib#12938)
  Remove animated=True from animation docs
  Update the documentation of Cursor
  Misc. cleanups.
  Add test for 3d conversion of empty PolyCollection
  Support ~ as nonbreaking space in mathtext.
  Deprecate public use of Formatter.pprint_val.
  MAINT: Unify calculation of normal vectors from polygons (matplotlib#12136)
  Fix the title of testing_api
  More table documentation
  Simplify bachelors degree example using new features.
  Avoid pyplot in showcase examples.
  Simplify argument checking in Table.__getitem__. (matplotlib#12932)
  Minor updates following bump to Py3.6+.
  ...

# Conflicts:
#	lib/matplotlib/widgets.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants