Ask Your Question

Revision history [back]

Use colormap for a 3dlistplot?

How can I plot a list of points in space where the points are colored by their height?

The following code:

biglist = [(0, 0, 12), (0, 1, 19), (0, 2, 24), (0, 3, 30), (0, 4, 33), (0, 5, 35), (0, 6, 38), (0, 7, 40), (0, 8, 41), (0, 9, 43), (0, 10, 44), (0, 11, 44), (0, 12, 44), (0, 13, 44)]

cm = colormaps.autumn cf = lambda (x,y,z): z/100 % 1

list_plot3d(biglist, color=(cm,cf), point_list=True)

produces the following error:

/Applications/SageMath-7.2.app/Contents/Resources/sage/local/lib/python2\ .7/site-packages/matplotlib-1.5.1-py2.7-macosx-10.7-x86_64.egg/matplotli\ b/cbook.py:137: MatplotlibDeprecationWarning: The matplotlib.delaunay module was deprecated in version 1.4. Use matplotlib.tri.Triangulation instead. warnings.warn(message, mplDeprecation, stacklevel=1) /Applications/SageMath-7.2.app/Contents/Resources/sage/local/lib/python2\ .7/site-packages/numpy-1.11.0-py2.7-macosx-10.7-x86_64.egg/numpy/lib/fun\ ction_base.py:2558: RuntimeWarning: invalid value encountered in true_divide c /= stddev[:, None] /Applications/SageMath-7.2.app/Contents/Resources/sage/local/lib/python2\ .7/site-packages/numpy-1.11.0-py2.7-macosx-10.7-x86_64.egg/numpy/lib/fun\ ction_base.py:2559: RuntimeWarning: invalid value encountered in true_divide c /= stddev[None, :] Traceback (click to the left of this block for traceback) ... KeyError: 'popitem(): dictionary is empty'

click to hide/show revision 2
None

Use colormap for a 3dlistplot?

How can I plot a list of points in space where the points are colored by their height?

The following code:

biglist = [(0, 0, 12), (0, 1, 19), (0, 2, 24), (0, 3, 30), (0, 4, 33), (0, 5, 35),
(0, 6, 38), (0, 7, 40), (0, 8, 41), (0, 9, 43), (0, 10, 44), (0, 11,
44), (0, 12, 44), (0, 13, 44)]

44)]

cm = colormaps.autumn cf = lambda (x,y,z): z/100 % 1

1

list_plot3d(biglist, color=(cm,cf), point_list=True)

point_list=True)

produces the following error:

/Applications/SageMath-7.2.app/Contents/Resources/sage/local/lib/python2\
.7/site-packages/matplotlib-1.5.1-py2.7-macosx-10.7-x86_64.egg/matplotli\
b/cbook.py:137: MatplotlibDeprecationWarning: The matplotlib.delaunay
module was deprecated in version 1.4. Use matplotlib.tri.Triangulation
instead.
  warnings.warn(message, mplDeprecation, stacklevel=1)
/Applications/SageMath-7.2.app/Contents/Resources/sage/local/lib/python2\
.7/site-packages/numpy-1.11.0-py2.7-macosx-10.7-x86_64.egg/numpy/lib/fun\
ction_base.py:2558: RuntimeWarning: invalid value encountered in
true_divide
  c /= stddev[:, None]
/Applications/SageMath-7.2.app/Contents/Resources/sage/local/lib/python2\
.7/site-packages/numpy-1.11.0-py2.7-macosx-10.7-x86_64.egg/numpy/lib/fun\
ction_base.py:2559: RuntimeWarning: invalid value encountered in
true_divide
  c /= stddev[None, :]
Traceback (click to the left of this block for traceback)
...
KeyError: 'popitem(): dictionary is empty'

empty'