Fix long lines.

Make sure lines are no longer than 79 characters.
master
Damien Goutte-Gattat 2 years ago
parent 1c430a98e8
commit 49356aded0
  1. 6
      incenp/plotting/bar.py
  2. 20
      incenp/plotting/scatter.py

@ -57,15 +57,15 @@ def barplot(ax, data, column, tracks, subtracks=[None], subtrackname=1,
:param nformat: Format string for the number of samples
:param colors: A list of matplotlib color specifications (one for
each subtrack)
:param width: The width of a single subtrack:
:param width: The width of a single subtrack
"""
for s, subtrack in enumerate(subtracks):
if subtrack is not None:
level = subtrackname if data.index.nlevels > 1 else None
subset = data.xs(subtrack, level=level).loc[tracks, :]
subset = data.xs(subtrack, level=level).loc[tracks,:]
else:
subset = data.loc[tracks, :]
subset = data.loc[tracks,:]
x = _arange(len(subset))
ax.set_xticks(x)

@ -41,7 +41,8 @@ def scatterplot_subtrack(ax, data, n_track, n_subtrack, max_subtrack,
"""
offset = n_track * max_subtrack + n_subtrack
xs = xdistr(data.values, width, center=True, min_sep=min_sep, offset=offset)
xs = xdistr(data.values, width, center=True, min_sep=min_sep,
offset=offset)
ax.plot(xs, data.values, color=color, marker='.', linestyle='')
ax.hlines(data.mean(), offset - .5, offset + .5, color)
@ -104,7 +105,8 @@ def scatterplot(ax, data, columns, subtrackcolumns=False,
for subtrack in subtracks:
subset = _get_dataseries(data, column, subtrack, subtrackname)
testset.append(subset)
scatterplot_subtrack(ax, subset, i, j, n, colors[j % n], width, min_sep)
scatterplot_subtrack(ax, subset, i, j, n, colors[j % n], width,
min_sep)
j += 1
if testfunc and len(subtracks) == 2:
@ -122,16 +124,22 @@ def scatterplot(ax, data, columns, subtrackcolumns=False,
for column in columns:
subset = _get_dataseries(data, column, track, trackname)
testset.append(subset)
scatterplot_subtrack(ax, subset, i, j, n, colors[j % n], width, min_sep)
scatterplot_subtrack(ax, subset, i, j, n, colors[j % n],
width, min_sep)
j += 1
else:
for subtrack in subtracks:
indexer = [track, subtrack] if subtrack else [track]
level = [trackname, subtrackname] if subtrack else [trackname]
if subtrack:
level = [trackname, subtrackname]
else:
level = [trackname]
subset = _get_dataseries(data, columns, indexer, level=level)
subset = _get_dataseries(data, columns, indexer,
level=level)
testset.append(subset)
scatterplot_subtrack(ax, subset, i, j, n, colors[j % n], width, min_sep)
scatterplot_subtrack(ax, subset, i, j, n, colors[j % n],
width, min_sep)
j += 1
if testfunc and len(testset) == 2:

Loading…
Cancel
Save