PlotAll – Introduction

PlotAll is developed to plot data from .csv file. It can create scatter, line and trend plots. Also, it can show data distribution using overlaying lines calculating mean and standard deviations. Hoovering mouse on each field will show explanation. Maximum file size is 5 megabyte. Default data can be used for demonstration purposes. Click dropdown under ‘select data’ to choose a dataset.

Load .csv file by clicking on ‘Browse’ under ‘load data from .csv’. If data is loaded successful, you will see ‘upload complete’ dialogue appears under ‘Browse’. In this case, ‘stockdata.csv’ is loaded. Right click the following file ‘stockdata’ and download in your local drive. Then follow above steps to load data in app.

 

stockdata

 

 

The data is 5 years prices of Google, Apple, Amazon and Microsoft. Following is a preview.

 

Date GOOG AAPL AMZN MSFT
10/4/12 381.54 86.07 260.47 26.21
10/5/12 381.34 84.23 258.51 26.05
10/8/12 376.47 82.37 259.06 25.99
10/9/12 369.64 82.07 250.96 25.56
10/10/12 369.87 82.72 244.99 25.29
10/11/12 373.31 81.07 244.22 25.27
10/12/12 369.97 81.28 242.36 25.49
10/15/12 368.10 81.93 244.18 25.76
10/16/12 369.94 83.87 243.94 25.74
10/17/12 375.30 83.20 247.49 25.83
10/18/12 345.25 81.66 244.85 25.75
10/19/12 338.69 78.71 240.00 25.00
10/22/12 337.14 81.84 233.78 24.44
10/23/12 337.98 79.17 234.31 24.48
10/24/12 336.46 79.62 228.49 24.35

 

Once data is loaded, all column names will be populated under ‘Plot Variables’ and ‘Variable Points’ section. Before choosing plot variables, let’s take a subset of the data. For example, instead of plotting 5 years data, you may want to plot just the current year.

 

 

To do this, check ‘Subset Row’. This will open two boxes to allow input for row numbers. In the first box, write 1069 (corresponds to first data in 2017) as the beginning column. End column is automatically selected as the last column of the data. Click ‘Submit Change’. This will subset the data by row. In this example, we’ll plot stock price of ‘GOOG’ and ‘AMZN’ only. To remove ‘AAPL’ and ‘MSFT’ columns, check ‘Subset Column’.

 

 

Under ‘keep columns only’, select ‘Date’, ‘GOOG’ and ‘AMZN’. Click ‘Submit Change’.

 

 

To plot the data, first we need to select columns under ‘x variable’ and ‘y variable’. If we choose ‘Date’ as ‘x variable’ and ‘GOOG’ as ‘y variable’, we cannot plot ‘AMZN’. In this case, we want to plot both ‘GOOG’ and ‘AMZN’ with ‘Date’. For this, we need to ‘reshape’ the data. Check ‘Reshape Data’.

 

 

This will open ‘select fixed column’ dropdown. In the dropdown, select ‘Date’ as fixed column. Click ‘Submit Change’. This will reshape the data keeping ‘Date’ column unchanged. Now the data subset is reshaped into three columns – ‘Date’, ‘variable’ and ‘value’. In the new data, ‘variable’ contains all column names as categories in a column. In this case, ‘variable’ contains ‘GOOG’ and ‘AMZN’. The column ‘value’ contains the prices. Here’s a preview of reshaped data.

 

Date variable value
10/4/12 GOOG 381.54
10/5/12 GOOG 381.34
10/8/12 GOOG 376.47
10/9/12 GOOG 369.64
10/10/12 GOOG 369.87
10/11/12 GOOG 373.31
10/12/12 GOOG 369.97
10/15/12 GOOG 368.1
10/16/12 GOOG 369.94
10/17/12 GOOG 375.3
10/18/12 GOOG 345.25
10/19/12 GOOG 338.69
10/22/12 GOOG 337.14
10/23/12 GOOG 337.98
10/24/12 GOOG 336.46
10/25/12 GOOG 336.69
10/26/12 GOOG 335.39
10/31/12 GOOG 337.95
11/1/12 GOOG 341.57
11/2/12 GOOG 341.74

 

Select ‘Date’ under ‘x variable’. To make the program understand that ‘Date’ is of class date, you need to check the box ‘date’ that appears underneath. Once you checked the ‘date’ box, ‘date format’ dropdown will appear. Here ‘date format’ simply means the sequence of month, date, year and time. Select month/date/year as ‘date format’. Select ‘value’ under ‘y variable’. Click ‘Submit Change’. This will plot both ‘GOOG’ and ‘AMZN’ with ‘Date’.

 

 

Under ‘color variable’, select ‘variable’. Click ‘Submit Change’. ‘GOOG’ and ‘AMZN’ stock prices will appear in different colors. Choose color for each categories under ‘color each category’. If number of selection is less than number of categories (two in this case), default color will be used. Select ‘red’ and ‘purple’ in ‘color each category’. If color column is a continuous variable, instead of using color for each, a color gradient of specified number of colors is used. The app identifies numeric variables as continuous. If they’re discrete, then check the box discrete that appears below.

 

 

To view legends, check ‘Legends’ under the plot window. Choose legend location. Assign legend title as ‘stock’ by writing ‘stock’ under ‘color title’. Click ‘Submit Change’.

 

 

Select ‘variable’ under ‘size variable’, this’ll change point size for the two categories. Specify size 5-15 by adjusting slider under ‘select size range’. This’ll set the first category size to 5 and the other one to 15. To reduce overlap, check ‘Properties’ and set ‘transparency’ to 0.20. Click ‘Submit Change’.

 

 

‘Properties’ under ‘Design Points’ are applicable for variables not used in ‘Variable Points’. Any variable used under ‘Variable Points’ cannot be modified from ‘Properties’.

Remove color and size variable and transparency settings by selecting ‘None’ under ‘color variable’ and ‘size variable’ and moving slider to 1.0 under ‘transparency’. Click ‘Submit Change’.

Select ‘variable’ under ‘shape variable’. Change ‘size’ to 7.0 under ‘Properties’. Click ‘Submit Change’.  This changes shape of the categories and makes point larger. Assigning ‘shape variable’ is only applicable for discrete variable.

 

 

Uncheck ‘Properties’ to collapse. Check ‘Create Subplot’. Select ‘variable’ under ‘1st subplot variable’. This’ll create two plots divided by categories of the column ‘variable’. Y-Axis scale is the same for both. Independent scales can be used by checking ‘Free Y-Axis’.

 

 

Multiple plots can be arranged as desired using slider under ‘image columns’. For example, using 1 under ‘image columns’, images can be stacked top to bottom.

 

 

If desired, lines can be drawn showing average and standard deviations. Check ‘Average’ and ‘3-Sigma’ under ‘Add Stats’. Select line properties. Click ‘Submit Change’.

 

 

Modify plot area by adjusting properties under ‘Design Plots’. Check ‘Area’, select ‘background color’ to ‘hotpink’ and check ‘remove grid’. Check ‘Title’ to add titles to the plot. Remove default words if you do not want titles. Once done, click ‘Submit Change’.

 

 

To show lines only, check ‘Add Line’ under ‘Design Overlay’, move slider to -1 under ‘size’ in ‘Properties’. This removes point and leaves line only.

 

 

At the end, inputs in app will look like this.

 

 

Inputs in ‘Add Stats’ are as follows.

 

 

Inputs in ‘Design Plots’ are as follows.

 

 

Video tutorial: X-Y scatter plot 

 

 

Use PlotAll.