File: axes_grid.py

package info (click to toggle)
matplotlib 2.0.0%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 91,640 kB
  • ctags: 29,525
  • sloc: python: 122,697; cpp: 60,806; ansic: 30,799; objc: 2,830; makefile: 224; sh: 85
file content (32 lines) | stat: -rw-r--r-- 954 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from __future__ import (absolute_import, division, print_function,
                        unicode_literals)

import six

import mpl_toolkits.axes_grid1.axes_grid as axes_grid_orig
from .axes_divider import LocatableAxes

class CbarAxes(axes_grid_orig.CbarAxesBase, LocatableAxes):
    def __init__(self, *kl, **kwargs):
        orientation=kwargs.pop("orientation", None)
        if orientation is None:
            raise ValueError("orientation must be specified")
        self.orientation = orientation
        self._default_label_on = False
        self.locator = None

        super(LocatableAxes, self).__init__(*kl, **kwargs)

    def cla(self):
        super(LocatableAxes, self).cla()
        self._config_axes()


class Grid(axes_grid_orig.Grid):
    _defaultLocatableAxesClass = LocatableAxes

class ImageGrid(axes_grid_orig.ImageGrid):
    _defaultLocatableAxesClass = LocatableAxes
    _defaultCbarAxesClass = CbarAxes

AxesGrid = ImageGrid