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

Broken Axis #58

Open
lisiarend opened this issue Apr 26, 2021 · 1 comment
Open

Broken Axis #58

lisiarend opened this issue Apr 26, 2021 · 1 comment

Comments

@lisiarend
Copy link

lisiarend commented Apr 26, 2021

Hey, first of all I want to thank you for the very nice package.
I have a question or maybe an extension to your package.

I am visualizing the exon/intron structure of a gene. Actually, the introns are very big compared to the exons and therefore there is a lot of free space between the interesting exon parts. Is there a way to rescale the parts where no GraphicFeature is defined.

I attached a file where one can see that the colored parts (exons) are very small and there is a lot of space between them. I wanted to ask if there is a way to reduce the white space between the exons.

Kind regards,
Lisi

bildschirmfoto_2021-04-26_um_10 48 59

@Zulko
Copy link
Member

Zulko commented Apr 28, 2021

There is no way right now but that's a nice suggestion, you could imagine a squash_empty_regions_over=5000 which would re-coordinate the features while keeping the x tick labels correct, but it would require some effort to design and implement I guess.

In the meantime my recommendation would be to plot the two exons on two different subplots:

import matplotlib.pyplot as plt
ax1, ax2  = plt.subplots(1, 2)
record.crop((start1, end1)).plot(ax1)
record.crop((start2, end2)).plot(ax1)

Then there must be a way to make this look like a broken axis, but this is very hackish in Matplotlib

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

No branches or pull requests

2 participants