I meet such a problem that the legend for the gigure overlaps with some lines when it's originally drawn. Then when I maximize the window of figure, the legend doesn't overlap the lines. I use saveas function to save figure and the function only save the original size figure (even if I resize the figure before I run the saveas function). I am wondering if there is a way to set the legend auto resize with the figure. Thanks!