Skip to content

[Doc]: contourf demo use of origin keyword #26600

Closed

Description

@rcomer

Documentation Link

https://matplotlib.org/devdocs/gallery/images_contours_and_fields/contourf_demo.html

Problem

The docstring for contourf states that the origin keyword "is only relevant, if X, Y are not given". The contourf demo passes X, Y and origin for most of its examples.

Suggested improvement

The simplest thing would be to strip out origin where it's not relevant, but it might be nice to show some examples where it does make a difference.

Activity

  1. gautamsagar99 commented on Aug 26, 2023

    @gautamsagar99
    Contributor

    Hello,

    I'm new to open source contribution, I want to solve this issue. I think no one created a PR for this issue can I start working on it?

    Thanks

  2. rcomer commented on Aug 26, 2023

    @rcomer
    MemberAuthor
  3. gautamsagar99 commented on Aug 26, 2023

    @gautamsagar99
    Contributor

    Hi @rcomer,

    I found that origin attribute is useless for all the examples which are provided here https://matplotlib.org/devdocs/gallery/images_contours_and_fields/contourf_demo.html

    Should I add a new Example which demonstrate with origin attribute so that it can be differentiate between "lower" and "upper" values?
    If so I can add this Example:

    import matplotlib.pyplot as plt
    import numpy as np
    
    x = np.arange(1, 10)
    y = x.reshape(-1, 1)
    h = x * y
    
    cs = plt.contourf(h, levels=[10, 30, 50],
        colors=['#808080', '#A0A0A0', '#C0C0C0'], extend='both', origin="upper")
    cs.cmap.set_over('red')
    cs.cmap.set_under('blue')
    cs.changed()
    

    This Example will be helpful for visualizing the plot when we include origin attribute.

  4. linked a pull request that will close this issueRemoved unnecessary origin keywords #26608on Aug 31, 2023
  5. added this to the v3.8.0 milestone on Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions