Thanks, Fraser:

Your workaround, without the x-offsets, works exactly the way I expect 'stick' plot to work (but not the way it does work). Unfortunately, I can't always know before running the verb how many data sets I want to plot. I can manually count the number of rows in my matrix and plot them all separately in different colours, but I'm not too keen on that. The spectra I really want to plot are represented as impulses rather than as bar graphs, which is what makes the 'stick' form appropriate to the task. Bar plots displace the x-value, which I don't want to happen. I know that the larger-amplitude impulses will cover the smaller ones at the same x-value, but that is what I want to be able to see. If they are all the same colour, I can't tell which is which.

For now, I think I'll use the 'dot' or 'marker' forms of plot. Thanks for pointing out the use of the individual 'pd' commands.

Sean

Fraser Jackson wrote:

Sean O'Bryne wrote:

I am trying to plot three sets of data using the 'stick' plot option. It plots the three graphs, but in a single colour, which makes it difficult to see the differences between plots. Can someone please help me to get the tree sets of impulse plots to plot in three different colours, as per the default line plot?

eg

'stick' plot 1 2 3; 1 2 3, 2 1 6 ,: 3 0 9


Your command overlays the 'sticks' on the x locations (1,2,3

If you need 'sticks' try using the pd commands

pd 'reset'
pd 'type stick'
pd 'color blue'
pd 'pensize 4'
pd (1 2 3-0.05);1 2 3
pd 'color red'
pd  1 2 3;2 1 6
pd 'color aqua'
pd (1 2 3 +0.05);3 0 9
pd 'show'

Would the barchart capability provide all you need?
I am using Windows, but it should be fine in Linux.

Fraser


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

Reply via email to