当前位置: 首页>>代码示例>>Python>>正文


Python seaborn.light_palette方法代码示例

本文整理汇总了Python中seaborn.light_palette方法的典型用法代码示例。如果您正苦于以下问题:Python seaborn.light_palette方法的具体用法?Python seaborn.light_palette怎么用?Python seaborn.light_palette使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在seaborn的用法示例。


在下文中一共展示了seaborn.light_palette方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import seaborn [as 别名]
# 或者: from seaborn import light_palette [as 别名]
def __init__(self,
                 observation_space,
                 substation_layout=None,
                 radius_sub=25.,
                 load_prod_dist=70.,
                 bus_radius=4.):
        """

        Parameters
        ----------
        substation_layout: ``list``
            List of tupe given the position of each of the substation of the powergrid.

        observation_space: :class:`grid2op.Observation.ObservationSpace`
            BaseObservation space

        """
        BasePlot.__init__(self,
                          substation_layout=substation_layout,
                          observation_space=observation_space,
                          radius_sub=radius_sub,
                          load_prod_dist=load_prod_dist,
                          bus_radius=bus_radius)
        if not can_plot:
            raise PlotError("Impossible to plot as plotly cannot be imported. Please install \"plotly\" and "
                            "\"seaborn\" with \"pip install --update plotly seaborn\"")

        # define a color palette, whatever...
        sns.set()
        pal = sns.light_palette("darkred", 8)
        self.cols = pal.as_hex()[1:]

        self.col_line = "royalblue"
        self.col_sub = "red"
        self.col_load = "black"
        self.col_gen = "darkgreen"
        self.default_color = "black"
        self.type_fig_allowed = go.Figure 
开发者ID:rte-france,项目名称:Grid2Op,代码行数:40,代码来源:PlotPlotly.py

示例2: colors

# 需要导入模块: import seaborn [as 别名]
# 或者: from seaborn import light_palette [as 别名]
def colors():

        if Driver.Colors is None or len(Driver.Colors) != Driver.MaxSourceSupport:

            cp = sns.light_palette("darkred", n_colors=Driver.MaxSourceSupport+1)
            # for r, g, b, _ in cp:
            #     cs.append("#{0:02x}{1:02x}{2:02x}".format(clamp(r), clamp(g), clamp(b)))
            Driver.Colors = cp

        return Driver.Colors 
开发者ID:johannesreiter,项目名称:treeomics,代码行数:12,代码来源:driver.py

示例3: _plot_kde

# 需要导入模块: import seaborn [as 别名]
# 或者: from seaborn import light_palette [as 别名]
def _plot_kde(output_res, pick_rows, color_palette, alpha=0.5):
    num_clusters = len(set(pick_rows))
    for ci in range(num_clusters):
        cur_plot_rows = pick_rows == ci
        cur_cmap = sns.light_palette(color_palette[ci], as_cmap=True)
        sns.kdeplot(output_res[cur_plot_rows, 0], output_res[cur_plot_rows, 1], cmap=cur_cmap, shade=True, alpha=alpha,
            shade_lowest=False)
        centroid = output_res[cur_plot_rows, :].mean(axis=0)
        plt.annotate('%s' % ci, xy=centroid, xycoords='data', alpha=0.5,
                     horizontalalignment='center', verticalalignment='center') 
开发者ID:jsilter,项目名称:parametric_tsne,代码行数:12,代码来源:example_viz_parametric_tSNE.py


注:本文中的seaborn.light_palette方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。