cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
kasif3
Level I

two or more x and y graph on one graph

Hello,
I have two series of x and y points.
For example: first series : x1=[1,2,3],y1=[0.9,0.7,0.6]
Secend:   x2=[3.5,6.7,4.3],y2=[1,2,3]

 

Is it possibale to put them on the same graph? meaning I'll have one graph with both x1 vs y1 and x2 vs y2, but without  x1 vs y2 and x2 vs y1?

Thank you in advance

6 REPLIES 6
txnelson
Super User

Re: two or more x and y graph on one graph

The simple solution is to

Tables==>Stack

your x and y cols into 2 columns and then use Graph Builder dragging the x stacked col to the x drop area and the y to the y drop area.  Then drag the "Label" col from the stack to the Group X or Y area

 

Or if you drag the label to the overlay area it will differentiate the values by color

Jim
kasif3
Level I

Re: two or more x and y graph on one graph

Hi,
Thank you for the response.
About your 'differentiate the values by color'; what if I have more then one vairable effecting the data? is there a way to difinite the data acording 2 those vairable, without spliting them into groups (so they could be on the same chart) ?

Thank you in advance

txnelson
Super User

Re: two or more x and y graph on one graph

I would just create a new column which is a composite of the two columns in question and then use that column as the onerlay or color column
Jim
Tunnelfrog
Level I

Re: two or more x and y graph on one graph

 Hi, that answer works if x1 values differ from x2 values. When some values are the same, Graph builder plots each possibility (see plot below, with three x and  y stacked): x1 and y1, x1 and y2, x2 and y1 and x2 and y2. That is not what I want. It explicitly want it to plot x1 with y1 and x2 with y2 (x3 with y3 etc), even when x2 equals x1. What am I doing wrong?

 

Tunnelfrog_0-1637833760620.png

 

jmv
jmv
Level III

Re: two or more x and y graph on one graph

Hello,

Not sure if this helps but I had a similar issue when graphing temperature from a data logger over multiple days. Graph Builder didn't know the difference between a certain time from one day to the next (it would overlap values for, say, time 08:00 over two different days). To get around this I created a new column called "day time" in the form of d/m/y h:m:s making each "x" value unique.

 

So getting back to your issue jmp doesn't know the difference between one X1 and X1 so do you need to make them unique, something like X1-1 and X1-2 to correspond with Y1-1 and Y1-2, respectively?

peng_liu
Staff

Re: two or more x and y graph on one graph

Do you mean that you have duplicated points in your data? E.g. in (x1, y1), you have two points: (0,1) and (0,1). If so, I am wondering whether that is due to jittering.

peng_liu_0-1638193512039.png