Closed Phlya closed 1 year ago
I think it's possible, you can directly pass your axes to the Track.plot method.
This is the .plot
method for the GTF track, the first parameter is the axes object, the second is the GenomeRange
object, you can do like this:
from coolbox.api import GenomeRange, GTF
import matplotlib.pyplot as plt
...
fig, ax = plt.subplots() # your own axes
gtf = GTF(...)
target_range = GenomeRange("chr1", 1000000, 2000000) # create the genome range
gtf.plot(ax, target_range)
Nice, thank you! I was actually trying the same with a bed file, but didn't realize it expected at least 6 columns in it... So that was the problem, not the plotting part.
Hi, I was wondering whether it is possible, and if so how, to use tracks from CoolBox in custom matplotlib figures? I.e. define a track and plot directly onto an Axes object that I create myself. Thanks! Ilya