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!
setelem in scatter diagrams
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
-
- EViews Developer
- Posts: 870
- Joined: Tue Sep 16, 2008 3:50 pm
Re: setelem in scatter diagrams
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
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
Thank you! It now works as expected
Please update the manual
Please update the manual
Who is online
Users browsing this forum: Google [Bot] and 23 guests