I have a somewhat complex plot task in matplotlib that requires–I think–an autoscale() function that excludes certain plotted lines.
The built-in autoscale_view() function in matplotlib gets the union of all the bboxes of the axis and then scales based on that. I’ve made a loose_autoscale_view that adds a margin factor to it. But both determine scaling based on all the points on the axis. I don’t want that, as I want some points to live in the bottom margin.
I need to make an autoscale function in which I do something like:
1) Get the lines I want and exclude the ones I don’t (I could pass in an excluded_lines arg). What is the function for getting lines from an axis? I couldn’t find it.
2) Get the bboxes for those lines and use a similar approach as autoscale_view(). How can I get the bbox associated with a line?
My 1&2 may be totally off-base, too–just suggesting the approach I was considering.
1 Answer