سؤال

Is it possible to create 3D scatterplots in sage?

By scatterplot I mean graph like this: alt text

هل كانت مفيدة؟

المحلول

Absolutely. If you've got a list of tuples that represent your points, something like:

point_list=[(0.,1.,2.), (2.,2.,3.)]
point3d(point_list)

that will plot the two points given in point_list, you can add axis labels with standard sage plotting options.

نصائح أخرى

You can, as indicated in the accepted answer. To produce exactly that graph (http://matplotlib.org/examples/mplot3d/scatter3d_demo.html) from Sage you can use matplotlib: copy the code of the example in a cell (I'm assuming you are using the notebook) and substitute the last line

plt.show()

with

plt.savefig("")
plt.close("all")
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top