4 Replies Latest reply on May 5, 2013 2:32 AM by Shawn Wang

# How to plot 2 scatter curves for 4 Measures in 1 diagram

I have a data with 4 columns(A, B, X, Y). I would like to compare the scatter curve of A-B and X-Y.

Excel is very easy to realize it(See attached example). But it is difficult for me to plot it in tableau.

Is there any method to realize it?

• ###### 1. Re: How to plot 2 scatter curves for 4 Measures in 1 diagram

Hi Shawn,

The best approach may be to slightly reshape the data by combining the four columns so that you have two columns plus one for the dataset name. Then you can make a normal scatter plot and add the new dataset variable to the color (or shape) shelf to differentiate the sets, and separate trend lines, ...

For example:

x y a b

1 2 3 4

5 6 7 8

becomes

x y dataset

1 2 xy

5 6 xy

3 4 ab

7 8 ab

See attached twbx.

Jim

1 of 1 people found this helpful
• ###### 2. Re: How to plot 2 scatter curves for 4 Measures in 1 diagram

Thanks, Jim.

Your appraoch works but it need to change the data structure a lot so it is not covenient.

I am looking forward new versiion in the future can consider this requirement.

Shawn

• ###### 3. Re: How to plot 2 scatter curves for 4 Measures in 1 diagram

You can also use dual axis. Put both "x" measures on the Columns shelf, "y" measures on the Rows shelf, such that you have two scatter plots side-by-side (all measures will have to be displayed as non-aggregated "dimensions").

Then right-click on the right-most pills and select dual-axis. On each secondary axis, select Synchronize. Then back on the pill, uncheck "Show headers". (This all assumes the units for the two data sets are consistent.)

On the Marks shelf, select Multiple Mark types. Now you can format each data set independently.

See attached twbx.

• ###### 4. Re: How to plot 2 scatter curves for 4 Measures in 1 diagram

Jim, Method 2 is not the curve which I am persuing. Thank you anyway.