Python seaborn.light_palette() Examples
The following are 4
code examples of seaborn.light_palette().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
seaborn
, or try the search function
.
Example #1
Source File: PlotPlotly.py From Grid2Op with Mozilla Public License 2.0 | 5 votes |
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
Example #2
Source File: PlotPlotly.py From Grid2Op with Mozilla Public License 2.0 | 5 votes |
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
Example #3
Source File: driver.py From treeomics with GNU General Public License v3.0 | 5 votes |
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
Example #4
Source File: example_viz_parametric_tSNE.py From parametric_tsne with MIT License | 5 votes |
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')