Split into groups

Split a single trace into multiple traces using categorical data in Chart Studio

Step 1

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.

Open data

Step 2

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.

Step 3

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.

Choose chart main

Next, select 'X' and 'Y' values from the dropdown menus. This will create a raw scatter trace, as seen below.

Adding x and y axis

Step 4

Apply Transforms

After adding data, to split the trace into groups, 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 'Split' option.

Transform Button

This will display a Split sub-panel directly below the button as seen below. Here, you can choose the data column containing the categories based on which you can split the trace; use the dropdown menu next to the attribute 'By' and then choose the desired categorical data. In this example, the trace is split based on the continents.

Split By

Step 5

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.

insert

Step 6

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.

Save main

For more information on privacy settings and how sharing works, visit Chart Studio's sharing tutorial.