 SpatterPlot3d - Maple Help

ColorTools

 SpatterPlot3d
 create a 3-D scatter plot of colors Calling Sequence SpatterPlot3d(colors) Parameters

 colors - a list of colors in formats recognized by ColorTools or a Palette object Options

 • space=string designating a known color space
 Use the specified color space instead of "Lab".  All color spaces work well.
 • symbol="box", "circle", or "diamond"
 Specify a symbol in order to use only that respective shape for points, instead of the random shapes.
 If specified ColorTools:-ToDisplayable will not be called for the colors sent to plot.  This should improve performance but will also cause non-displayable color points to be displayed as white. Description

 • The SpatterPlot3d command renders a scatter plot of colors by their chromatic dimensions. The point for each color is a randomly chosen shape. Examples

 > $\mathrm{with}\left(\mathrm{ColorTools}\right):$$\mathrm{with}\left(\mathrm{ImageTools}\right):$
 > $\mathrm{SpatterPlot3d}\left(\mathrm{GetPalette}\left("Niagara"\right)\right)$ > $\mathrm{colors}≔\left[\mathrm{seq}\left(\mathrm{RandomTools}:-\mathrm{Generate}\left(\mathrm{list}\left(\mathrm{float}\left(\mathrm{range}=0..1,\mathrm{digits}=4,\mathrm{method}=\mathrm{uniform}\right),3\right)\right),i=1..200\right)\right]:$
 > $\mathrm{SpatterPlot3d}\left(\mathrm{colors},\mathrm{symbol}="box"\right)$ The following commands read an image and extract its pixels as RGB colors.

 > $\mathrm{imagefile}≔\mathrm{cat}\left(\mathrm{kernelopts}\left(\mathrm{datadir}\right),"/images/fjords.jpg"\right):$
 > $\mathrm{img}≔\mathrm{Read}\left(\mathrm{imagefile}\right):$

Scaling is important here to reduce the total number of colors in the plot.

 > $\mathrm{img}≔\mathrm{Scale}\left(\mathrm{img},\frac{35.}{\mathrm{max}\left(\mathrm{Height}\left(\mathrm{img}\right),\mathrm{Width}\left(\mathrm{img}\right)\right)}\right):$
 > $\mathrm{colors}≔\mathrm{map}\left(\mathrm{op},\mathrm{convert}\left(\mathrm{img},\mathrm{listlist}\right)\right):$
 > $\mathrm{SpatterPlot3d}\left(\mathrm{colors}\right)$  Compatibility

 • The ColorTools[SpatterPlot3d] command was introduced in Maple 18.