> From: Thomas Costigliola > > I would like to create a chart like the one in the link below. It is a > stacked bar chart with no space between the bars. Plot doesn't seem to > allow negative values in stacked bar charts. Is there any work around > for this? There would also need to be a way to draw the bars next to > each other as in a histogram. > > The given plot was produced with R; it has an incredibly flexible > plotting package. > > http://www.jsoftware.com/jwiki/ThomasCostigliola
The gap between bars can be adjusted using the "barwidth" option. "http://www.jsoftware.com/jwiki/Plot/Options" 'bar;barwidth 1;' plot 3 9 8 _3 9 _7 However I don't think you're going to to get the output you're after using existing plot types and options in J. I see two main avenues of choices: 0. Use the stats/r/rserve addon (interface to R) to create your chart from J data using R. Below is a very basic example of how you could create an R chart as a PDF from J. load 'stats/r/rserve task' Rcmd 'x<- seq(-10,10,length=50)' Rcmd 'y<- x' Rcmd 'foo<- function(x,y){r<-sqrt(x^2+y^2);10*sin(r)/r}' Rcmd 'z<- outer(x , y , foo)' Rcmd 'pdf(file="c:\\users\\rsherloc\\documents\\j602-user\\temp\\RicRplot001.pdf")' Rcmd 'persp(x,y,z,theta=30,phi=30,expand=0.5,xlab="X",ylab="Y",zlab="Z")' Rcmd 'dev.off()' launch jpath '~temp/RicRplot001.pdf' For your purposes you'd want to send the raw data from J to R for plotting rather than create in R as in the above example (otherwise you might as well just do the whole thing in R!?! 1. Create a new custom chart type There was a good thread on modifying and combining existing chart types in the forums about a year ago where Oleg gave an example of how to write a custom plot type. "http://www.jsoftware.com/pipermail/programming/2008-November/013009.html" I've got a draft of a wiki page summarizing the thread somewhere that I must get around to adding to the wiki. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
