Exemple #1
0
    def __init__(self, endpoint_style={}, **kwargs):
        """

        Radviz Plot

        Parameters
        ----------------

        axis_style : {axis_style}
        endpoint_style : dict
            Endpoints are drawn at each extreme point of an objective. This style can be modified.
        labels : {labels}

        Other Parameters
        ----------------

        figsize : {figsize}
        title : {title}
        legend : {legend}
        tight_layout : {tight_layout}
        cmap : {cmap}

        """

        super().__init__(**kwargs)

        # set the default axis style
        set_if_none_from_tuples(self.axis_style, ("color", "black"),
                                ("linewidth", 1), ("alpha", 0.75))

        self.endpoint_style = endpoint_style
        set_if_none_from_tuples(self.endpoint_style, ("color", "black"),
                                ("s", 70), ("alpha", 0.3))
Exemple #2
0
    def _plot(self, ax, _F, inner, outer, kwargs):

        set_if_none_from_tuples(kwargs, ("alpha", 0.5))

        # equal axis length and no ticks
        equal_axis(ax)
        no_ticks(ax)

        # draw the axis lines and labels
        plot_axes_lines(ax, outer, extend_factor=1.0, **self.axis_style)
        plot_axis_labels(ax,
                         outer,
                         self.get_labels(),
                         margin=0.015,
                         **self.axis_label_style)

        # plot the outer radar line and the inner polygon
        plot_radar_line(ax, outer, **self.axis_style)
        plot_polygon(ax, inner)

        # find the corresponding point
        _F = inner + _F[:, None] * (outer - inner)

        # plot the points and no polygon
        ax.scatter(_F[:, 0], _F[:, 1], **self.point_style)
        plot_polygon(ax, _F, **kwargs)
Exemple #3
0
    def __init__(self,
                 bounds=None,
                 show_bounds=True,
                 n_ticks=5,
                 normalize_each_axis=True,
                 bbox=False,
                 **kwargs):
        """

        Parallel Coordinate Plot


        Parameters
        ----------------

        bounds : {bounds}

        axis_style : {axis_style}

        labels : {labels}

        n_ticks : int
            Number of ticks to be shown on each parallel axis.

        show_bounds : bool
            Whether the value of the boundaries are shown in the plot or not.

        normalize_each_axis : bool
            Whether the values should be normalized either by bounds or implictly.

        Other Parameters
        ----------------

        figsize : {figsize}
        title : {title}
        legend : {legend}
        tight_layout : {tight_layout}
        cmap : {cmap}

        """

        super().__init__(bounds=bounds, **kwargs)
        self.show_bounds = show_bounds
        self.n_ticks = n_ticks
        self.bbox = bbox
        self.normalize_each_axis = normalize_each_axis

        set_if_none_from_tuples(self.axis_style, ("color", "red"),
                                ("linewidth", 2), ("alpha", 0.75))
Exemple #4
0
    def __init__(self,
                 cmap="Blues",
                 order_by_objectives=False,
                 reverse=True,
                 solution_labels=True,
                 **kwargs):
        """

        Heatmap

        Parameters
        ----------------

        cmap : str
            The color map to be used.

        order_by_objectives : int or list
            Whether the result should be ordered by an objective. If false no order.
            Otherwise, either supply just the objective or a list. (it is lexicographically sorted).

        reverse : bool
            If true large values are white and small values the corresponding color. Otherwise, the other way around.

        solution_labels : bool or list
            If False no labels are plotted in the y axis. If true just the corresponding index. Otherwise the label provided.

        bounds : {bounds}

        labels : {labels}

        Other Parameters
        ----------------

        figsize : {figsize}
        title : {title}
        legend : {legend}
        tight_layout : {tight_layout}
        cmap : {cmap}


        """

        super().__init__(cmap=cmap, reverse=reverse, **kwargs)
        self.order_by_objectives = order_by_objectives
        self.solution_labels = solution_labels

        # set default style
        set_if_none_from_tuples(self.axis_style, ("interpolation", "nearest"),
                                ("vmin", 0), ("vmax", 1))
Exemple #5
0
    def __init__(self,
                 normalize_each_objective=True,
                 n_partitions=3,
                 point_style={},
                 **kwargs):
        """

        Radar Plot

        Parameters
        ----------------
        normalize_each_objective : bool
            Whether each objective is normalized. Otherwise the inner and outer bound is plotted.

        point_style : dict
            The style being used to visualize the points

        n_partitions : int
            Number of partitions to show in the radar.

        reverse : {reverse}
            Reverses the plotting. Larger area is better. Works only when normalize_each_objective is set to true.

        axis_style : {axis_style}
        labels : {labels}

        Other Parameters
        ----------------

        figsize : {figsize}
        title : {title}
        legend : {legend}
        tight_layout : {tight_layout}
        cmap : {cmap}

        """

        super().__init__(**kwargs)
        self.normalize_each_objective = normalize_each_objective
        self.n_partitions = n_partitions

        self.point_style = point_style
        set_if_none_from_tuples(self.point_style, ("s", 15))

        set_if_none_from_tuples(self.axis_style, ("color", "black"),
                                ("linewidth", 0.5), ("alpha", 0.75))