Skip to content

doc: use different variables for color/x axis in example #27871

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

Closed
wants to merge 1 commit into from

Conversation

ianhi
Copy link
Contributor

@ianhi ianhi commented Mar 6, 2024

PR summary

I was trying to understand adding colormapping to a LineCollection and was confused by the example: https://matplotlib.org/stable/gallery/shapes_and_collections/line_collection.html

In this PR I:

  1. Added a comment explaining what array is for
  2. used a variable other than x for the array. I was further confused by this, at first I thought this was how you set the x positions.

Part of the issue here is that if you chase down the docstrings from LineCollection -> Collection you never see any mention of array. In a separate PR I can make an addition to the Collection docstring

PR checklist

@github-actions github-actions bot added the Documentation: examples files in galleries/examples label Mar 6, 2024
timhoffm added a commit to timhoffm/matplotlib that referenced this pull request Mar 6, 2024
Inspired by but independent of matplotlib#27871.

This example is much simpler, but conveys the same LineCollection
aspects - with the exception of not using masked arrays. But I argue
that this first example should be simple and using masked arrays rather
distracts from the core aspects of LineCollection.
timhoffm added a commit to timhoffm/matplotlib that referenced this pull request Mar 6, 2024
Inspired by but independent of matplotlib#27871.

This example is much simpler, but conveys the same LineCollection
aspects - with the exception of not using masked arrays. But I argue
that this first example should be simple and using masked arrays rather
distracts from the core aspects of LineCollection.
timhoffm added a commit to timhoffm/matplotlib that referenced this pull request Mar 6, 2024
Superseeds matplotlib#27871.

This example is much simpler, but conveys the same LineCollection
aspects - except for not using masked arrays. But I argue that this
the example should be simple and using masked arrays rather distracts
from the core aspects of LineCollection.

If there's concern of not showing masked array support, we should add
a third plot for that.
@timhoffm
Copy link
Member

timhoffm commented Mar 6, 2024

Sorry for jumping ahead, but this example has many more shortcomings, so that I did a complete rewrite in #27873.

timhoffm added a commit to timhoffm/matplotlib that referenced this pull request Mar 6, 2024
Superseeds matplotlib#27871.

This example is much simpler, but conveys the same LineCollection
aspects - except for not using masked arrays. But I argue that this
the example should be simple and using masked arrays rather distracts
from the core aspects of LineCollection.

If there's concern of not showing masked array support, we should add
a third plot for that.
timhoffm added a commit to timhoffm/matplotlib that referenced this pull request Mar 6, 2024
Superseeds matplotlib#27871.

This example is much simpler, but conveys the same LineCollection
aspects - except for not using masked arrays. But I argue that this
the example should be simple and using masked arrays rather distracts
from the core aspects of LineCollection.

If there's concern of not showing masked array support, we should add
a third plot for that.
@ianhi
Copy link
Contributor Author

ianhi commented Mar 7, 2024

A complete rewrite sounds much better!

@ianhi ianhi closed this Mar 7, 2024
timhoffm added a commit to timhoffm/matplotlib that referenced this pull request Mar 7, 2024
Superseeds matplotlib#27871.

This example is much simpler, but conveys the same LineCollection
aspects - except for not using masked arrays. But I argue that this
the example should be simple and using masked arrays rather distracts
from the core aspects of LineCollection.

If there's concern of not showing masked array support, we should add
a third plot for that.
timhoffm added a commit to timhoffm/matplotlib that referenced this pull request Mar 7, 2024
Superseeds matplotlib#27871.

This example is much simpler, but conveys the same LineCollection
aspects - except for not using masked arrays. But I argue that this
the example should be simple and using masked arrays rather distracts
from the core aspects of LineCollection.

If there's concern of not showing masked array support, we should add
a third plot for that.
timhoffm added a commit to timhoffm/matplotlib that referenced this pull request Mar 8, 2024
Superseeds matplotlib#27871.

This example is much simpler, but conveys the same LineCollection
aspects - except for not using masked arrays. But I argue that this
the example should be simple and using masked arrays rather distracts
from the core aspects of LineCollection.

If there's concern of not showing masked array support, we should add
a third plot for that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation: examples files in galleries/examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants