Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Violin #471

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

Merged
Kully merged 28 commits into master from Violin
Jun 14, 2016
Merged

Violin #471

Kully merged 28 commits into master from Violin
Jun 14, 2016

Conversation

@Kully
Copy link
Contributor

@Kully Kully commented May 20, 2016

@jackparmer @theengineear @cldougl

First Pull Request for Violin Plots.

Lot of the work is done. Some notes:
-tests need to be added
-organize some of the color testing a little better
-I changed some of the preexisting color-converting functions to allow use for singleton color-strings

Right now, colorscaling just colors multiple violin plots from left to right with equal weight across. Good ideas could be colorscaling by some of the stat_params including median, lowest value, quartiles, etc.

Copy link
Contributor Author

Kully commented May 20, 2016

Copy link
Contributor

ping @empet, who wrote the 🎻 vignette this is based on

Copy link
Contributor

jackparmer commented May 29, 2016
edited
Loading

Right now, colorscaling just colors multiple violin plots from left to right with equal weight across. Good ideas could be colorscaling by some of the stat_params including median, lowest value, quartiles, etc.

Can we please take out the color bar by default and use qualitative coloring? Sequential coloring by stats_params sounds potentially useful as an option. I don't see any reason to ever arbitrarily color from left-to-right though.

Looks like this seaborn violin plot is may be coloring sequentially based on mean:
https://stanford.edu/~mwaskom/software/seaborn/examples/simple_violinplots.html

I personally like the style of these a lot:
image

image

image

Copy link
Contributor Author

Kully commented Jun 5, 2016

@theengineear @jackparmer

I will be adding a colorscale that works on statistic parameters, user inputted stats on the data, etc.

vals_max = np.max(x)
q2 = np.percentile(x, 50, interpolation='linear')
q1 = np.percentile(x, 25, interpolation='lower')
q3 = np.percentile(x, 75, interpolation='higher')
Copy link
Contributor

@theengineear theengineear Jun 6, 2016

Choose a reason for hiding this comment

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

🐄 why the CAPS on this? Let's try to reserve those for module constants.

Kully reacted with thumbs up emoji
Copy link
Contributor Author

Kully commented Jun 6, 2016

@theengineear @jackparmer

I commented out the last all_args test just in case I have to redo the function once again and need to rewrite the exp_violin_plot

New Docs, new examples in doc string, and most importantly, you can input a dictionary of stats assigned to values in the indexing column and get some colorscale stuff happening.

Copy link
Contributor Author

Kully commented Jun 6, 2016

violin-plot

^This is colorscaling on median

Copy link
Contributor

Nice! Lookin' promising! I think the colorscale should always work off
absolute values rather than a 0-100 percentage scale. So, in this case, it
looks like the colorscale range would be ~(-1, 0.5).

On Mon, Jun 6, 2016 at 3:40 PM, Adam Kulidjian notifications@github.com
wrote:

[image: violin-plot]
https://cloud.githubusercontent.com/assets/10369095/15835207/e2931c58-2bfc-11e6-92d5-1156c26bf28f.png

^This is colorscaling on median


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#471 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/ABx4avQ4AM_-UTd2yqElrmkch1xrqOOgks5qJHeSgaJpZM4IjMGG
.

Copy link
Contributor

@Kully I think your entry method could use a little refactoring. I repeats a lot of the same color validations. A good first step would be to create a _validate_color_string method or something.

Also, in general, I think some of your function calls and error messages take up one or two more lines than are probably necessary. That's not such a big deal, but just something I noticed.

plotly/tools.py Outdated
un_rgb_color = (color[0]/(255.0),
color[1]/(255.0),
color[2]/(255.0))
if isinstance(colors, tuple):
Copy link
Contributor

@theengineear theengineear Jun 7, 2016

Choose a reason for hiding this comment

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

🐄 This is pretty un-duck-type-y. What's preventing a future tuple of tuples here?

Copy link
Contributor

@Kully overall, I'm mostly just psyched to see these violin plots!

That said it'd be great if you could address two things and I'll give this PR a final review:

  1. please remove the duplication of code related to whether colors is an array or not, let me know if you need help with that.
  2. please uncomment that test 🐅

Thanks for cranking through all these new FigureFactory methods!

Copy link
Contributor Author

Kully commented Jun 8, 2016

Thanks for cranking through all these new FigureFactory methods!

Thanks for the review.

Copy link
Contributor Author

Kully commented Jun 8, 2016

please remove the duplication of code related to whether colors is an array or not, let me know if you need help with that.

I will need some help approaching this.

Copy link
Contributor Author

Kully commented Jun 10, 2016

@theengineear Help! =)

Copy link
Contributor Author

Kully commented Jun 14, 2016

@theengineear I was right!

plotly/tools.py Outdated
#foo = FigureFactory._n_colors(foo[0],
# foo[1],
# len(intervals))
#theme = FigureFactory._label_rgb(foo)
Copy link
Contributor

@theengineear theengineear Jun 14, 2016

Choose a reason for hiding this comment

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

🐈 Did you mean to commit this?

Copy link
Contributor Author

Kully commented Jun 14, 2016

@theengineear Ready for takeoff?

Copy link
Contributor

Yep 💃 after tests pass!

Copy link
Contributor

🚀

@Kully Kully merged commit d0cef51 into master Jun 14, 2016
@Kully Kully deleted the Violin branch June 14, 2016 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /