Chung-Kan Huang Posted May 2, 2019 Share Posted May 2, 2019 Hi, I would like to export many scatterplots to files (only marked points). I can do it by first marking the points I want onone of thescatter plots, then go toFile->Export->Data to File and then Export data from the selected Visualization with data for makred items. But I have repeat this for many plots and many times. I wonder if anyone can provide a Ironpyton script example for exporting marked data points from a scatter plot Thanks, Link to comment Share on other sites More sharing options...
Andrew Berridge Posted May 2, 2019 Share Posted May 2, 2019 Hi There, This script should be your starting point: https://community.spotfire.com/wiki/how-retrieve-data-marking-selection-using-ironpython-tibco-spotfire Then it should just be possible to export to a CSV by writing out to a text file by extracting the relevant parts of this script: https://community.spotfire.com/wiki/how-export-tablecross-table-visualization-data-csv-file-using-tibco-spotfirer-using-ironpython Andrew Berridge, TIBCO Data Science Link to comment Share on other sites More sharing options...
Chung-Kan Huang Posted May 2, 2019 Author Share Posted May 2, 2019 Hi Andrew,I am trying to adapt the extracting crosstable script to my scatter plots.forvis_sctterplot.As[VisualContent]().ExportText(writer) # vis_scatterplot is from script paramtersI got C:UserschunghAppDataLocalTemptmp90C0.tmp Traceback (most recent call last): File "<string>", line 23, in <module> AttributeError: 'ScatterPlot' object has no attribute 'ExportText' System.MissingMemberException: 'ScatterPlot' object has no attribute 'ExportText' at IronPython.Runtime.Binding.PythonGetMemberBinder.FastErrorGet`1.GetError(CallSite site, TSelfType target, CodeContext context) at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1) at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) at Spotfire.Dxp.Application.IronPython27.IronPythonScriptEngine.ExecuteForDebugging(String scriptCode, Dictionary`2 scope, Stream outputStream) Link to comment Share on other sites More sharing options...
Andrew Berridge Posted May 2, 2019 Share Posted May 2, 2019 You cannot call the export text method on a scatter plot. It only works on cross tables. You need to iterate over the marked rows in the data table, as provided by the first script, then adapt the second script to write out to a CSV, iterating over the rows. Andrew Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now