def update_preview(self, list_obj: wx.ListBox, axes: matplotlib.axes.Axes):
        """
		Update the preview from the given list

		:param list_obj: The list to update the preview for
		:param axes: The preview axes to update
		"""

        axes.clear()
        axes.axis("off")
        selection_string = list_obj.GetStringSelection()
        if selection_string == '':
            return

        axes.scatter(1, 1, s=400, color=selection_string, marker='s')
Ejemplo n.º 2
0
    def _add_properties(self,
                        ax: matplotlib.axes.Axes,
                        title: str = None,
                        title_padding: float = None,
                        save_path: str = None,
                        filename: str = None,
                        hide_axis: bool = False,
                        tight_layout: bool = True):

        if tight_layout:
            plt.tight_layout()

        if hide_axis:
            ax.axis('off')

        if title is not None:
            ax.set_title(title,
                         pad=title_padding,
                         fontdict={'fontweight': 'bold'})

        if save_path is not None and filename is not None:
            self._data_service.save_figure(save_path, filename, no_axis=False)