Skip to content

mpl_toolkits.axes_grid1.axes_divider.LocatableAxes has inconsistent ticks #7378

Closed

Description

@QuLogic

I'm using latest v2.x (4ea9892) to build some documentation and several examples are a bit non-reproducible. It seems like this is usually triggered by the examples that use AxesGrid. I've drilled down to it being something weird with LocatableAxes, which can be seen with this example:

import sys

import matplotlib.pyplot as plt
from matplotlib.transforms import Bbox
from mpl_toolkits.axes_grid1.axes_divider import LocatableAxes
from mpl_toolkits.axes_grid1.mpl_axes import Axes

AxesClass = LocatableAxes
#AxesClass = Axes

fig = plt.figure(1)
ax = AxesClass(fig, Bbox([[0.05, 0.05], [0.95, 0.95]]))
fig.add_axes(ax)

plt.savefig(sys.argv[1] + '.png')

If you run two or three times and compare the images, the ticks in the corners will generally be slightly off, usually differing by one bit in the outermost pixel. If you uncomment the line above to use Axes instead, then there is no issue. If I understand correctly, LocatableAxes just adds the LocatableAxesBase mixin to Axes, which appears to do nothing much by default. So I don't really understand why it breaks stuff.

This is probably related to the bugginess in #6759.

Activity

  1. anntzer commented on Jul 6, 2019

    @anntzer
    Contributor

    LocatableAxes is no more (deprecated in #10403 and removed in master), so I think this can be closed?

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions