Hi All,
I'm looking for an alternative to the maligned stacked bar graph.
The graph below shows the relationship of x1 with y and x2 with y and additionally markers are connected by a line to highlight the relationship between x1 and x2.
I would like to vary the colour and shape of the markers so that x1 appears as a red triangle and x2 remains with the default settings, while keeping the line connecting the two.
How may I do this?
Thankyou!
Janine
scatter y x2 , by(x1 , note("") title("alternative to stacked bar chart") col(6) ) c(l) lpattern(dash) ///
xscale(r(0 1)) xlab(0 "A" 1 "B") ylab(0(5)20) ///
ytitle("y") xtitle("x2")
I'm looking for an alternative to the maligned stacked bar graph.
The graph below shows the relationship of x1 with y and x2 with y and additionally markers are connected by a line to highlight the relationship between x1 and x2.
I would like to vary the colour and shape of the markers so that x1 appears as a red triangle and x2 remains with the default settings, while keeping the line connecting the two.
How may I do this?
Thankyou!
Janine
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte(x1 x2 y) 0 0 2 1 0 3 2 0 5 3 0 1 4 0 . 5 0 4 0 1 18 1 1 2 2 1 . 3 1 8 4 1 2 5 1 . end label values x2 x2label label def x2label 0 "A", modify label def x2label 1 "B", modify
scatter y x2 , by(x1 , note("") title("alternative to stacked bar chart") col(6) ) c(l) lpattern(dash) ///
xscale(r(0 1)) xlab(0 "A" 1 "B") ylab(0(5)20) ///
ytitle("y") xtitle("x2")
Comment