Skip to content
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

improvements to temporal plot: lined up bottom plot with others, allo… #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
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
14 changes: 10 additions & 4 deletions saspt/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import os, sys, warnings, numpy as np, pandas as pd, matplotlib, \
matplotlib.pyplot as plt, matplotlib.gridspec as grd, seaborn as sns
from typing import Tuple, List
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.cm import get_cmap
from scipy.ndimage import gaussian_filter

from .constants import TRACK, FRAME, PY, PX
Expand Down Expand Up @@ -472,7 +470,6 @@ def norm(x):
L = norm(L)

# Plot layout
subplot_extent = (0, 6, 0, 1.5)
figsize = (subplot_extent[1], subplot_extent[3]*3)
fig, ax = plt.subplots(3, 1, figsize=figsize)

Expand Down Expand Up @@ -523,8 +520,17 @@ def norm(x):
if suptitle is not None:
fig.suptitle(suptitle, fontsize=fontsize)

# Save
plt.tight_layout()

# Set bottom plot width to match top plots
heatmap_pos = ax[0].get_position()
lineplot_pos = ax[2].get_position()
ax[2].set_position([
heatmap_pos.x0, lineplot_pos.y0, heatmap_pos.width, lineplot_pos.height
])
ax[2].set_xlim((0, n_blocks * frame_block_size))

# Save
plt.savefig(out_png, dpi=600)
plt.close()

Expand Down