How to autoscaled graphs with picking legend (matplotlib)?
问题 I am working on a picking legend with matplotlib. The goal is to hide and shows curves, by clicking on the legend. I found this solution (Hiding lines after showing a pyplot figure), which works very well. I want improve this code to adapt automatically the axis after each clic on the legend. I don't know if it is possible. Do you have any hint? Their is an example of what I want on the images below. First of all, the Image 1 represents the graph. Then after clicking on the legend 5*sin(x),