Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rraadd88 committed Aug 9, 2024
1 parent f64f194 commit 584a088
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions chrov/viz/ranges.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def plot_ranges(
xtick_interval:float=None,
unit: str='coordinate (bp)',
test: bool=False,
kws_legend:dict={},
ax: plt.Axes=None,
)-> plt.Axes:
"""Plot ranges.
Expand Down Expand Up @@ -70,6 +71,8 @@ def plot_ranges(
Returns:
plt.Axes: subplot
"""
assert len(data)!=0

if ax is None:
# fig,ax=plt.subplots(figsize=[3,len(data)*0.05])
ax=plt.gca()
Expand All @@ -92,8 +95,9 @@ def plot_ranges(
}
))
## test for unique ids
if kind.lower().startswith('join'):
col_label=None
if kind is not None:
if kind.lower().startswith('join'):
col_label=None
if col_label is None:
col_label=col_id

Expand Down Expand Up @@ -208,11 +212,16 @@ def plot_ranges(
size=10,
color='k',
linestyle='-',
frameon=False,
title=hue,
bbox_to_anchor=[0.5,0],loc='upper center',
ncol=len(colors),
# **kws,
**{
**dict(
title=hue,
frameon=False,
bbox_to_anchor=[0.5,0],
loc='upper center',
ncol=3,
),
**kws_legend,
}
)
## show groups
if col_groupby in df1:
Expand Down

0 comments on commit 584a088

Please sign in to comment.