Hi
how do i label the observations in a scatterplot?
i have a scatterplot (a_c15t37 in the page rdp) and i want to assign individual labels for each observation, for example country names. how do i do that?
i have added country names to seperate observation labels and set each element in the scatterplot to show the observation label with a dot, but the result is that all observations write all the country names on top of each other.
can yo please show me how to label the observations properly?
sincerely
Thomas von Brasch
Labels in scatterplot
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
tvonbrasch
- Posts: 569
- Joined: Fri Apr 15, 2011 5:35 am
Labels in scatterplot
- Attachments
-
- oecd_hours_worked_total_engaged.wf1
- (569.77 KiB) Downloaded 435 times
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Labels in scatterplot
It appears that you have more than one observation with the same data values. How was your graph created?
-
tvonbrasch
- Posts: 569
- Joined: Fri Apr 15, 2011 5:35 am
Re: Labels in scatterplot
Hi Glenn,
thanks for your reply. the plot were made by taking the mean across all observations. do i have to create series that are means first, and then create the scatterplot for one time period only?
e.g., genr m1=@mean(sm1), genr v1=@mean(sv1) and m2=@mean(sm2) and genr v2=@mean(sv2) and then, in one particular sample year (smpl year year) create the scatterplot graph a.scat(mult=p) m1 v1 m2 v2 ?
i have added a graph in the attached workfile called a_glenn with two observations in 2005. how can i make the label "Norway" for the blue dot, and "Denmark" for the red dot?
Thomas
thanks for your reply. the plot were made by taking the mean across all observations. do i have to create series that are means first, and then create the scatterplot for one time period only?
e.g., genr m1=@mean(sm1), genr v1=@mean(sv1) and m2=@mean(sm2) and genr v2=@mean(sv2) and then, in one particular sample year (smpl year year) create the scatterplot graph a.scat(mult=p) m1 v1 m2 v2 ?
i have added a graph in the attached workfile called a_glenn with two observations in 2005. how can i make the label "Norway" for the blue dot, and "Denmark" for the red dot?
Thomas
- Attachments
-
- oecd_hours_worked_total_engaged.wf1
- (676.69 KiB) Downloaded 477 times
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Labels in scatterplot
If all you are plotting is a few points, you are better off putting them into a matrix, or since you want labeling, into a workfile of the appropriate dimension. The problem is that your calculation by its very nature has multiple observations with the same points, which is why the labeling is drawing on top if earlier points.
If you want to plot means by country in a scatterplot with country labels, you'll have to create a page with countries as the observation identifiers, where the series contain the mean values for the country. Our linking and match merging tools will allow you to do this pretty easily. You should take a look at the docs for guidance.
As to the new graph, I really can't tell how this one was created, but again to get country labels, you'll have to have a country page/workfile.
If you want to plot means by country in a scatterplot with country labels, you'll have to create a page with countries as the observation identifiers, where the series contain the mean values for the country. Our linking and match merging tools will allow you to do this pretty easily. You should take a look at the docs for guidance.
As to the new graph, I really can't tell how this one was created, but again to get country labels, you'll have to have a country page/workfile.
Labels in scatterplot
Dear all,
When producing scatter plots, I would like to add the regression equation along with the fit line. If possible, I would also like to rename my series when displayed in the scatter plot. The code line I use so far, is displayed below; i'd be great if you could let me know how to adjust it.
group scatter_gr1 gdp m3_yoy urate_yoy
scatter_gr1.scat(m) linefit
Thanks a lot in advance!
When producing scatter plots, I would like to add the regression equation along with the fit line. If possible, I would also like to rename my series when displayed in the scatter plot. The code line I use so far, is displayed below; i'd be great if you could let me know how to adjust it.
group scatter_gr1 gdp m3_yoy urate_yoy
scatter_gr1.scat(m) linefit
Thanks a lot in advance!
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Labels in scatterplot
Change the displaynames of the series in the group prior to making the scatter plot.
Use linefit(leg=det)
Use linefit(leg=det)
Re: Labels in scatterplot
Thanks for your quick aswer
The displaynames part works perfectly. Even with scatter_gr1.scat(m) linefit (leg=det) I don't get the regression equation for each panel the scatterplot.
Thanks a lot in advance!
The displaynames part works perfectly. Even with scatter_gr1.scat(m) linefit (leg=det) I don't get the regression equation for each panel the scatterplot.
Thanks a lot in advance!
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Labels in scatterplot
Code: Select all
create u 15
series y=nrnd
series x=nrnd
group scatter_gr1 x y
show scatter_gr1.scat(m) linefit(leg=det)
Re: Labels in scatterplot
thanks a lot, but this command works only when you have one single panel in our scatterplot. I have nine of them and would like to add the equation to each of them.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Labels in scatterplot
You can only display the detailed legend if you have a single scatter plot.
Who is online
Users browsing this forum: No registered users and 2 guests
