TIBCO Spotfire® Scatter Plots: Binning and Color Scheme Example
Last updated:
4:12pm Apr 27, 2018

TIBCO Spotfire® Scatter Plot Examples

One of the most powerful visualization in Spotfire® is the Scatterplot for it has alot of different way to configure it. The markers can be configured to a specific size, shape, color, rotation and grouped together and aggregated. The x & y axes can also be configured to display categorical, numeric and binned data. Here are a few example images...

Scatterplot Visualization Examples

Density Plot Example

Here is video that shows how to configure the Scatterplot to be dsiplayed as a Density Plot.

Scatterplot as density plot

Binning to reduce markers in an Image

Below is an example of displaying an image and bins the X & Y (based off a users input). The binning reduces the number of markers displayed on the screen. The lower the number the faster the image gets rendered.

The image is imported using TIBCO® Enterprise Runtime for R (TERR™) and the 'ImageR' package. (see attached dxp for script example)

Display Image using a binned Scatterplot

Using IronPython, the example then apply a color scheme based off colors in the image data file. The IronPython script that sets the color scheme based off the column values in the data is..

myTable = Document.Data.Tables["im"]
myCol  = myTable.Columns["hexcolor"]
newCol = myTable.Columns.AddCalculatedColumn("mytemp","uniqueconcatenate(["+myCol.Name+"])")
myCnt  = newCol.GetValue(0).Value
myArr  = myCnt.split(',')
#print myArr[0]
myTable.Columns.Remove(newCol)

from Spotfire.Dxp.Application.Visuals import ScatterPlot
from System.Drawing import Color, ColorTranslator
viz = visual.As[ScatterPlot]()

# Get Color Scheme
colorRule = viz.ColorAxis.Coloring[0]

# Loop through each value in column to apply it to the Color Scheme
for i in range(len(myArr)):
    curVal = myArr[i].strip()
    colorRule[curVal] = ColorTranslator.FromHtml("#"+ curVal);
    print myArr[i],colorRule[myArr[i]]

Attachments

AttachmentSize
Binary Data open_jpeg.dxp1.87 MB