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

Projects

None yet

2 participants

@joehand
Contributor
joehand 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 from FEATURE: Bean plot should allow for separate widths of bean and violins. to ENH: Bean plot should allow for separate widths of bean and violins. Jul 31, 2014
@joehand joehand changed the title from ENH: Bean plot should allow for separate widths of bean and violins. to ENH/BUG: Bean plot should allow for separate widths of bean and violins. Jul 31, 2014
@joehand joehand changed the title from ENH/BUG: Bean plot should allow for separate widths of bean and violins. to ENH/BUG/DOC: Bean plot should allow for separate widths of bean and violins. Jul 31, 2014
@joehand joehand added a commit to joehand/statsmodels that referenced this issue Jul 31, 2014
@joehand joehand BUG/ENH: BeanPlot separate width options, closes #1860
Add options to specify width for violin, bean, and bean mean.
2ce671c
@josef-pkt josef-pkt added this to the 0.6 milestone Aug 17, 2014
@josef-pkt josef-pkt added a commit that closed this issue Sep 20, 2014
@joehand @josef-pkt joehand + josef-pkt BUG/ENH: BeanPlot separate width options, closes #1860
Add options to specify width for violin, bean, and bean mean.
bf9bf68
@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