Page 1 of 1

setelem in scatter diagrams

Posted: Fri Mar 16, 2018 3:43 am
by zezza
I wanted to plot a scatter diagram between X and Y, but since the correlation changes over time, I wanted to have different colors corresponding to different periods. Therefore I created Y1, Y2, ... Y5, and used
graph mychart.scat X Y1 Y2 Y3 Y4 Y5
mychart.setelem(1) legend(X)
mychart.setelem(2) symbol(1) legend(Y1)
mychart.setelem(3) symbol(2) fillcolor(red) legend(Y2)
mychart.setelem(4) symbol(2) fillcolor(green) legend(Y3)
mychart.setelem(5) symbol(2) fillcolor(blue) legend(Y4)
mychart.setelem(6) symbol(3) fillcolor(orange) legend(Y5)

But the output is not what I expect. The second series (Y2) is displayed in red (as expected) but with a cyrcle (symbol(1)) instead of a filledcircle. Y3 is as expected. Y4 is black rather than blue, and Y5 uses a filledcircle instead of a transciircle, and it is not orange

In scatter diagrams, setelem(1) corresponds to the first Y series? Or to the X series?

I suspect that fillcolor is not working as expected in scatter diagrams

Thank you for your replies!

Re: setelem in scatter diagrams

Posted: Fri Mar 16, 2018 8:21 am
by EViews Jason
In scatter diagrams, setelem(1) refers to the first Y series. So this partially explains why you are not getting the expected format.

The second part is you will want to use linecolor instead of fillcolor. Despite what our docs say, fillcolor refers to the color for bars, pies, and areas and not symbols. Linecolor refers to the line color along with the symbols.

I believe what you want is

Code: Select all

mychart.setelem(1) symbol(1) legend(Y1) mychart.setelem(2) symbol(2) linecolor(red) legend(Y2) mychart.setelem(3) symbol(2) linecolor(green) legend(Y3) mychart.setelem(4) symbol(2) linecolor(blue) legend(Y4) mychart.setelem(5) symbol(3) linecolor(orange) legend(Y5)

Re: setelem in scatter diagrams

Posted: Sat Mar 17, 2018 12:08 am
by zezza
Thank you! It now works as expected
Please update the manual :-)