plotly / plotly/plotly.py

ecdf with normed histogram

Ouverte
#4,772 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

feature P3
Langage dominant
Python
Étoiles
18.8k
Forks
2.8k
Merge moyen
16 h 26 min
PR mergées (30 j)
21

Description

I really like the plotly.express.ecdf and have been using it a lot in my daily work.
When I show ecdf plots in meetings, I usually show it with marginal='histogram', since this is easier understandable for the non-data-scientists in the room.
However, since the amount of data varies I would like to have a normalized histogram, i.e. have percent values.

I know this would be possible with subplots, but there are really a lot of ugly adjustments to make.
So a solution could be to show the percentage in the hint as well, or something like histnorm from plotly.express.histogram.

Example for easy testing:

import plotly.express as px
import numpy as np
import pandas as pd

# Generate random data
np.random.seed(42)  # For reproducibility
data = np.random.normal(loc=0, scale=1, size=1000)  # Normal distribution data

# Create a pandas dataframe
df = pd.DataFrame({'Values': data})

# Create ECDF plot with histogram
fig = px.ecdf(data, 
              ecdfnorm='percent', 
              marginal='histogram')

# Show the figure
fig.show()

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par le point d’entrée px.ecdf et comparez la manière dont marginal='histogram' est configuré avec histnorm dans px.histogram. Déterminez si le comportement attendu est d’obtenir des bins marginaux normalisés ou des informations de pourcentage au survol, puis vérifiez le résultat avec l’exemple NumPy et pandas fourni ; le travail est terminé lorsque le marginal de l’histogramme ECDF peut représenter des pourcentages sans subplots manuels.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
numpy, pandas, plotly, python
Domaine
data-visualization
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
38/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.