FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

figure.py: import warnings, and make imports absolute by efiring · Pull Request #1133 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
49 changes: 27 additions & 22 deletions lib/matplotlib/figure.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,33 @@

"""
from __future__ import print_function
import warnings
from operator import itemgetter

import numpy as np

import artist
from artist import Artist, allow_rasterization
from axes import Axes, SubplotBase, subplot_class_factory
from cbook import allequal, Stack, iterable
from matplotlib import _image
import colorbar as cbar
from image import FigureImage
from matplotlib import rcParams
from patches import Rectangle
from text import Text, _process_text_args

from legend import Legend
from transforms import Affine2D, Bbox, BboxTransformTo, TransformedBbox
from projections import get_projection_names, process_projection_requirements
from matplotlib.blocking_input import BlockingMouseInput, BlockingKeyMouseInput
from matplotlib import rcParams, docstring

import matplotlib.artist as martist
from matplotlib.artist import Artist, allow_rasterization

import matplotlib.cbook as cbook
from matplotlib import docstring
from matplotlib.cbook import Stack, iterable

from operator import itemgetter
from matplotlib import _image
from matplotlib.image import FigureImage

import matplotlib.colorbar as cbar

from matplotlib.axes import Axes, SubplotBase, subplot_class_factory
from matplotlib.blocking_input import BlockingMouseInput, BlockingKeyMouseInput
from matplotlib.legend import Legend
from matplotlib.patches import Rectangle
from matplotlib.projections import (get_projection_names,
process_projection_requirements)
from matplotlib.text import Text, _process_text_args
from matplotlib.transforms import (Affine2D, Bbox, BboxTransformTo,
TransformedBbox)


docstring.interpd.update(projection_names = get_projection_names())
Expand Down Expand Up @@ -918,7 +923,7 @@ def draw(self, renderer):
not_composite = self.suppressComposite

if len(self.images)<=1 or not_composite or \
not allequal([im.origin for im in self.images]):
not cbook.allequal([im.origin for im in self.images]):
for a in self.images:
dsu.append( (a.get_zorder(), a, a.draw, [renderer]))
else:
Expand Down Expand Up @@ -1113,7 +1118,7 @@ def gca(self, **kwargs):
The following kwargs are supported for ensuring the returned axes
adheres to the given projection etc., and for axes creation if
the active axes does not exist:

%(Axes)s

"""
Expand All @@ -1135,7 +1140,7 @@ def gca(self, **kwargs):
kwargs_copy = kwargs.copy()
projection_class, _, key = \
process_projection_requirements(self, **kwargs_copy)

# let the returned axes have any gridspec by removing it from the key
ckey = ckey[1:]
key = key[1:]
Expand All @@ -1144,7 +1149,7 @@ def gca(self, **kwargs):
# continue and a new axes will be created
if key == ckey and isinstance(cax, projection_class):
return cax

# no axes found, so create one which spans the figure
return self.add_subplot(1, 1, 1, **kwargs)

Expand Down Expand Up @@ -1497,4 +1502,4 @@ def figaspect(arg):
newsize = np.clip(newsize,figsize_min,figsize_max)
return newsize

docstring.interpd.update(Figure=artist.kwdoc(Figure))
docstring.interpd.update(Figure=martist.kwdoc(Figure))

Back | FazBrowse Home | New Git URL