Skip to content

kymo: fix bug in Kymo.plot_with_channels() #744

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

Draft
wants to merge 4 commits into
base: release/1.6
Choose a base branch
from

Conversation

JoepVanlier
Copy link
Member

@JoepVanlier JoepVanlier commented May 23, 2025

Why this PR?
It seems that we did not consider the start time of the kymo versus the timestamp of the first data point when implementing Kymo.plot_with_channels().

image
f = lk.File("kymo.h5")
kymo = f.kymos["test_kymo"]

kymo.plot_with_channels(
    [f["Photon count"]["Red"].downsampled_by(100),
     f["Photon count"]["Red"].downsampled_over(kymo.line_timestamp_ranges())],
    adjustment=lk.ColorAdjustment([0, 0, 0], [95, 100, 100], "percentile"),
    titles=("Kymograph", "Downsampled 100", "Downsampled kymo")
)

plt.gcf().axes[0].get_images()[0].set_interpolation('none')
for i, ax in enumerate(plt.gcf().axes):
    ax.axvline(13.61, color="w", linewidth=2, alpha=0.5)
    ax.axvline(13.61, color="k", linewidth=1, alpha=0.5)

    ax.axvline(49.6, color="w", linewidth=2, alpha=0.5)
    ax.axvline(49.6, color="k", linewidth=1, alpha=0.5)
    ax.set_aspect("auto")

plt.xlim([49, 50])
plt.tight_layout()

Without:
image

With:
image

@JoepVanlier JoepVanlier force-pushed the joep/timeshift branch 4 times, most recently from 5b094cc to 8983d9d Compare June 3, 2025 08:51
@JoepVanlier JoepVanlier changed the title kymo: fix bug in Kymo.plot_with_channels() (WIP) kymo: fix bug in Kymo.plot_with_channels() Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant