简体   繁体   中英

Pyplot plot function

Given below is the code for plotting points using pyplot.

x1=300+p[k]*math.cos(val[thetaval])
y1=300+p[k]*math.sin(val[thetaval])
plt.plot(x1,y1,'k.')

The plotting is working fine, the problem is, if I want to plot it as a point I am specifying the dot in 'k.' inside the plot function. The output is something like:

在此输入图像描述

The width of the black line/curve that I am plotting is much more that needed. How to reduce it?

It seems that you are not plotting a line but a series of small points. Maybe if you try setting the markersize argument of the plot function could work.

Looking into the documentation of plot() you can find "linewidth"

So use:

plt.plot(x1,y1,'k.', linewidth=0.1)

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