Re: [Jprogramming] reset colours in plot

2017-07-19 Thread Rudolf Sykora
On 18 July 2017 at 15:38, chris burke wrote: > load 'plot' > 'dat1 dat2 dat3'=. 10 #&> each 1 2 3;4 5 6 7;8 9 > clr1=: (#dat1) {. STDCLR_jzplot_ > clr2=: (#dat2) {. STDCLR_jzplot_ > clr3=: (#dat3) {. STDCLR_jzplot_ > pd 'itemcolor ',":,clr1,clr2,clr3 > pd 'pensize 5' > pd dat1 > pd dat2 > pd dat3

Re: [Jprogramming] reset colours in plot

2017-07-18 Thread chris burke
There is an easier way to handle this without changing the plot class. Since we know that plot indexes colors as needed, then you can programmatically build up the colors to match the data. For example, this example recycles colors starting from the beginning for each block of data: load 'plot' '

Re: [Jprogramming] reset colours in plot

2017-07-17 Thread chris burke
Plot just recycles colors as needed. You can reset the item colors anytime, but the colors are indexed by the current data item so this is not what you want. I don't think there is a built-in way to override this. However, the function that indexes the colors is just: getitemcolor_jzplot_ 3 :

Re: [Jprogramming] reset colours in plot

2017-07-17 Thread Rudolf Sykora
On 17 July 2017 at 16:42, Tom Arneson wrote: > To get just 4 colors, redefine STDCLR > > STDCLR_jzplot_=: 4{. STDCLR_jzplot_ Say I do not know in advance how many graphs will be there. (I know I can always count them, but...) Say the number of plotted lines in the 1st and 2nd group (see below)

Re: [Jprogramming] reset colours in plot

2017-07-17 Thread Tom Arneson
: programm...@jsoftware.com Subject: Re: [Jprogramming] reset colours in plot > Do you have an example where colors are not reused? I mean reuse = restart, i.e. not necessarily cycle (though possibly also). Example: - load 'plot' pd 'reset' pd 'type line' p

Re: [Jprogramming] reset colours in plot

2017-07-17 Thread Rudolf Sykora
> Do you have an example where colors are not reused? I mean reuse = restart, i.e. not necessarily cycle (though possibly also). Example: - load 'plot' pd 'reset' pd 'type line' pd i.3 NB. pd 3+i.3 pd 'show' - The question is: what should I write at the place, so that the sec

Re: [Jprogramming] reset colours in plot

2017-07-17 Thread chris burke
Plot should automatically reuse colors. For example STDCLR has 12 entries, so the following will show the first few colors being reused: load 'plot' plot i.15 5 Do you have an example where colors are not reused? On Mon, Jul 17, 2017 at 6:28 AM, Rudolf Sykora wrote: > Hello, > > when

Re: [Jprogramming] reset colours in plot

2017-07-17 Thread Rudolf Sykora
> Can I do that easily? I tried to add: pd 'itemcolor STDCLR_jwplot_' at the place where I want to start over with colours, but it doesn't help. Thanks Ruda -- For information about J forums see http://www.jsoftware.com/forums.

[Jprogramming] reset colours in plot

2017-07-17 Thread Rudolf Sykora
Hello, when plotting, the colours are by default taken from the STDCLR list. After plotting a few lines of a figure, I want to reuse the colours from that list, starting again from its beginning. Can I do that easily? Thanks Ruda -