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

Skip to content

Deprecate column cycling when plot() inputs have nonmatching shapes.#9826

Merged
tacaswell merged 1 commit intomatplotlib:masterfrom
anntzer:matching-column-plots
Nov 25, 2017
Merged

Deprecate column cycling when plot() inputs have nonmatching shapes.#9826
tacaswell merged 1 commit intomatplotlib:masterfrom
anntzer:matching-column-plots

Conversation

@anntzer
Copy link
Copy Markdown
Contributor

@anntzer anntzer commented Nov 21, 2017

Currently, something like

plot([[0, 1, 2], [3, 4, 5]], [[0, 1], [2, 3]])

will plot column 0 of x vs column 0 of y; column 1 of x vs column 1 of
y; and column 2 of x vs column 1 of y (i.e. cycle among columns). This
behavior appears to be error-prone to say the least.

Note that "normal" broadcasting (1->n) is not deprecated.

Closes #9784.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 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

@dstansby dstansby added this to the v2.2 milestone Nov 22, 2017
Copy link
Copy Markdown
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

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

👍 to deprecation, but needs api_changes docs.

@anntzer anntzer force-pushed the matching-column-plots branch from 2fdfbdf to 503af4b Compare November 23, 2017 21:08
@anntzer
Copy link
Copy Markdown
Contributor Author

anntzer commented Nov 23, 2017

done

Copy link
Copy Markdown
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

Looks good!

@jklymak
Copy link
Copy Markdown
Member

jklymak commented Nov 24, 2017

Oh... except there is no test for this. Not sure how one tests deprecation warnings. But it'd be good to have a test in place for when this will cause an error...

@tacaswell tacaswell dismissed their stale review November 24, 2017 19:12

Text added

Currently, something like

    plot([[0, 1, 2], [3, 4, 5]], [[0, 1], [2, 3]])

will plot column 0 of x vs column 0 of y; column 1 of x vs column 1 of
y; and column 2 of x vs column 1 of y (i.e. cycle among columns).  This
behavior appears to be error-prone to say the least.

Note that "normal" broadcasting (1->n) is not deprecated.
@anntzer anntzer force-pushed the matching-column-plots branch from 503af4b to d9545b3 Compare November 24, 2017 19:54
@anntzer
Copy link
Copy Markdown
Contributor Author

anntzer commented Nov 24, 2017

test in

@tacaswell tacaswell merged commit c608ae1 into matplotlib:master Nov 25, 2017
@anntzer anntzer deleted the matching-column-plots branch November 25, 2017 01:03
@QuLogic QuLogic modified the milestones: needs sorting, v2.2.0 Feb 12, 2018
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.

plot(2D, 2D) will cycle through the input columns even with non-matching shapes

5 participants