## scatter graph of irregularily spaced data

For requesting general information about EViews, sharing your own tips and tricks, and information on EViews training or guides.

Moderators: EViews Gareth, EViews Moderator

CharlieEVIEWS
Posts: 202
Joined: Tue Jul 17, 2012 9:47 am

### scatter graph of irregularily spaced data

Dear all,

I'm trying to visualise some data. I have one matrix of dimension AxB, and one vector (1xB). I would like to plot a scatter graph, where every element of a column from the matrix is plotted on the y-axis against its fixed corresponding value from the vector. For example, I would like all elements of the second column of the matrix plotted on the y-axis along a vertical line corresponding to an x-axis value corresponding to the second element of the vector.

However, while I'm usually pretty good with visualising data in EViews, I'm unsure as to whether this is even possible (my feeling is that it should be, and probably is), and the problem has generally stumped me.

Any help would be hugely appreciated as always.

Best wishes,

Charlie

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 12288
Joined: Tue Sep 16, 2008 5:38 pm

### Re: scatter graph of irregularily spaced data

The only way to do it is to make a set of two column matrices containing the y and x values of each graph.

CharlieEVIEWS
Posts: 202
Joined: Tue Jul 17, 2012 9:47 am

### Re: scatter graph of irregularily spaced data

Sorry for being a bit slow here: I don't quite understand how I'd get the mapping with two column matrices (do you mean a 1xB and the AxB stacked into an (AxB)x1 column?) onto one graph?

What kind of syntax is necessary?

edit: I've found a way to do it in an undated workfile generating NA series and writing a script to fill the corresponding values from the matrix into the series at entries corresponding to the vector, but it's a little cumbersome

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 12288
Joined: Tue Sep 16, 2008 5:38 pm

### Re: scatter graph of irregularily spaced data

Sorry, I misread the question. Yeah, your way is probably the best.

CharlieEVIEWS
Posts: 202
Joined: Tue Jul 17, 2012 9:47 am

### Re: scatter graph of irregularily spaced data

For anyone reading this thread in the future, attached is what the output looks like. If requested, I can send over any code.
Attachments
irregular frequency dot plot example.png (10.5 KiB) Viewed 3063 times

EViews Glenn
EViews Developer
Posts: 2615
Joined: Wed Oct 15, 2008 9:17 am

### Re: scatter graph of irregularily spaced data

I'm not 100% certain that I understand the setup, but it seems that all you have to do is to create a matrix of dimension B x (A+1). In the first column of the matrix is your vector. In the remaining columns are the transpose of your original matrix.

Then, if I understand correctly, what you want is to plot, for each row, the first element against the remaining elements of the row. You can do this simply by doing a scatter on the matrix, with the first column against the remaining. That's the default setting, so just choosing scatter should work for you.

CharlieEVIEWS
Posts: 202
Joined: Tue Jul 17, 2012 9:47 am

### Re: scatter graph of irregularily spaced data

Thanks Glenn! I didnt realise this was how .scat worked on matrices. It's a far superior solution to mine and allows all of the scatter features (i.e. linefit and others).

Best wishes!

eviews scatter.png (17.22 KiB) Viewed 3028 times