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

ENH/BUG/DOC: Bean plot should allow for separate widths of bean and violins. #1860

Closed
joehand opened this issue Jul 31, 2014 · 0 comments

Comments

Projects
None yet
2 participants
@joehand
Copy link
Contributor

commented Jul 31, 2014

Currently the bean_size option affects the bean size, violin size, and mean line. The DOCs do not make this clear:

- 'bean_size', scalar.  Line length as a fraction of maximum length.
         Default is 0.5.

The bean_size and violin_width (and ideally the mean line) should be separate options. This will allow for cleaner plots like this:
bean.

It is fairly easy to implement:

width = np.min([0.15 * np.max([pos_span, 1.]),
                    plot_opts.get('violin_width', 0.8) / 2.])
bean_width = np.min([0.15 * np.max([pos_span, 1.]),
                    plot_opts.get('bean_size', 0.5) / 2.])

and

# Draw bean lines.
ax.hlines(pos_data, pos - bean_width, pos + bean_width,
                  lw=plot_opts.get('bean_lw', 0.5),
                  color=plot_opts.get('bean_color', 'k'),
                  label=legend_txt)

I will look through contributing docs and see what is necessary to add this and submit a PR if I have time.

@joehand joehand changed the title FEATURE: Bean plot should allow for separate widths of bean and violins. ENH: Bean plot should allow for separate widths of bean and violins. Jul 31, 2014

@joehand joehand changed the title ENH: Bean plot should allow for separate widths of bean and violins. ENH/BUG: Bean plot should allow for separate widths of bean and violins. Jul 31, 2014

@joehand joehand changed the title ENH/BUG: Bean plot should allow for separate widths of bean and violins. ENH/BUG/DOC: Bean plot should allow for separate widths of bean and violins. Jul 31, 2014

joehand added a commit to joehand/statsmodels that referenced this issue Jul 31, 2014

BUG/ENH: BeanPlot separate width options, closes statsmodels#1860
Add options to specify width for violin, bean, and bean mean.

@josef-pkt josef-pkt added this to the 0.6 milestone Aug 17, 2014

@josef-pkt josef-pkt closed this in bf9bf68 Sep 20, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.