Hi all,
I have suggestions about creating series from matrices in order to plot
the columns of a calculated matrix.
First of all, I think it would be useful if matrices columns (or rows)
could be directly used in plots without any conversion to series, though
I might be convinced otherwise if the conversion to series didn't
involve the problems that I describe below.
Second, a GUI-way of converting matrices to series would be nice, for
example in the session/symbol view right-click a matrix icon and have a
context menu entry "create series from columns" or some such. So far I'm
only aware of the script command, see guide chapter 12.9.
Then, here are some problems with the various workarounds that I tried:
1) first method: after calculating the relevant matrix do
'nulldata <appropriate sample size> --preserve'
and convert the matrix columns to series for plotting.
problems with that:
* the stuff in the old dataset isn't available anymore which is inconvenient
* I guess session handling with several workfiles is also problematic
quirks encountered along the way:
* why isn't the nulldata thing possible via GUI? "New dataset" is a
greyed-out menu item when another dataset is opened, but I see no real
reason for that.
* it seems impossible to load a matrix from file via GUI? (equivalent to
'mread', while GUI 'mwrite'-equivalent exists)
2) next method: convert the matrices to series (with script commands) in
the same workfile/dataset, after setting the sample size appropriately
problems here:
* after (each) plotting, the original sample has to be restored manually
-- it's easy to automate if that was the full dataset, but not for some
specifically chosen sample (right?)
quirks encountered:
* I find the paragraph in guide ch. 12.9 a little confusing (and after I
understand everything myself, I volunteer to rewrite it)
* I guess I understand the spirit of the restriction that the vector
length has to match the sample, but strictly speaking it's not
necessary; the dataset or sample dimension must be at *least* as big as
the number of matrix elements, but why exactly equal? Without the
stricter restriction, this workaround no. 2 would be easier, FWIW.
3) next method: same as in (2), but encapsulate that in a function which
does the conversion and plotting; the effect is that the sample of the
dataset isn't affected because it's outside the function scope
problem:
* after the function is done, the series are also gone (though it may
work to pass them back somehow using another dirty workaround, haven't
tried that)
Ok, I would classify some of the encountered quirks as feature requests
and some only as discussion items. The bottom line still is that I would
welcome direct plotting of matrix columns/rows in scatterplots or
against an index/time variable. Again, think of right-clicking a matrix
icon and choose a context menu entry for example.
sorry for a long post,
sven