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

Normalize the violins #7

Open
brianpenghe opened this issue Jul 11, 2018 · 4 comments
Open

Normalize the violins #7

brianpenghe opened this issue Jul 11, 2018 · 4 comments

Comments

@brianpenghe
Copy link

Is there a way to normalize the violins so that the total area of them are the same? I know it can be done by using distributionPlot but their graphics do not look as pretty as yours.

Thanks

@bastibe
Copy link
Owner

bastibe commented Jul 11, 2018

This shouldn't be very hard. Do you want to take a stab at it and submit a pull request?

@brianpenghe
Copy link
Author

I'm not sure which part of your codes need modification. Could you add some comments into the codes to make sure I understand how they work? I then can integrate the feature. Does that make sense?

@bastibe
Copy link
Owner

bastibe commented Jul 12, 2018

Currently, the all violins are scaled to a specific width. If you want a different normalization, you'd have to change this line to something different.

And then you would probably need to modify the "width" parameter, or add a new "normalized" parameter, or something like that.

I find it hard to think of a "correct" way of normalizing violins to a fixed area, though, without sometimes intersecting with neighbouring violins. But maybe I am missing something.

I would encourage you to play with the code a bit, and figure out exactly how normalized violins would work in practice. I'll try to help you as best I can if you have questions.

@bastibe
Copy link
Owner

bastibe commented Jul 12, 2018

In general, all the plotting is done in Violin constructor. The rest of the Violin class only defines getters and setters for the Violin class, and input parameter validation for the Violin constructor.

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

No branches or pull requests

2 participants