Skip to content

Commit

Permalink
bug fix: non-datetime x-axis
Browse files Browse the repository at this point in the history
  • Loading branch information
j-i-l committed Sep 14, 2020
1 parent b8fe3ae commit 09480b3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pyalluv/plotting.py
Expand Up @@ -214,7 +214,11 @@ def __init__(
)
cluster.set_x_pos(mdates.date2num(cluster.x_pos))

# TODO: set the cluster.width property with this
# TODO: set the cluster.width property
else:
for x_pos in self.x_positions:
for cluster in self.clusters[x_pos]:
cluster_widths.append(cluster.width)
self.cluster_width = kwargs.get('cluster_width', None)
self.cluster_w_spacing = cluster_w_spacing
self.x_lim = kwargs.get(
Expand Down Expand Up @@ -370,7 +374,9 @@ def distribute_clusters(self, x_pos):
key=lambda x: x[1]
)
)
self.clusters[x_pos] = [self.clusters[x_pos][_k] for _k in cs]
self.clusters[x_pos] = [
self.clusters[x_pos][_k] for _k in cs
]
# redistribute them
self._distribute_column(x_pos, self.cluster_w_spacing)
old_mid_heights = [
Expand All @@ -387,7 +393,8 @@ def distribute_clusters(self, x_pos):
n1.set_y_pos(
n2.y_pos + n2.height + self.cluster_w_spacing
)
self.clusters[x_pos][i-1], self.clusters[x_pos][i] = n2, n1
self.clusters[x_pos][i-1] = n2
self.clusters[x_pos][i] = n1
for _ in range(int(0.5 * nbr_clusters)):
for i in range(1, nbr_clusters):
n1 = self.clusters[x_pos][nbr_clusters-i-1]
Expand Down

0 comments on commit 09480b3

Please sign in to comment.