Skip to content

[ENH]: Update grid_helper on FloatingSubplot #25426

Closed

Description

@albavilanova

Problem

Good afternoon,

I created a plot using FloatingSubplot and I had to define the grid_helper without having the extremes and grid locators. These are calculated later in my code, and I would like to be able to update the grid_helper (or the extremes and grid locators) on my axis once I have the correct values. I couldn't find a function to do so, could this be a new feature?

Thank you in advance,
Alba

Proposed solution

No response

Activity

  1. anntzer commented on Mar 12, 2023

    @anntzer
    Contributor

    Once #25427 gets merged, I think the following works (starting from the demo_floating_axes.py example):

    ax1.get_grid_helper().update_grid_finder(
        extreme_finder=floating_axes.ExtremeFinderFixed((0, 3, -1, 5)))
    ax1.clear()
    ax1.adjust_axes_lim()

    Unfortunately it is for now necessary to call clear() (and adust_axes_lim, which could reasonably be folded into clear() -- #25444); it's probably(?) possible to get rid of that and just have a self-contained method on the axes that updates just whatever is needed but that'll require a bit of careful surgery.

  2. albavilanova commented on Mar 13, 2023

    @albavilanova
    Author

    Thanks @anntzer! I will test it once it is merged. I should be able to add grid_locator1 as an argument in update_grid_finder too, right?

  3. anntzer commented on Mar 13, 2023

    @anntzer
    Contributor

    Perhaps? Please give it a try and let us know what works and what doesn't.

  4. oscargus commented on Mar 13, 2023

    @oscargus
    Member

    #25427 is now merged in main.

  5. Higgs32584 commented on Mar 24, 2023

    @Higgs32584
    Contributor

    Is this issue resolved?

  6. albavilanova commented on Mar 24, 2023

    @albavilanova
    Author

    I haven't tested it on our software yet since I am not allowed to install any dependencies on our machines, and I am waiting for my request at work to be approved. Feel free to close the issue, if something is wrong I will inform you and reopen it. Thank you all!

  7. Higgs32584 commented on Mar 24, 2023

    @Higgs32584
    Contributor

    Oh I can't close stuff I haven't gotten my first commit yet 😂😂

  8. albavilanova commented on Apr 19, 2023

    @albavilanova
    Author

    Just to let you know, the extremes are updating perfectly now. Many thanks!

  9. added this to the v3.8.0 milestone on Apr 19, 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