Thanks for your suggestion, Raul.
By the way, plot otherwise works just fine on Linux for me.

You certainly weren't suggesting something stupid. With some modification, I got it to do roughly what I want. Your code, as written, still plots everything in the one colour: this is because my data is plotted in x;y form. I get multiple colours if I just plot the matrix and use the ordinate for x. I was able to modify your idea to do what I wanted with the following code

colours =: ' blue',' red', ' green' ,' yellow' ,: ' magenta'

pdrow =: dyad define
'maty colours' =. y
pd 'color ',colours
pd x;maty
)

stickplot =: 3 : 0
'matx maty' =: y
nplots =: <./ (# maty), # colours
pd&> 'reset';'type stick';'pensize 2'
matx (pdrow"1) (nplots{.maty)(;"1)nplots{.colours
pd 'show'
)

NB. to test, use something like stickplot (1 2 3); 1 2 3, 2 1 6,: 3 0 9


This works, but it is not trivial to do things like add a key. Again, this probably just illustrates that I don't have enough mastery over rank to work out how to do things like that in a 'clean' way. I still wish that 'stick' plot worked like the other types. Both 2-d and 3-d versions appear to print in one colour for multiple plots. I'll have a look at the plot source and see if I can work out why.

Sean

Miller, Raul D wrote:

I don't use plot (and can't test this right now, because I'm on linux), so maybe I'm suggesting something
stupid.  But what is wrong with something like this?

pdrow=: dyad define"1
pd 'color ',y
pd x
)
pd&> 'reset';'type stick';'pensize 4'
matrix pdrow (#matrix){.colors
pd 'show'

(or, if you're using j504, use x. and y. instead of x and y)



--
Sean O'Byrne
Postdoctoral Fellow
School of Aerospace, Civil and Mechanical Engineering
University College, University of NSW
Australian Defence Force Academy
Northcott Drive, Canberra, ACT 2600, Australia
[EMAIL PROTECTED]
ph.  61-2-6268-8353
fax. 61-2-6268-8276
------------------------------------------------------

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to