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

Appearance settings

add print_grid param to create_violin #557

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
merged 2 commits into from
Sep 7, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
implicitly turn off print_grid display for Violin only
  • Loading branch information
Kully committed Sep 7, 2016
commit 8626d6df84722e95b86f088de229d61dcc059930
28 changes: 11 additions & 17 deletions 28 plotly/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ def _add_domain_is_3d(layout, s_label, x_domain, y_domain):
empty_str = ' (empty) ' # empty cell string

# Init grid_str with intro message
grid_str = "This is the formats of your plot grid:\n"
grid_str = "This is the format of your plot grid:\n"

# Init tmp list of lists of strings (sorta like 'grid_ref' but w/ strings)
_tmp = [['' for c in range(cols)] for r in range(rows)]
Expand Down Expand Up @@ -2708,7 +2708,7 @@ def _violinplot(vals, fillcolor='#1f77b4', rugplot=True):
@staticmethod
def _violin_no_colorscale(data, data_header, group_header, colors,
use_colorscale, group_stats,
height, width, title, print_grid):
height, width, title):
"""
Refer to FigureFactory.create_violin() for docstring.

Expand All @@ -2731,7 +2731,7 @@ def _violin_no_colorscale(data, data_header, group_header, colors,
fig = make_subplots(rows=1, cols=L,
shared_yaxes=True,
horizontal_spacing=0.025,
print_grid=print_grid)
print_grid=False)
color_index = 0
for k, gr in enumerate(group_name):
vals = np.asarray(gb.get_group(gr)[data_header], np.float)
Expand Down Expand Up @@ -2770,7 +2770,7 @@ def _violin_no_colorscale(data, data_header, group_header, colors,
@staticmethod
def _violin_colorscale(data, data_header, group_header, colors,
use_colorscale, group_stats, height, width,
title, print_grid):
title):
"""
Refer to FigureFactory.create_violin() for docstring.

Expand Down Expand Up @@ -2800,7 +2800,7 @@ def _violin_colorscale(data, data_header, group_header, colors,
fig = make_subplots(rows=1, cols=L,
shared_yaxes=True,
horizontal_spacing=0.025,
print_grid=print_grid)
print_grid=False)

# prepare low and high color for colorscale
lowcolor = FigureFactory._color_parser(
Expand Down Expand Up @@ -2871,7 +2871,7 @@ def _violin_colorscale(data, data_header, group_header, colors,

@staticmethod
def _violin_dict(data, data_header, group_header, colors, use_colorscale,
group_stats, height, width, title, print_grid):
group_stats, height, width, title):
"""
Refer to FigureFactory.create_violin() for docstring.

Expand Down Expand Up @@ -2901,7 +2901,7 @@ def _violin_dict(data, data_header, group_header, colors, use_colorscale,
fig = make_subplots(rows=1, cols=L,
shared_yaxes=True,
horizontal_spacing=0.025,
print_grid=print_grid)
print_grid=False)

for k, gr in enumerate(group_name):
vals = np.asarray(gb.get_group(gr)[data_header], np.float)
Expand Down Expand Up @@ -2937,8 +2937,7 @@ def _violin_dict(data, data_header, group_header, colors, use_colorscale,
@staticmethod
def create_violin(data, data_header=None, group_header=None,
colors=None, use_colorscale=False, group_stats=None,
height=450, width=600, title='Violin and Rug Plot',
print_grid=True):
height=450, width=600, title='Violin and Rug Plot'):
"""
Returns figure for a violin plot

Expand Down Expand Up @@ -2970,8 +2969,6 @@ def create_violin(data, data_header=None, group_header=None,
:param (float) height: the height of the violin plot
:param (float) width: the width of the violin plot
:param (str) title: the title of the violin plot
:param (str) print_grid: determines if make_subplots() returns a
printed string displaying the rows/columns dimensions

Example 1: Single Violin Plot
```
Expand Down Expand Up @@ -3138,15 +3135,13 @@ def create_violin(data, data_header=None, group_header=None,
# validate colors dict choice below
fig = FigureFactory._violin_dict(
data, data_header, group_header, valid_colors,
use_colorscale, group_stats, height, width, title,
print_grid
use_colorscale, group_stats, height, width, title
)
return fig
else:
fig = FigureFactory._violin_no_colorscale(
data, data_header, group_header, valid_colors,
use_colorscale, group_stats, height, width, title,
print_grid
use_colorscale, group_stats, height, width, title
)
return fig
else:
Expand All @@ -3166,8 +3161,7 @@ def create_violin(data, data_header=None, group_header=None,

fig = FigureFactory._violin_colorscale(
data, data_header, group_header, valid_colors,
use_colorscale, group_stats, height, width, title,
print_grid
use_colorscale, group_stats, height, width, title
)
return fig

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.