Jump to content
  • How to work with Scatter Plot Size property in Spotfire® using IronPython


    This sample demonstrates how to work with the Size property of a Scatter plot visualization

    Introduction

    This sample demonstrates how to work with the Size property of a Scatter plot visualization

    Code Sample

    # Copyright © 2017. Spotfire Software Inc. Licensed under Spotfire BSD-style license.
    
    from Spotfire.Dxp.Application.Visuals import ScatterPlot
    from Spotfire.Dxp.Application.Visuals import AxisMode, ContinuousScaleType,AxisRange
    
    newAxisRange = AxisRange(7500,8000)
    ScaleFrom="IntervalScale" #This can come from a document property
    
    #ScatPlot is a script parameter referencing the Scatter Plot visualization  
    if ScaleFrom == "IntervalScale":
        ScatPlot.As[ScatterPlot]().SizeAxis.ScaleType = ContinuousScaleType.IntervalScale
        ScatPlot.As[ScatterPlot]().MarkerSize = 10.0
        ScatPlot.As[ScatterPlot]().SizeAxis.Range=newAxisRange
    else:
        ScatPlot.As[ScatterPlot]().SizeAxis.ScaleType = ContinuousScaleType.RatioScale 
        ScatPlot.As[ScatterPlot]().MarkerSize = 3.0
        ScatPlot.As[ScatterPlot]().SizeAxis.Range=newAxisRange
     

    References

    License:  BSD-Style License

    Back to IronPython Scripting in Spotfire Examples:  https://community.spotfire.com/articles/spotfire/ironpython-scripting-in-spotfire/


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...