Image may be NSFW.
Clik here to view.
by Collin Christensen, Dell Statistica project program management senior analyst
When working with large workspaces, sometimes it becomes difficult to keep track of the formatting used on output documents. There are numerous ways to edit the graphs and spreadsheets produced in the workspace, but this can become inconvenient and time consuming with a large number of nodes.
New options have been added to Statistica that make it possible to edit an output document, save the script that contains the edits, and apply the script to other output documents. Once applied, the format of the output document will hold whatever styles you created in the script. This can greatly speed up the editing process, and allow for permanent changes to workspaces so that editing isn’t required every time. This example demonstrates how to use this new feature.
Open the Baseball.sta data set: Select the Home tab. In the File group, click the Open arrow and on the menu, select Open Examplesto display the Open a Statistica Data File dialog box. Open the data file, which is located in the Datasets folder. This data set includes baseball statistics representing wins ratio, total runs, batting average, total double plays, total walks, and total strike outs.
Create a workspace that contains the Baseball.sta data set: Select the Home tab. In the File group, click the Newarrow and on the menu, select Workspace. In the Create New Document dialog box, All Validated Procedures should be selected by default (if it is not, select it). Click the OK button.
In the Select Data Source dialog box, select the Baseball.sta data set, and click OK to insert the data source node into the workspace.
Image may be NSFW.
Clik here to view.
Add a 2D Scatterplots node to the workspace: Select the Graphs tab. In the Common group, click Scatterplot. If the Baseball data node was active (selected), the 2D Scatterplots node is automatically attached to the data file.
Image may be NSFW.
Clik here to view.
Double-click the 2D Scatterplots node to display the 2D Scatterplots dialog box. On the Quick tab, click the Variables button. In the variable selection dialog box, specify 2-WIN as the X variable and 3-RUNS as the Y variable. Click the OK button.
Image may be NSFW.
Clik here to view.
Leave all other options at their default settings, and click OK in the 2D Scatterplots dialog box.
On the workspace toolbar, click Run All. A Reporting Documents node is created that contains the output document produced by the 2D Scatterplot specifications. Double-click the Reporting Documents node to view the 2D Scatterplot. This graph contains the default graph style that we will be changing using node customizations.
Image may be NSFW.
Clik here to view. Image may be NSFW.
Clik here to view.
Close the Reporting Documents workbook.
Right-click the 2D Scatterplots node and on the menu, select Customize Outputs to display the Node Customizations dialog box.
Select Scatterplot of RUNS against WIN.
Image may be NSFW.
Clik here to view.
Click the Record Customization Scriptbutton. The Graph Options dialog box is displayed, where we can edit the format of the graph. In this example, we will change the background color, the marker style, and the fitting line style.
In the Graph Options dialog box, select the Window tab, located under Graph. Change the Outside Background Color to gray.
Image may be NSFW.
Clik here to view.
Select the Generaltab, located under Plot. Click the Markersbutton to display the Marker Properties dialog box. Select the circle marker that is round and filled in with a solid color.
Image may be NSFW.
Clik here to view.
Click the Close button.
Select the Fitting tab, located under Plot. Click the Patternbutton to display the Line Properties dialog box. Select the dashed line pattern (second line pattern from the left), and change the Foreground color to black.
Image may be NSFW.
Clik here to view.
Click the Close button.
In the Graph Options dialog box, click the OK button. The New Script dialog box is displayed, where we can name and save the script that contains all the changes we made to the graph. Name the script Graph Change.
Image may be NSFW.
Clik here to view.
Click the OK button
The Graph Change script is applied to Scatterplot of RUNS against WIN in the Node Customizations dialog box. The script is also displayed in the Scripts list at the bottom of the dialog box, where all scripts are stored for later use or editing.
Image may be NSFW.
Clik here to view.
To see the changes made to the graph, select the Graph Change script located beneath Scatterplot of RUNS against WIN, and click the Run Scriptbutton. Click Yeswhen prompted to apply the pending changes. In the Run Script dialog box, click OK. The Reporting Documents workbook opens, and the new 2D Scatterplot with the changes is displayed.
Image may be NSFW.
Clik here to view.
Now that this script has been applied to this 2D Scatterplot node, running the node will produce the graph pictured above. We can also apply this script to other nodes so that we don’t have to change the graph options every time we create a new scatterplot.
Close the Reporting Documents workbook, and close the Node Customizations dialog box.
In the workspace, add two more 2D Scatterplots nodes, and connect them to the Baseball data file. For the first of the new 2D Scatterplots nodes, select 2-WIN for the X variable and 4-BA for the Y variable. For the second of the new 2D Scatterplots nodes, select 2-WIN for the X variable and 7-SO for the Y variable.
Image may be NSFW.
Clik here to view.
To apply the Graph Change script to the new scatterplots, right-click the original 2D Scatterplots node and on the menu, select Customize Outputs. In the Node Customizations dialog box, expand [All Nodes] in the top pane. Underneath is [All Graph Outputs]. Drag the Graph Changes script from the bottom pane to [All Graph Outputs]. Verify that the script is beneath [All Graph Outputs], as shown in the following image, and click the Apply button.
Image may be NSFW.
Clik here to view.
Click the Close button.
On the workspace toolbar, click Run All. Double-click the Reporting Documents node, and you will see that all three scatterplots are produced with the graph styles contained in the script we applied.
Image may be NSFW.
Clik here to view. Image may be NSFW.
Clik here to view.
The concepts and methods described in this example can be applied to spreadsheets as well. It is also possible to store the scripts to be used in later projects. The Node Customizations options make editing large numbers of output very easy.