Understanding how to apply filters to data in Chart Studio can be categorized based on three different filter operations: a) an inequality (=, <, >, <=, >=, ≠) between the target and the reference, b) a specific (open/closed) range, or c) specific set of values in a data column. This tutorial will cover all the three filter operations that can be applied to any format of the data: (1) categorical data, (2) continuous data, and (3) dates. In addition, you can also apply more than one filter to a single plot.
Try an Example
Before getting started with your own dataset, you can check out an example. You can use the data featured in this tutorial by clicking on 'Open This Data in Chart Studio' on the left-hand side. It'll open in your workspace.
Add Your Data to Chart Studio
Head to Chart Studio and add your data. You have the option of typing directly in the grid, uploading your file, or entering the URL of an online dataset. Chart Studio accepts .xls, .xlsx, or .csv files. For more information on how to enter your data, see this tutorial.
Create a Chart
After adding data, go to the 'Traces' section under the 'Structure' menu on the left-hand side, then choose the 'Type' of trace. In this tutorial, 'Scatter' plot is used.
Next, select 'X' and 'Y' values from the dropdown menus. This will create a raw scatter trace, as seen below.
Add as many traces as needed, until the plot is complete!
After adding data, to add a filter, head to the 'Transforms' section under the 'Structure' menu. Click on the '+ Transform' button on the top right corner of the panel and then choose the 'Filter' option.
This will display a filter sub-panel directly below the button as seen below.
Here, you can choose the data column which you want to filter; use the dropdown menu next to the attribute 'Target' and then choose the data column.
Then, choose the desired filter operator using the dropdown menu next to the attribute 'Operator'.
Next, depending on the type of operator chosen, a unique attribute to input the reference's source will display.
If an 'Inequality' operator is chosen, a 'Reference' attribute will get displayed where you can provide a reference value that is available from the target data column.
If a range operator is chosen ('Include Range' or 'Exclude Range'), 'Lower Bound' and 'Upper bound' attributes will get displayed using which you can provide the lower and upper limit for the range with respect to the target data column.
If values operator is chosen ('Include Values' or 'Exclude Values'), 'Values' attribute will get displayed using which you can provide the reference values you would like to filter. Note that the 'Values' attribute accepts more than one value and must be comma-separated.
Style a Chart
The 'Style' menu displays many options to modify characteristics of the overall chart layout or the individual traces. To see more options about styling the chart visit the style and layout section of the Chart Studio documentation.
Save and Share
To save the plot click the 'Save' button on the left-hand side. A save modal will appear, as seen below, where you can specify the filenames and privacy settings for your plot and data grid.
For more information on privacy settings and how sharing works, visit Chart Studio's sharing tutorial.