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

Commit 1658eeb

Browse filesBrowse files
committed
replaced 'forced_order' with 'sort'
1 parent 3203a44 commit 1658eeb
Copy full SHA for 1658eeb

File tree

Expand file treeCollapse file tree

1 file changed

+12
-12
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-12
lines changed

‎plotly/figure_factory/_violin.py

Copy file name to clipboardExpand all lines: plotly/figure_factory/_violin.py
+12-12Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from __future__ import absolute_import
1+
sortfrom __future__ import absolute_import
22

33
from numbers import Number
44

@@ -194,7 +194,7 @@ def violinplot(vals, fillcolor='#1f77b4', rugplot=True):
194194

195195

196196
def violin_no_colorscale(data, data_header, group_header, colors,
197-
use_colorscale, group_stats, rugplot, forced_order,
197+
use_colorscale, group_stats, rugplot, sort,
198198
height, width, title):
199199
"""
200200
Refer to FigureFactory.create_violin() for docstring.
@@ -208,7 +208,7 @@ def violin_no_colorscale(data, data_header, group_header, colors,
208208
for name in data[group_header]:
209209
if name not in group_name:
210210
group_name.append(name)
211-
if forced_order:
211+
if sort:
212212
group_name.sort()
213213

214214
gb = data.groupby([group_header])
@@ -251,7 +251,7 @@ def violin_no_colorscale(data, data_header, group_header, colors,
251251

252252

253253
def violin_colorscale(data, data_header, group_header, colors, use_colorscale,
254-
group_stats, rugplot, forced_order, height, width,
254+
group_stats, rugplot, sort, height, width,
255255
title):
256256
"""
257257
Refer to FigureFactory.create_violin() for docstring.
@@ -265,7 +265,7 @@ def violin_colorscale(data, data_header, group_header, colors, use_colorscale,
265265
for name in data[group_header]:
266266
if name not in group_name:
267267
group_name.append(name)
268-
if forced_order:
268+
if sort:
269269
group_name.sort()
270270

271271
# make sure all group names are keys in group_stats
@@ -347,7 +347,7 @@ def violin_colorscale(data, data_header, group_header, colors, use_colorscale,
347347

348348

349349
def violin_dict(data, data_header, group_header, colors, use_colorscale,
350-
group_stats, rugplot, forced_order, height, width, title):
350+
group_stats, rugplot, sort, height, width, title):
351351
"""
352352
Refer to FigureFactory.create_violin() for docstring.
353353
@@ -361,7 +361,7 @@ def violin_dict(data, data_header, group_header, colors, use_colorscale,
361361
if name not in group_name:
362362
group_name.append(name)
363363

364-
if forced_order:
364+
if sort:
365365
group_name.sort()
366366

367367
# check if all group names appear in colors dict
@@ -409,7 +409,7 @@ def violin_dict(data, data_header, group_header, colors, use_colorscale,
409409

410410
def create_violin(data, data_header=None, group_header=None, colors=None,
411411
use_colorscale=False, group_stats=None, rugplot=True,
412-
forced_order=False, height=450, width=600,
412+
sort=False, height=450, width=600,
413413
title='Violin and Rug Plot'):
414414
"""
415415
Returns figure for a violin plot
@@ -440,7 +440,7 @@ def create_violin(data, data_header=None, group_header=None, colors=None,
440440
number and will be used to color the violin plots if a colorscale
441441
is being used.
442442
:param (bool) rugplot: determines if a rugplot is draw on violin plot.
443-
:param (bool) forced_order: determines if violins are sorted
443+
:param (bool) sort: determines if violins are sorted.
444444
alphabetically (True) or by inputted order (False).
445445
:param (float) height: the height of the violin plot.
446446
:param (float) width: the width of the violin plot.
@@ -489,7 +489,7 @@ def create_violin(data, data_header=None, group_header=None, colors=None,
489489
490490
# create violin fig
491491
fig = create_violin(df, data_header='Score', group_header='Group',
492-
forced_order=True, height=600, width=1000)
492+
sort=True, height=600, width=1000)
493493
494494
# plot
495495
py.iplot(fig, filename='Violin Plot with Coloring')
@@ -607,14 +607,14 @@ def create_violin(data, data_header=None, group_header=None, colors=None,
607607
# validate colors dict choice below
608608
fig = violin_dict(
609609
data, data_header, group_header, valid_colors,
610-
use_colorscale, group_stats, rugplot, forced_order,
610+
use_colorscale, group_stats, rugplot, sort,
611611
height, width, title
612612
)
613613
return fig
614614
else:
615615
fig = violin_no_colorscale(
616616
data, data_header, group_header, valid_colors,
617-
use_colorscale, group_stats, rugplot, forced_order,
617+
use_colorscale, group_stats, rugplot, sort,
618618
height, width, title
619619
)
620620
return fig

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.