seaborn problem
enter image description here# Make dataframe
df = pd.DataFrame({'Magnitudes': magnitudes, 'Lengths': np.log10(lengths), 'Widths': np.log10(widths)})
# Colors for violins
palette = sns.color_palette("Set2", len(fullpaths))
sns.set_style("darkgrid", {"grid.color": ".6", "grid.linestyle": ":"})
# Crear gráficos de violín con regresión lineal y personalización de color
plt.figure()
plt.subplot(2, 1, 1)
sns.regplot(x='Magnitudes', y='Lengths', data=df,scatter_kws={"alpha" : 0.0})
sns.violinplot(x='Magnitudes', y='Lengths', data=df, palette=palette, alpha=0.5,hue='Magnitudes',legend=False)
plt.title('Violin Plot of Lengths vs Magnitude')
plt.xlabel('Magnitude')
plt.ylabel('Lengths')
plt.subplot(2, 1, 2)
sns.regplot(x='Magnitudes', y='Widths', data=df,scatter_kws={"alpha" : 0.0})
sns.violinplot(x='Magnitudes', y='Widths', data=df, palette=palette, alpha=0.5,hue='Magnitudes',legend=False)
plt.title('Violin Plot of Widths vs Magnitude')
plt.xlabel('Magnitude')
plt.ylabel('Widths')
this is my code, and show regplot bad, I know this because when I just graph the regressions, it looks like this
some idea?
enter image description here
New contributor
Alex Villarroel Carrasco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.