Best Python code snippet using localstack_python
overlays.py
Source:overlays.py  
1import warnings2from mpl_toolkits.axes_grid.anchored_artists \3    import AnchoredEllipse, AnchoredSizeBar4import numpy as np5from matplotlib.patches import FancyArrowPatch6from matplotlib.font_manager import FontProperties7from . import wcs_util8from .decorators import auto_refresh9corners = {}10corners['top right'] = 111corners['top left'] = 212corners['bottom left'] = 313corners['bottom right'] = 414corners['right'] = 515corners['left'] = 616corners['bottom'] = 817corners['top'] = 918class Compass(object):19    def _initialize_compass(self):20        # Initialize compass holder21        self._compass = None22        self._compass_show = False23        # Set grid event handler24        self._ax1.callbacks.connect('xlim_changed', self.update_compass)25        self._ax1.callbacks.connect('ylim_changed', self.update_compass)26    @auto_refresh27    def show_compass(self, color='red', length=0.1, corner=4, frame=True):28        '''29        Display a scalebar30        Required Arguments:31            *length*:[ float ]32                The length of the scalebar33        Optional Keyword Arguments:34            *label*: [ string ]35                Label to place above the scalebar36            *corner*: [ integer ]37                Where to place the scalebar. Acceptable values are:, 'left', 'right', 'top', 'bottom', 'top left', 'top right', 'bottom left' (default), 'bottom right'38            *frame*: [ True | False ]39                Whether to display a frame behind the scalebar (default is False)40            Additional keyword arguments can be used to control the appearance41            of the scalebar, which is made up of an instance of the matplotlib42            Rectangle class and a an instance of the Text class. For more43            information on available arguments, see44            `Rectangle <http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.patches.Rectangle>`_45            and46            `Text <http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.text.Text>`_`.47            In cases where the same argument exists for the two objects, the48            argument is passed to both the Text and Rectangle instance49        '''50        w = 2 * length51        pos = {1: (1 - w, 1 - w),52               2: (w, 1 - w),53               3: (w, w),54               4: (1 - w, w),55               5: (1 - w, 0.5),56               6: (w, 0.5),57               7: (1 - w, 0.5),58               8: (0.5, w),59               9: (0.5, 1 - w)}60        self._compass_position = pos[corner]61        self._compass_length = length62        self._compass_color = color63        self._compass = None64        self._compass_show = True65        self.update_compass()66    @auto_refresh67    def update_compass(self, *args, **kwargs):68        if not self._compass_show:69            return70        rx, ry = self._compass_position71        length = self._compass_length72        color = self._compass_color73        xmin, xmax = self._ax1.get_xlim()74        ymin, ymax = self._ax1.get_ylim()75        x0 = rx * (xmax - xmin) + xmin76        y0 = ry * (ymax - ymin) + ymin77        xw, yw = self.pixel2world(x0, y0)78        len_pix = length * (ymax - ymin)79        pixel_scale = wcs_util.pixel_scale(self._wcs)80        len_deg = len_pix * pixel_scale81        # Should really only do tiny displacement then magnify the vectors - important if there is curvature82        x1, y1 = self.world2pixel(xw + len_deg / np.cos(np.radians(yw)), yw)83        x2, y2 = self.world2pixel(xw, yw + len_deg)84        if self._compass:85            self._compass[0].remove()86            self._compass[1].remove()87        arrow1 = FancyArrowPatch(posA=(x0, y0), posB=(x1, y1), arrowstyle='-|>', mutation_scale=20., fc=color, ec=color, shrinkA=0., shrinkB=0.)88        arrow2 = FancyArrowPatch(posA=(x0, y0), posB=(x2, y2), arrowstyle='-|>', mutation_scale=20., fc=color, ec=color, shrinkA=0., shrinkB=0.)89        self._compass = (arrow1, arrow2)90        self._ax1.add_patch(arrow1)91        self._ax1.add_patch(arrow2)92    @auto_refresh93    def hide_compass(self):94        pass95class ScaleBar(object):96    def __init__(self, parent):97        # Retrieve info from parent figure98        self._ax = parent._ax199        self._wcs = parent._wcs100        self._figure = parent._figure101        # Save plotting parameters (required for @auto_refresh)102        self._parameters = parent._parameters103        # Initialize settings104        self._base_settings = {}105        self._scalebar_settings = {}106        self._label_settings = {}107        self._label_settings['fontproperties'] = FontProperties()108    # LAYOUT109    @auto_refresh110    def show(self, length, label=None, corner='bottom right', frame=False, borderpad=0.4, pad=0.5, **kwargs):111        '''112        Overlay a scale bar on the image.113        Required Arguments:114            *length*:[ float ]115                The length of the scalebar116        Optional Keyword Arguments:117            *label*: [ string ]118                Label to place below the scalebar119            *corner*: [ integer ]120                Where to place the scalebar. Acceptable values are:, 'left',121                'right', 'top', 'bottom', 'top left', 'top right', 'bottom122                left' (default), 'bottom right'123            *frame*: [ True | False ]124                Whether to display a frame behind the scalebar (default is False)125        Advanced:126            Additional arguments are passed to the matplotlib Rectangle and127            Text classes. See the matplotlib documentation for more details.128            In cases where the same argument exists for the two objects, the129            argument is passed to both the Text and Rectangle instance.130        '''131        self._length = length132        self._base_settings['corner'] = corner133        self._base_settings['frame'] = frame134        self._base_settings['borderpad'] = borderpad135        self._base_settings['pad'] = pad136        pixel_scale = wcs_util.pixel_scale(self._wcs)137        length = length / pixel_scale138        try:139            self._scalebar.remove()140        except:141            pass142        if isinstance(corner, basestring):143            corner = corners[corner]144        self._scalebar = AnchoredSizeBar(self._ax.transData, length, label, corner, \145                              pad=pad, borderpad=borderpad, sep=5, frameon=frame)146        self._ax.add_artist(self._scalebar)147        self.set(**kwargs)148    @auto_refresh149    def _remove(self):150        self._scalebar.remove()151    @auto_refresh152    def hide(self):153        '''154        Hide the scalebar.155        '''156        try:157            self._scalebar.remove()158        except:159            pass160    @auto_refresh161    def set_length(self, length):162        '''163        Set the length of the scale bar.164        '''165        self.show(length, **self._base_settings)166        self._set_scalebar_properties(**self._scalebar_settings)167        self._set_label_properties(**self._scalebar_settings)168    @auto_refresh169    def set_label(self, label):170        '''171        Set the label of the scale bar.172        '''173        self._set_label_properties(text=label)174    @auto_refresh175    def set_corner(self, corner):176        '''177        Set where to place the scalebar. Acceptable values are 'left', 'right',178        'top', 'bottom', 'top left', 'top right', 'bottom left' (default), and179        'bottom right'.180        '''181        self._base_settings['corner'] = corner182        self.show(self._length, **self._base_settings)183        self._set_scalebar_properties(**self._scalebar_settings)184        self._set_label_properties(**self._scalebar_settings)185    @auto_refresh186    def set_frame(self, frame):187        '''188        Set whether to display a frame around the scalebar.189        '''190        self._base_settings['frame'] = frame191        self.show(self._length, **self._base_settings)192        self._set_scalebar_properties(**self._scalebar_settings)193        self._set_label_properties(**self._scalebar_settings)194    # APPEARANCE195    @auto_refresh196    def set_linewidth(self, linewidth):197        '''198        Set the linewidth of the scalebar, in points.199        '''200        self._set_scalebar_properties(linewidth=linewidth)201    @auto_refresh202    def set_linestyle(self, linestyle):203        '''204        Set the linestyle of the scalebar. Should be one of 'solid', 'dashed',205        'dashdot', or 'dotted'.206        '''207        self._set_scalebar_properties(linestyle=linestyle)208    @auto_refresh209    def set_alpha(self, alpha):210        '''211        Set the alpha value (transparency). This should be a floating point212        value between 0 and 1.213        '''214        self._set_scalebar_properties(alpha=alpha)215        self._set_label_properties(alpha=alpha)216    @auto_refresh217    def set_color(self, color):218        '''219        Set the label and scalebar color.220        '''221        self._set_scalebar_properties(color=color)222        self._set_label_properties(color=color)223    @auto_refresh224    def set_font(self, family=None, style=None, variant=None, stretch=None, weight=None, size=None, fontproperties=None):225        '''226        Set the font of the tick labels227        Optional Keyword Arguments:228        common: family, style, variant, stretch, weight, size, fontproperties229        Default values are set by matplotlib or previously set values if230        set_font has already been called. Global default values can be set by231        editing the matplotlibrc file.232        '''233        if family:234            self._label_settings['fontproperties'].set_family(family)235        if style:236            self._label_settings['fontproperties'].set_style(style)237        if variant:238            self._label_settings['fontproperties'].set_variant(variant)239        if stretch:240            self._label_settings['fontproperties'].set_stretch(stretch)241        if weight:242            self._label_settings['fontproperties'].set_weight(weight)243        if size:244            self._label_settings['fontproperties'].set_size(size)245        if fontproperties:246            self._label_settings['fontproperties'] = fontproperties247        self._set_label_properties(fontproperties=self._label_settings['fontproperties'])248    @auto_refresh249    def _set_label_properties(self, **kwargs):250        '''251        Modify the scalebar label properties. All arguments are passed to the252        matplotlib Text class. See the matplotlib documentation for more253        details.254        '''255        for kwarg in kwargs:256            self._label_settings[kwarg] = kwargs[kwarg]257        self._scalebar.txt_label.get_children()[0].set(**kwargs)258    @auto_refresh259    def _set_scalebar_properties(self, **kwargs):260        '''261        Modify the scalebar properties. All arguments are passed to the262        matplotlib Rectangle class. See the matplotlib documentation for more263        details.264        '''265        for kwarg in kwargs:266            self._scalebar_settings[kwarg] = kwargs[kwarg]267        self._scalebar.size_bar.get_children()[0].set(**kwargs)268    @auto_refresh269    def set(self, **kwargs):270        '''271        Modify the scalebar and scalebar properties. All arguments are passed272        to the matplotlib Rectangle and Text classes. See the matplotlib273        documentation for more details. In cases where the same argument274        exists for the two objects, the argument is passed to both the Text275        and Rectangle instance.276        '''277        for kwarg in kwargs:278            kwargs_single = {kwarg: kwargs[kwarg]}279            try:280                self._set_label_properties(**kwargs_single)281            except AttributeError:282                pass283            try:284                self._set_scalebar_properties(**kwargs_single)285            except AttributeError:286                pass287    # DEPRECATED288    @auto_refresh289    def set_font_family(self, family):290        warnings.warn("scalebar.set_font_family is deprecated - use scalebar.set_font instead", DeprecationWarning)291        self.set_font(family=family)292    @auto_refresh293    def set_font_weight(self, weight):294        warnings.warn("scalebar.set_font_weight is deprecated - use scalebar.set_font instead", DeprecationWarning)295        self.set_font(weight=weight)296    @auto_refresh297    def set_font_size(self, size):298        warnings.warn("scalebar.set_font_size is deprecated - use scalebar.set_font instead", DeprecationWarning)299        self.set_font(size=size)300    @auto_refresh301    def set_font_style(self, style):302        warnings.warn("scalebar.set_font_style is deprecated - use scalebar.set_font instead", DeprecationWarning)303        self.set_font(style=style)304class Beam(object):305    def __init__(self, parent):306        # Retrieve info from parent figure307        self._figure = parent._figure308        self._header = parent._header309        self._ax = parent._ax1310        self._wcs = parent._wcs311        # Initialize settings312        self._base_settings = {}313        self._beam_settings = {}314    # LAYOUT315    @auto_refresh316    def show(self, major='BMAJ', minor='BMIN', \317        angle='BPA', corner='bottom left', frame=False, borderpad=0.4, pad=0.5, **kwargs):318        '''319        Display the beam shape and size for the primary image320        By default, this method will search for the BMAJ, BMIN, and BPA321        keywords in the FITS header to set the major and minor axes and the322        position angle on the sky.323        Optional Keyword Arguments:324            *major*: [ float ]325                Major axis of the beam in degrees (overrides BMAJ if present)326            *minor*: [ float ]327                Minor axis of the beam in degrees (overrides BMIN if present)328            *angle*: [ float ]329                Position angle of the beam on the sky in degrees (overrides330                BPA if present) in the anticlockwise direction.331            *corner*: [ integer ]332                The beam location. Acceptable values are 'left', 'right',333                'top', 'bottom', 'top left', 'top right', 'bottom left'334                (default), and 'bottom right'.335            *frame*: [ True | False ]336                Whether to display a frame behind the beam (default is False)337        Advanced:338            Additional arguments are passed to the matplotlib Ellipse classe.339            See the matplotlib documentation for more details.340        '''341        if isinstance(major, basestring):342            major = self._header[major]343        if isinstance(minor, basestring):344            minor = self._header[minor]345        if isinstance(angle, basestring):346            angle = self._header[angle]347        pixel_scale = wcs_util.pixel_scale(self._wcs)348        self._base_settings['minor'] = minor349        self._base_settings['major'] = major350        self._base_settings['angle'] = angle351        self._base_settings['corner'] = corner352        self._base_settings['frame'] = frame353        self._base_settings['borderpad'] = borderpad354        self._base_settings['pad'] = pad355        minor /= pixel_scale356        major /= pixel_scale357        try:358            self._beam.remove()359        except:360            pass361        if isinstance(corner, basestring):362            corner = corners[corner]363        self._beam = AnchoredEllipse(self._ax.transData, \364            width=minor, height=major, angle=angle, \365            loc=corner, pad=pad, borderpad=borderpad, frameon=frame)366        self._ax.add_artist(self._beam)367        self.set(**kwargs)368    @auto_refresh369    def _remove(self):370        self._beam.remove()371    @auto_refresh372    def hide(self):373        '''374        Hide the beam375        '''376        try:377            self._beam.remove()378        except:379            pass380    @auto_refresh381    def set_major(self, major):382        '''383        Set the major axis of the beam, in degrees.384        '''385        self._base_settings['major'] = major386        self.show(**self._base_settings)387        self.set(**self._beam_settings)388    @auto_refresh389    def set_minor(self, minor):390        '''391        Set the minor axis of the beam, in degrees.392        '''393        self._base_settings['minor'] = minor394        self.show(**self._base_settings)395        self.set(**self._beam_settings)396    @auto_refresh397    def set_angle(self, angle):398        '''399        Set the position angle of the beam on the sky in degrees.400        '''401        self._base_settings['angle'] = angle402        self.show(**self._base_settings)403        self.set(**self._beam_settings)404    @auto_refresh405    def set_corner(self, corner):406        '''407        Set the beam location. Acceptable values are 'left', 'right', 'top',408        'bottom', 'top left', 'top right', 'bottom left' (default), and409        'bottom right'.410        '''411        self._base_settings['corner'] = corner412        self.show(**self._base_settings)413        self.set(**self._beam_settings)414    @auto_refresh415    def set_frame(self, frame):416        '''417        Set whether to display a frame around the beam.418        '''419        self._base_settings['frame'] = frame420        self.show(**self._base_settings)421        self.set(**self._beam_settings)422    @auto_refresh423    def set_borderpad(self, borderpad):424        '''425        Set the amount of padding within the beam object, relative to the426        canvas size.427        '''428        self._base_settings['borderpad'] = borderpad429        self.show(**self._base_settings)430        self.set(**self._beam_settings)431    @auto_refresh432    def set_pad(self, pad):433        '''434        Set the amount of padding between the beam object and the image435        corner/edge, relative to the canvas size.436        '''437        self._base_settings['pad'] = pad438        self.show(**self._base_settings)439        self.set(**self._beam_settings)440    # APPEARANCE441    @auto_refresh442    def set_alpha(self, alpha):443        '''444        Set the alpha value (transparency). This should be a floating point445        value between 0 and 1.446        '''447        self.set(alpha=alpha)448    @auto_refresh449    def set_color(self, color):450        '''451        Set the beam color.452        '''453        self.set(color=color)454    @auto_refresh455    def set_edgecolor(self, edgecolor):456        '''457        Set the color for the edge of the beam.458        '''459        self.set(edgecolor=edgecolor)460    @auto_refresh461    def set_facecolor(self, facecolor):462        '''463        Set the color for the interior of the beam.464        '''465        self.set(facecolor=facecolor)466    @auto_refresh467    def set_linestyle(self, linestyle):468        '''469        Set the line style for the edge of the beam. This should be one of470        'solid', 'dashed', 'dashdot', or 'dotted'.471        '''472        self.set(linestyle=linestyle)473    @auto_refresh474    def set_linewidth(self, linewidth):475        '''476        Set the line width for the edge of the beam, in points.477        '''478        self.set(linewidth=linewidth)479    @auto_refresh480    def set_hatch(self, hatch):481        '''482        Set the hatch pattern. This should be one of '/', '\', '|', '-', '+',483        'x', 'o', 'O', '.', or '*'.484        '''485        self.set(hatch=hatch)486    @auto_refresh487    def set(self, **kwargs):488        '''489        Modify the beam properties. All arguments are passed to the matplotlib490        Ellipse classe. See the matplotlib documentation for more details.491        '''492        for kwarg in kwargs:493            self._beam_settings[kwarg] = kwargs[kwarg]...colorbar.py
Source:colorbar.py  
1import warnings2import matplotlib.axes as maxes3from mpl_toolkits.axes_grid import make_axes_locatable4from matplotlib.font_manager import FontProperties5from .decorators import auto_refresh, fixdocstring6# As of matplotlib 0.99.1.1, any time a colorbar property is updated, the axes7# need to be removed and re-created. This has been fixed in svn r8213 but we8# should wait until we up the required version of matplotlib before changing the9# code here10class Colorbar(object):11    def __init__(self, parent):12        self._figure = parent._figure13        self._colorbar_axes = None14        self._parent = parent15        # Save plotting parameters (required for @auto_refresh)16        self._parameters = parent._parameters17        self._base_settings = {}18        self._label_fontproperties = FontProperties()19    @auto_refresh20    def show(self, location='right', width=0.2, pad=0.05, ticks=None, labels=True, box=None, box_orientation='vertical'):21        '''22        Show a colorbar on the side of the image.23        Optional Keyword Arguments:24            *location*: [ string ]25                Where to place the colorbar. Should be one of 'left', 'right', 'top', 'bottom'.26            *width*: [ float ]27                The width of the colorbar relative to the canvas size.28            *pad*: [ float ]29                The spacing between the colorbar and the image relative to the canvas size.30            *ticks*: [ None or list ]31                The position of the ticks on the colorbar.32            *labels*: [ True or False ]33                Whether to show numerical labels.34            *box*: [ list ]35                A custom box within which to place the colorbar. This should36                be in the form [xmin, ymin, dx, dy] and be in relative figure37                units. This overrides the location argument.38            *box_orientation* [ str ]39                The orientation of the colorbar within the box. Can be40                'horizontal' or 'vertical'41        '''42        self._base_settings['location'] = location43        self._base_settings['width'] = width44        self._base_settings['pad'] = pad45        self._base_settings['ticks'] = ticks46        self._base_settings['labels'] = labels47        self._base_settings['box'] = box48        self._base_settings['box_orientation'] = box_orientation49        if self._parent.image:50            if self._colorbar_axes:51                self._parent._figure.delaxes(self._colorbar_axes)52            if box is None:53                divider = make_axes_locatable(self._parent._ax1)54                if location == 'right':55                    self._colorbar_axes = divider.new_horizontal(size=width, pad=pad, axes_class=maxes.Axes)56                    orientation = 'vertical'57                elif location == 'top':58                    self._colorbar_axes = divider.new_vertical(size=width, pad=pad, axes_class=maxes.Axes)59                    orientation = 'horizontal'60                elif location == 'left':61                    warnings.warn("Left colorbar not fully implemented")62                    self._colorbar_axes = divider.new_horizontal(size=width, pad=pad, pack_start=True, axes_class=maxes.Axes)63                    locator = divider.new_locator(nx=0, ny=0)64                    self._colorbar_axes.set_axes_locator(locator)65                    orientation = 'vertical'66                elif location == 'bottom':67                    warnings.warn("Bottom colorbar not fully implemented")68                    self._colorbar_axes = divider.new_vertical(size=width, pad=pad, pack_start=True, axes_class=maxes.Axes)69                    locator = divider.new_locator(nx=0, ny=0)70                    self._colorbar_axes.set_axes_locator(locator)71                    orientation = 'horizontal'72                else:73                    raise Exception("location should be one of: right/top")74                self._parent._figure.add_axes(self._colorbar_axes)75            else:76                self._colorbar_axes = self._parent._figure.add_axes(box)77                orientation = box_orientation78            self._colorbar = self._parent._figure.colorbar(self._parent.image, cax=self._colorbar_axes, orientation=orientation, ticks=ticks)79            if location == 'right':80                for tick in self._colorbar_axes.yaxis.get_major_ticks():81                    tick.tick1On = True82                    tick.tick2On = True83                    tick.label1On = False84                    tick.label2On = labels85            elif location == 'top':86                for tick in self._colorbar_axes.xaxis.get_major_ticks():87                    tick.tick1On = True88                    tick.tick2On = True89                    tick.label1On = False90                    tick.label2On = labels91            elif location == 'left':92                for tick in self._colorbar_axes.yaxis.get_major_ticks():93                    tick.tick1On = True94                    tick.tick2On = True95                    tick.label1On = labels96                    tick.label2On = False97            elif location == 'bottom':98                for tick in self._colorbar_axes.xaxis.get_major_ticks():99                    tick.tick1On = True100                    tick.tick2On = True101                    tick.label1On = labels102                    tick.label2On = False103        else:104            warnings.warn("No image is shown, therefore, no colorbar will be plotted")105    @auto_refresh106    def update(self):107        if self._colorbar_axes:108            self.show(**self._base_settings)109    @auto_refresh110    def hide(self):111        self._parent._figure.delaxes(self._colorbar_axes)112        self._colorbar_axes = None113    @auto_refresh114    def _remove(self):115        self._parent._figure.delaxes(self._colorbar_axes)116    # LOCATION AND SIZE117    @auto_refresh118    def set_location(self, location):119        '''120        Set the location of the colorbar. Should be one of 'left', 'right', 'top', 'bottom'.121        '''122        self._base_settings['location'] = location123        self.show(**self._base_settings)124        self.set_font(fontproperties=self._label_fontproperties)125    @auto_refresh126    def set_width(self, width):127        '''128        Set the width of the colorbar relative to the canvas size.129        '''130        self._base_settings['width'] = width131        self.show(**self._base_settings)132        self.set_font(fontproperties=self._label_fontproperties)133    @auto_refresh134    def set_pad(self, pad):135        '''136        Set the spacing between the colorbar and the image relative to the canvas size.137        '''138        self._base_settings['pad'] = pad139        self.show(**self._base_settings)140        self.set_font(fontproperties=self._label_fontproperties)141    @auto_refresh142    def set_ticks(self, ticks):143        '''144        Set the position of the ticks on the colorbar.145        '''146        self._base_settings['ticks'] = ticks147        self.show(**self._base_settings)148        self.set_font(fontproperties=self._label_fontproperties)149    @auto_refresh150    def set_labels(self, labels):151        '''152        Set whether to show numerical labels.153        '''154        self._base_settings['labels'] = labels155        self.show(**self._base_settings)156        self.set_font(fontproperties=self._label_fontproperties)157    @auto_refresh158    def set_box(self, box, box_orientation='vertical'):159        '''160        Set the box within which to place the colorbar. This should be in the161        form [xmin, ymin, dx, dy] and be in relative figure units. The162        orientation of the colorbar within the box can be controlled with the163        box_orientation argument.164        '''165        self._base_settings['box'] = box166        self._base_settings['box_orientation'] = box_orientation167        self.show(**self._base_settings)168        self.set_font(fontproperties=self._label_fontproperties)169    # FONT PROPERTIES170    @auto_refresh171    def set_label_properties(self, *args, **kwargs):172        warnings.warn("set_label_properties is deprecated - use set_font instead", DeprecationWarning)173        self.set_font(*args, **kwargs)174    @auto_refresh175    @fixdocstring176    def set_font(self, family=None, style=None, variant=None, stretch=None, weight=None, size=None, fontproperties=None):177        '''178        Set the font of the tick labels179        Optional Keyword Arguments:180        common: family, style, variant, stretch, weight, size, fontproperties181        Default values are set by matplotlib or previously set values if182        set_font has already been called. Global default values can be set by183        editing the matplotlibrc file.184        '''185        if family:186            self._label_fontproperties.set_family(family)187        if style:188            self._label_fontproperties.set_style(style)189        if variant:190            self._label_fontproperties.set_variant(variant)191        if stretch:192            self._label_fontproperties.set_stretch(stretch)193        if weight:194            self._label_fontproperties.set_weight(weight)195        if size:196            self._label_fontproperties.set_size(size)197        if fontproperties:198            self._label_fontproperties = fontproperties199        for label in self._colorbar_axes.get_xticklabels():200            label.set_fontproperties(self._label_fontproperties)201        for label in self._colorbar_axes.get_yticklabels():202            label.set_fontproperties(self._label_fontproperties)203    # FRAME PROPERTIES204    @auto_refresh205    def set_frame_linewidth(self, linewidth):206        '''207        Set the linewidth of the colorbar frame, in points208        '''209        warnings.warn("This method is not functional at this time")210        for key in self._colorbar_axes.spines:211            self._colorbar_axes.spines[key].set_linewidth(linewidth)212    @auto_refresh213    def set_frame_color(self, color):214        '''215        Set the color of the colorbar frame, in points216        '''217        warnings.warn("This method is not functional at this time")218        for key in self._colorbar_axes.spines:...Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
