0
votes

I have a lot of data to draw a scatter. if I change the x limit to show all the scatter diagram,when I save it as file,I can`t see the detail. but if I zoom in,the picture saved is part of the whole scatter diagram. What can I do to save the zoom in scatter diagram? Thanks very much!

f.savefig('output.png', dpi=100)
1

1 Answers

0
votes

You can change the range of your x or y axis via xlim or ylim.
The documentation (http://matplotlib.org/api/pyplot_api.html#xlim) says that these functions

Get or set the x limits of the current axes.

In your code, you would call

plt.xlim(x1, x2)
plt.ylim(y1, y2)

before you call plt.show().