我对python很陌生,我想在python的图上画一个点。
X_cord=int(raw_input("Enter the x-coordinate"))
Y_cord=int(raw_input("Enter the y-coordinate"))我能想出这么多。
发布于 2018-07-16 19:15:59
python有不同的绘图库,如matplotlib、seaborn等。但使用最广泛的是matplotlib。
最好是检查和阅读他们的文件。
Matplotlib:
import matplotlib.pyplot as plt
x = [x_coordination]
y = [y_coordination]
plt.plot(x, y)海运:
import seaborn as sb
x = [x_coordination]
y = [y_coordination]
sb.pointplot(x, y)这些代码可以生成简单的图形,但是,为了显示图形,您应该在代码下面写这一行。
plt.show()这是在图上绘制点的最简单的方法。
有关更多细节,建议阅读文档。
例如:
plt.plot(x, y, marker="*", markersize=2, color="green")或
sb.pointplot(x, y, markers="*", color="r")https://stackoverflow.com/questions/32297960
复制相似问题