简体   繁体   中英

Scaling in matplotlib.pyplot?

I am generating planar coordinates within the range (x,y) in [0,500]x[0,500]. When using matplotlib.pyplot to visualize them, the axes only show the part that contains already generated points. How can I scale the axes so that they correspond to [0,500]x[0,500]?

This is what I have for now:

在此处输入图片说明

使用ax.set_xlim([0, 500])set_ylim

You can set the row and column size of the plot area by the following..

import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (10,5)

But the figure.figsize accepts the parameter in inches, so if you need it to be in other units, then adjust the parameter by converting from inches to your desired unit.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM