How to assign labels to observations in a scatter plot?
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: How to assign labels to observations in a scatter plot?
Look up the setelem command in the object reference.
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: How to assign labels to observations in a scatter plot?
If you were to take a look at the setelem entry in the manual, it shows that there is both a
and a
the latter of which has both the obs label and the dot as requested. Replace Gareth's obslabel with the dotobslabel.
Code: Select all
obslabelCode: Select all
dotobslabelRe: How to assign labels to observations in a scatter plot?
Yes I just read the menu and it's actually in the legend. I didn't realize the meaning of the chart
when I was reading it by myself but now it all came clear to me.
Thanks so much for both of you.
when I was reading it by myself but now it all came clear to me.
Thanks so much for both of you.
Re: How to assign labels to observations in a scatter plot?
I am trying to use the above finds to do something on my chart.
Now I can have a dot with text next to it. My idea is: suppose I plot a series as a line graph.
What I want is to have text showing the last data point in my graph such as (2001m1, 123.45). My initial solution is to graph a
dot plot of only the last observation (by creating a new series that has only one observation), and then plot a line of the opriginal series
in the same graph.
The problem is: eviews doesn't allow dot to be the type of the first series in a "mixed lines" graph. It can only be area or bar.
Is there a way I can achieve that?
(I attached a photo of what I wish, however this is by placing the cursor next to the observation rather than generate a real text box by command).
Many thanks.
Now I can have a dot with text next to it. My idea is: suppose I plot a series as a line graph.
What I want is to have text showing the last data point in my graph such as (2001m1, 123.45). My initial solution is to graph a
dot plot of only the last observation (by creating a new series that has only one observation), and then plot a line of the opriginal series
in the same graph.
The problem is: eviews doesn't allow dot to be the type of the first series in a "mixed lines" graph. It can only be area or bar.
Is there a way I can achieve that?
(I attached a photo of what I wish, however this is by placing the cursor next to the observation rather than generate a real text box by command).
Many thanks.
- Attachments
-
- text.png (24.72 KiB) Viewed 8912 times
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: How to assign labels to observations in a scatter plot?
Don't think it can be done.
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: How to assign labels to observations in a scatter plot?
You can freeze and add the text label manually, but there's nothing automatic.
Re: How to assign labels to observations in a scatter plot?
yes addtext another way I was thinking. and that leads to another thing.
as you know, graph.addtext(x,y,textcolor) is the command to locate the text box coordinates.
I just wonder if there is a way to let the program to return the coordinates of a certain data point?
for example, for an observation of (123.45,2001q1), is there a way to return the coordinate of this datapoint from the
graph?
as you know, graph.addtext(x,y,textcolor) is the command to locate the text box coordinates.
I just wonder if there is a way to let the program to return the coordinates of a certain data point?
for example, for an observation of (123.45,2001q1), is there a way to return the coordinate of this datapoint from the
graph?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: How to assign labels to observations in a scatter plot?
No, which is why it impossible to add the text automatically.
-
CharlieEVIEWS
- Posts: 202
- Joined: Tue Jul 17, 2012 9:47 am
Re: How to assign labels to observations in a scatter plot?
Dear all,
I'm struggling to find the command line/batch syntax to change the font on .setobslabel. For example, taking a minor variation on Gareths example from above (with no alpha series), how would I change the size of the 'h' in the graph here without using the menus?
Best wishes as always
Charlie
I'm struggling to find the command line/batch syntax to change the font on .setobslabel. For example, taking a minor variation on Gareths example from above (with no alpha series), how would I change the size of the 'h' in the graph here without using the menus?
Code: Select all
create u 20
series x=nrnd
series y=nrnd
group g x y
freeze(graph1) g.scatpair
graph1.setelem(1) symbol(obslabel)
graph1.setobslabel(series) h h h h h h h h h h h h h h h h h h h h h h h h
show graph1Charlie
-
EViews Jason
- EViews Developer
- Posts: 870
- Joined: Tue Sep 16, 2008 3:50 pm
Re: How to assign labels to observations in a scatter plot?
It depends on which h you wish to set the font for.
If you want to change the font for the labels on the axes use
If you want to change the font for the labels within the graph
If you want to change the font for the labels on the axes use
Code: Select all
graph1.setfont axes(20) 'set to 20ptCode: Select all
graph1.setfont obs(16) 'set to 16ptWho is online
Users browsing this forum: No registered users and 1 guest
