(self)
Update content of legends and their visibility
Update content of legends and their visibility
Update content of legends and their visibility
def update_legends(self):
        """Update content of legends and their visibility"""
        cont_color = self.master.is_continuous_color()
        shape_labels = self.master.get_shape_labels()
        color_labels = self.master.get_color_labels()
        if not cont_color and shape_labels is not None \
                and shape_labels == color_labels:
            colors = self.master.get_color_data()
            shapes = self.master.get_shape_data()
            mask = np.isfinite(colors) * np.isfinite(shapes)
            combined = (colors == shapes)[mask].all()
        else:
            combined = False
        if combined:
            self._update_combined_legend(shape_labels)
        else:
            self._update_shape_legend(shape_labels)
            if cont_color:
                self._update_continuous_color_legend(color_labels)
            else:
                self._update_color_legend(color_labels)
        self.update_legend_visibility()
        Updater.update_legend_font(self.parameter_setter.cat_legend_items,
                                   **self.parameter_setter.cat_legend_settings)
        Updater.update_num_legend_font(self.parameter_setter.num_legend,
                                       **self.parameter_setter.num_legend_settings)
def update_legends ( self ) : cont_color = self . master . is_continuous_color ( ) shape_labels = self . master . get_shape_labels ( ) color_labels = self . master . get_color_labels ( ) if not cont_color and shape_labels is not None and shape_labels == color_labels : colors = self . master . get_color_data ( ) shapes = self . master . get_shape_data ( ) mask = np . isfinite ( colors ) * np . isfinite ( shapes ) combined = ( colors == shapes ) [ mask ] . all ( ) else : combined = False if combined : self . _update_combined_legend ( shape_labels ) else : self . _update_shape_legend ( shape_labels ) if cont_color : self . _update_continuous_color_legend ( color_labels ) else : self . _update_color_legend ( color_labels ) self . update_legend_visibility ( ) Updater . update_legend_font ( self . parameter_setter . cat_legend_items , * * self . parameter_setter . cat_legend_settings ) Updater . update_num_legend_font ( self . parameter_setter . num_legend , * * self . parameter_setter . num_legend_settings )