Skip to content

panel for geo axis #237

Closed
Closed

Description

@lwq-star

I want to add panels to the geo axis, but this error occurred.

import ultraplot as uplt
import numpy as np

# Dummy data
data = np.random.rand(10, 10)

fig, ax = uplt.subplots(proj="cyl")
c1 = ax.imshow(data, cmap="viridis")

ax.colorbar(c1, loc="r", label="Some Label")
px = ax.panel_axes("b")

uplt.show()

AttributeError: '_CartopyAxes' object has no attribute 'is_panel_group_member'

I want an effect similar to this. The main plot uses a geographic axis, with additional panels using regular axes.

Image

Activity

  1. lwq-star commented on May 28, 2025

    @lwq-star
    Author

    Will this feature be possible in the future?

  2. cvanelteren commented on May 29, 2025

    @cvanelteren
    Collaborator

    We meet again!

    The GeoPlot needs some TLC and we are looking for active maintainers that focus on these areas. I am not working inside this field so for me it is rather difficult to see the bugs on this part of the codebase directly. In the end, I would like to see that the GeoAxes behave the same as the cartesian plots (or 3d plots). In short, yes this should be a features, but I am also limited on time and space so contributions are more than welcome. I will put this on the docket too.

  3. lwq-star commented on May 29, 2025

    @lwq-star
    Author

    Thank you for your contributions. After I finish my paper, I will also do what I can within my limited capacity to see how to implement this feature.

    We meet again!

    The GeoPlot needs some TLC and we are looking for active maintainers that focus on these areas. I am not working inside this field so for me it is rather difficult to see the bugs on this part of the codebase directly. In the end, I would like to see that the GeoAxes behave the same as the cartesian plots (or 3d plots). In short, yes this should be a features, but I am also limited on time and space so contributions are more than welcome. I will put this on the docket too.

  4. cvanelteren commented on May 29, 2025

    @cvanelteren
    Collaborator

    Just curious how helpful would panels be for GeoAxes? By default the panels share the coordinate references as such won't the plot not be difficult to maintain? I implemented a fix in #238 but need to think a bit more about the tests and or if this feature would be helpful and I would love your input.

  5. lwq-star commented on May 29, 2025

    @lwq-star
    Author

    It is quite common to include a statistical panel when plotting geographic axes, of course, without sharing the coordinate reference with the geographic axis. This can also be achieved by setting up two frames, simply by adjusting the size of the accompanying frame.
    Just like this.
    Image

  6. cvanelteren commented on May 29, 2025

    @cvanelteren
    Collaborator

    I see -- will add some tests for this.

  7. lwq-star commented on May 29, 2025

    @lwq-star
    Author

    I have an example here, but I don't know how to adjust the size of the right-side plot frame. I want to set refaspect=0.5, but the fig.subplot does not have this parameter.

    import ultraplot as uplt
    
    fig = uplt.figure(span=False, share='all', journal='nat2')
    gs = uplt.GridSpec(ncols=2, nrows=2)
    
    ax1 = fig.subplot(gs[0], proj="cyl")
    ax2 = fig.subplot(gs[1])
    ax3 = fig.subplot(gs[2], proj="cyl")
    ax4 = fig.subplot(gs[3])
    

    Image

  8. cvanelteren commented on May 30, 2025

    @cvanelteren
    Collaborator

    So the panels should have worked but I had a spelling issue. I need to flash it out a bit more before this can be closed but seems doable. More info will follow soon.

  9. cvanelteren commented on May 30, 2025

    @cvanelteren
    Collaborator

    @lwq-star 👀
    Image

  10. lwq-star commented on May 31, 2025

    @lwq-star
    Author

    @lwq-star 👀 Image

    That is right!

  11. cvanelteren commented on Jun 3, 2025

    @cvanelteren
    Collaborator

    Fixed on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions