Python matplotlib.transforms.interval_contains() Examples

The following are 17 code examples of matplotlib.transforms.interval_contains(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module matplotlib.transforms , or try the search function .
Example #1
Source File: axis.py    From matplotlib-4-abaqus with MIT License 6 votes vote down vote up
def draw(self, renderer):
        if not self.get_visible():
            return
        renderer.open_group(self.__name__)
        midPoint = mtransforms.interval_contains(self.get_view_interval(),
                                                 self.get_loc())

        if midPoint:
            if self.gridOn:
                self.gridline.draw(renderer)
            if self.tick1On:
                self.tick1line.draw(renderer)
            if self.tick2On:
                self.tick2line.draw(renderer)

        if self.label1On:
            self.label1.draw(renderer)
        if self.label2On:
            self.label2.draw(renderer)

        renderer.close_group(self.__name__) 
Example #2
Source File: axis.py    From neural-network-animation with MIT License 6 votes vote down vote up
def draw(self, renderer):
        if not self.get_visible():
            return
        renderer.open_group(self.__name__)
        midPoint = mtransforms.interval_contains(self.get_view_interval(),
                                                 self.get_loc())

        if midPoint:
            if self.gridOn:
                self.gridline.draw(renderer)
            if self.tick1On:
                self.tick1line.draw(renderer)
            if self.tick2On:
                self.tick2line.draw(renderer)

        if self.label1On:
            self.label1.draw(renderer)
        if self.label2On:
            self.label2.draw(renderer)

        renderer.close_group(self.__name__) 
Example #3
Source File: axis.py    From Computable with MIT License 6 votes vote down vote up
def draw(self, renderer):
        if not self.get_visible():
            return
        renderer.open_group(self.__name__)
        midPoint = mtransforms.interval_contains(self.get_view_interval(),
                                                 self.get_loc())

        if midPoint:
            if self.gridOn:
                self.gridline.draw(renderer)
            if self.tick1On:
                self.tick1line.draw(renderer)
            if self.tick2On:
                self.tick2line.draw(renderer)

        if self.label1On:
            self.label1.draw(renderer)
        if self.label2On:
            self.label2.draw(renderer)

        renderer.close_group(self.__name__) 
Example #4
Source File: axis.py    From ImageFusion with MIT License 6 votes vote down vote up
def draw(self, renderer):
        if not self.get_visible():
            return
        renderer.open_group(self.__name__)
        midPoint = mtransforms.interval_contains(self.get_view_interval(),
                                                 self.get_loc())

        if midPoint:
            if self.gridOn:
                self.gridline.draw(renderer)
            if self.tick1On:
                self.tick1line.draw(renderer)
            if self.tick2On:
                self.tick2line.draw(renderer)

        if self.label1On:
            self.label1.draw(renderer)
        if self.label2On:
            self.label2.draw(renderer)

        renderer.close_group(self.__name__) 
Example #5
Source File: test_skew.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def gridOn(self):
        return (self._gridOn and (self._has_default_loc() or
                transforms.interval_contains(self.get_view_interval(),
                                             self.get_loc()))) 
Example #6
Source File: test_skew.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def _need_upper(self):
        return (self._has_default_loc() or
                transforms.interval_contains(self.axes.upper_xlim,
                                             self.get_loc())) 
Example #7
Source File: test_skew.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def _need_lower(self):
        return (self._has_default_loc() or
                transforms.interval_contains(self.axes.lower_xlim,
                                             self.get_loc())) 
Example #8
Source File: test_skew.py    From coffeegrindsize with MIT License 5 votes vote down vote up
def gridOn(self):
        return (self._gridOn and (self._has_default_loc() or
                transforms.interval_contains(self.get_view_interval(),
                                             self.get_loc()))) 
Example #9
Source File: test_skew.py    From coffeegrindsize with MIT License 5 votes vote down vote up
def _need_upper(self):
        return (self._has_default_loc() or
                transforms.interval_contains(self.axes.upper_xlim,
                                             self.get_loc())) 
Example #10
Source File: test_skew.py    From coffeegrindsize with MIT License 5 votes vote down vote up
def _need_lower(self):
        return (self._has_default_loc() or
                transforms.interval_contains(self.axes.lower_xlim,
                                             self.get_loc())) 
Example #11
Source File: test_skew.py    From ImageFusion with MIT License 5 votes vote down vote up
def draw(self, renderer):
        if not self.get_visible():
            return
        renderer.open_group(self.__name__)

        lower_interval = self.axes.xaxis.lower_interval
        upper_interval = self.axes.xaxis.upper_interval

        if self.gridOn and transforms.interval_contains(
                self.axes.xaxis.get_view_interval(), self.get_loc()):
            self.gridline.draw(renderer)

        if transforms.interval_contains(lower_interval, self.get_loc()):
            if self.tick1On:
                self.tick1line.draw(renderer)
            if self.label1On:
                self.label1.draw(renderer)

        if transforms.interval_contains(upper_interval, self.get_loc()):
            if self.tick2On:
                self.tick2line.draw(renderer)
            if self.label2On:
                self.label2.draw(renderer)

        renderer.close_group(self.__name__)


# This class exists to provide two separate sets of intervals to the tick,
# as well as create instances of the custom tick 
Example #12
Source File: test_skew.py    From python3_ios with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def _need_upper(self):
        return (self._has_default_loc() or
                transforms.interval_contains(self.axes.upper_xlim,
                                             self.get_loc())) 
Example #13
Source File: test_skew.py    From python3_ios with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def _need_lower(self):
        return (self._has_default_loc() or
                transforms.interval_contains(self.axes.lower_xlim,
                                             self.get_loc())) 
Example #14
Source File: skewt.py    From python3_ios with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def gridOn(self):
        return (self._gridOn and (self._has_default_loc() or
                transforms.interval_contains(self.get_view_interval(),
                                             self.get_loc()))) 
Example #15
Source File: skewt.py    From python3_ios with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def _need_upper(self):
        return (self._has_default_loc() or
                transforms.interval_contains(self.axes.upper_xlim,
                                             self.get_loc())) 
Example #16
Source File: skewt.py    From python3_ios with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def _need_lower(self):
        return (self._has_default_loc() or
                transforms.interval_contains(self.axes.lower_xlim,
                                             self.get_loc())) 
Example #17
Source File: test_skew.py    From neural-network-animation with MIT License 5 votes vote down vote up
def draw(self, renderer):
        if not self.get_visible():
            return
        renderer.open_group(self.__name__)

        lower_interval = self.axes.xaxis.lower_interval
        upper_interval = self.axes.xaxis.upper_interval

        if self.gridOn and transforms.interval_contains(
                self.axes.xaxis.get_view_interval(), self.get_loc()):
            self.gridline.draw(renderer)

        if transforms.interval_contains(lower_interval, self.get_loc()):
            if self.tick1On:
                self.tick1line.draw(renderer)
            if self.label1On:
                self.label1.draw(renderer)

        if transforms.interval_contains(upper_interval, self.get_loc()):
            if self.tick2On:
                self.tick2line.draw(renderer)
            if self.label2On:
                self.label2.draw(renderer)

        renderer.close_group(self.__name__)


# This class exists to provide two separate sets of intervals to the tick,
# as well as create instances of the custom tick