Sie können eine Farbe für Plots angeben, aber Seaborn wird die Farbe beim Plotten etwas stummschalten. Gibt es eine Möglichkeit, dieses Verhalten zu deaktivieren?Seaborn: Geben Sie eine genaue Farbe an
Beispiel:
import matplotlib
import seaborn as sns
import numpy as np
# Create some data
np.random.seed(0)
x = np.random.randn(100)
# Set the Seaborn style
sns.set_style('white')
# Specify a color for plotting
current_palette = matplotlib.colors.hex2color('#86b92e')
# Make a plot
g = sns.distplot(x, color=current_palette)
# Show what the color should look like
sns.palplot(current_palette)
Ich habe versucht, mehrere Möglichkeiten, die Farbe spezifizieren und alle verfügbaren Stile in Seaborn, aber nichts hat funktioniert. Ich benutze iPython Notebook und Python 2.7.
Haben Sie versucht, kde_kws/hist_kws anzugeben? https://web.stanford.edu/~mwaskom/software/seaborn/generated/seaborn.distplot.html – Caramiriel
Ich änderte meinen Plot-Befehl zu diesem: 'g = sns.distplot (x, hist_kws = {" alpha " : 1, "color": current_palette}) ' Es funktioniert super! Vielen Dank! – JoshuaA