Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add violin plots fct #57

Merged
merged 4 commits into from
Apr 14, 2023
Merged

add violin plots fct #57

merged 4 commits into from
Apr 14, 2023

Conversation

Beauprel
Copy link
Contributor

Added a violin() function and examples in docs.
It wraps the seaborn function pretty thinly, but it:

  • accepts xarray objects directly
  • uses a more streamlined color argument, that allows to access the stylesheet colors.
  • allows to use the basic spirograph features like use_attrs.

I went with violin() instead of violinplot() to not exactly mirror the seaborn name, but it can be modified.

@Beauprel Beauprel self-assigned this Apr 14, 2023
Copy link
Contributor

@juliettelavoie juliettelavoie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put a few suggestions, but it looks good :)

spirograph/matplotlib/plot.py Outdated Show resolved Hide resolved
plot_kw : dict, optional
Arguments to pass to the `seaborn.violinplot()` function.
color : str, int or list, optional
Unique color or list of colors to use. Integers point to the applied stylesheet's colors, in zero-indexed order.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that we can access the colors of the stylesheet!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to show them somewhere similarly to what you did in the color association section of the notebook. maybe in the stylesheet section of the notebook ?


# set default use_attrs values
if "orient" in plot_kw and plot_kw["orient"] == "h":
use_attrs = {"xlabel": "long_name", "xunits": "units"} | use_attrs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if we want vertical gridline when the violons are horizontal ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

I like it!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Collaborator

@sarahclaude sarahclaude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super, est-ce que les gridlines verticales seront ajoutées automatiquement si l'utilisateur met l'option de violions horizontaux?

@Beauprel
Copy link
Contributor Author

Super, est-ce que les gridlines verticales seront ajoutées automatiquement si l'utilisateur met l'option de violions horizontaux?

oui je l'ai ajouté dans ma branche! (pas encore push)

@Beauprel Beauprel merged commit c90fe29 into main Apr 14, 2023
@Beauprel Beauprel deleted the violins branch April 14, 2023 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants