Closed dmnfarrell closed 4 years ago
It's not a bug but I should clarify the documentation. The x_lim
factor is not meant to be used to crop the plot, only to increase the range of the x axis beyond the length of the sequence, for instance to make sure that different plots are on the same scale.
To crop the plot, use .crop
method and it should work fine:
cropped_record = graphic_record.crop((5000,15000))
ax, _ = cropped_record.plot(figure_width=16, strand_in_label_threshold=7)
What you are observing in the second picture is a Matplotlib issue by the way (text elements are always plotted, even when they are located way outside the x range)
Ok thanks I suspected I was using it wrong. I can see I didn't read the documentation properly or I would have come across the crop method. Thanks.
Hi. I'm trying to plot a selected region of features in a SeqRecord over a specific range. I assume this is the purpose of the x_lim argument? However if I supply a range to this as a tuple I still get the features over the entire range shown which seems to distort the x axis range.
Plotting all the features works fine:
Gives this:
But using x_lim:
ax, _ = graphic_record.plot(figure_width=16, strand_in_label_threshold=7, x_lim=(5000,15000))
Produces this plot: