Page 1 of 1

Labels in scatterplot

Posted: Mon Nov 18, 2013 11:58 am
by tvonbrasch
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

Re: Labels in scatterplot

Posted: Mon Nov 18, 2013 2:55 pm
by EViews Glenn
It appears that you have more than one observation with the same data values. How was your graph created?

Re: Labels in scatterplot

Posted: Tue Nov 19, 2013 1:27 am
by tvonbrasch
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

Re: Labels in scatterplot

Posted: Tue Nov 19, 2013 12:58 pm
by EViews Glenn
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.

Labels in scatterplot

Posted: Fri Jul 04, 2014 8:33 am
by antipa
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!

Re: Labels in scatterplot

Posted: Fri Jul 04, 2014 6:41 pm
by EViews Gareth
Change the displaynames of the series in the group prior to making the scatter plot.

Use linefit(leg=det)

Re: Labels in scatterplot

Posted: Mon Jul 07, 2014 9:29 am
by antipa
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!

Re: Labels in scatterplot

Posted: Mon Jul 07, 2014 9:44 am
by EViews Gareth

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

Posted: Mon Jul 07, 2014 9:57 am
by antipa
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.

Re: Labels in scatterplot

Posted: Mon Jul 07, 2014 10:44 am
by EViews Gareth
You can only display the detailed legend if you have a single scatter plot.

Re: Labels in scatterplot

Posted: Tue Jul 08, 2014 9:40 am
by antipa
thanks!