7

Is it possible to create 3D scatterplots in sage?

By scatterplot I mean graph like this: alt text

Boris Gorelik
  • 29,945
  • 39
  • 128
  • 170

2 Answers2

9

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.

Andrea Lazzarotto
  • 2,471
  • 1
  • 22
  • 38
Oscar Lazo
  • 106
  • 2
2

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")
David Sevilla
  • 226
  • 1
  • 5