Skip to content

Does geographic axes support axis sharing? #800

Closed

Description

@gepcel

Most examples in the doc uses share=0 or share=False. Does and can geographic axes support share/sharex/sharey arg?

fig,axs=pplt.subplots(ncols=2,proj='cyl',refwidth='6cm',share='all')
axs.format(lonlim=(100, 105), latlim=(30, 35),labels=True)
axs[1].format(lonlines=2,latlines=1)

Activity

  1. cvanelteren commented on Aug 22, 2026

    @cvanelteren
    Collaborator

    Yes we do! But only for rectilinear axes for geo (merc, cyl etc)

  2. cvanelteren commented on Aug 22, 2026

    @cvanelteren
    Collaborator

    iirc I added that option to prevent the log filling the output

  3. cvanelteren commented on Aug 22, 2026

    @cvanelteren
    Collaborator

    How sharing works it that we by default scan what could be shared, i.e.

    [1, 2],
    [3, 4]

    can be shared but this

    [1, 2]
    [1, 3] makes no sense to share y.

    So the mechanisms is actually rather nice at is does "works" for sharing complicated structures where it makes sense -- at least I think it is nice but I also wrote it 😆. This story holds generic and also stops sharing if the subplot types differ so

    [1, 2, 3] would share 2, 3 if 2, 3 are geo (and rectilinear) and 1 is not

  4. gepcel commented on Aug 22, 2026

    @gepcel
    CollaboratorAuthor

    So what happened to the following example?

    Example 1

    fig,axs=pplt.subplots(ncols=2,proj='cyl',refwidth='6cm',share='all')
    axs.format(lonlim=(100, 105), latlim=(30, 35),labels=True)
    axs[1].format(lonlines=2,latlines=1)
    Image
  5. cvanelteren commented on Aug 22, 2026

    @cvanelteren
    Collaborator

    y label is turned of as it is sharing it with the left one. For the right one you formatted it differently; would need to check why this is not getting carried over.

  6. cvanelteren commented on Aug 22, 2026

    @cvanelteren
    Collaborator

    So I had to look this up as I vaguely recalled that I changed this behavior. The rationale is that even for shared states that axis specific indexing presumes that the user wants to modify that axis even within a shared state. So what you are seeing is that the plot is putting the grid in a different split while trying to comply with the same range.

    The relevant commit is: #8f66423a

  7. gepcel commented on Aug 23, 2026

    @gepcel
    CollaboratorAuthor

    But the behavior is not consistent for non geo axes

    fig,axs=pplt.subplots(ncols=2,refwidth='6cm',share='all')
    axs.format(xlim=(100, 105), ylim=(30, 35),labels=True)
    axs[1].format(xticks=2, yticks=1)
    Image
  8. cvanelteren commented on Aug 23, 2026

    @cvanelteren
    Collaborator

    This might be a cartopy idiosyncrasy let met investigate at bit

  9. cvanelteren commented on Aug 23, 2026

    @cvanelteren
    Collaborator

    Ah nvm yeah you are right. That needs fixing.

    Edit: I need to confirm first what my earlier comment referred to as I do think that was the intention from that past commit.

  10. cvanelteren commented on Aug 23, 2026

    @cvanelteren
    Collaborator

    Ok that issue is fixed on main @gepcel!

  11. gepcel commented on Aug 23, 2026

    @gepcel
    CollaboratorAuthor

    Closed by #801

  12. cvanelteren commented on Aug 23, 2026

    @cvanelteren
    Collaborator

    I more stuff comes up let me know as the sharing things are rather complex for me to sometimes track and it is probably not complete yet.

  13. gepcel commented on Aug 23, 2026

    @gepcel
    CollaboratorAuthor

    Ah, I thought things are done. I didn't see what you changed, but a simple test shows it solved. If there's other thing you'd like to do, you can reopen this issue as a reminder.

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