[kepler-users] Graphical Output

Jim Regetz regetz at nceas.ucsb.edu
Fri Jul 24 14:54:48 PDT 2009


Hi Colin,

If you are willing to go the R actor route, the following should get you 
started. For illustration, I just made up a fake matrix of data (foo):

foo <- matrix(c(rpois(9,30), rpois(9,10), rpois(9,5), rpois(9,40)),
   ncol=9, byrow=TRUE, dimnames=list(c("PRD", "PWRT", "GSUM", "MISC"),
   c("1x4", "1x8", "1x16", "2x4", "2x8", "2x16", "4x4", "4x8", " 4x16")))

What matters is that each column corresponds to a bar, with one row for 
each category, as in:

      1x4 1x8 1x16 2x4 2x8 2x16 4x4 4x8 4x16
MISC  45  41   47  37  40   27  34  32   49
GSUM   3   5    5   6   6   10   5   4   10
PWRT   8   4    2  11   5    9   4   9    6
PRD   19  24   12  25  16   14  23  23   20

AFAIK you can't produce the 3D bars with the R barplot function, so if 
that's important, then you may be out of luck. Otherwise, the code below 
produces a figure that pretty much matches everything else in your 
example (right down to Excel's color scheme, on the off chance you 
actually find it attractive):

# change figure settings to allow legend to fit outside plot area
par(xpd=TRUE, mar=par()$mar+c(0,0,0,4))

# create barplot
barplot(foo, legend=TRUE, col=c("slateblue1", "maroon4",
   "lemonchiffon", "cadetblue1"), args.legend=list(x=13.5, y=50))

Note that x and y in the args.legend argument list specify where the 
legend should be drawn. I just hard-coded values that work with this 
particular data matrix, but you'd need to modify this to match your data 
(or add code to determine reasonable values dynamically).

Hope that helps,
Jim


Chad Berkley wrote:
> Hi Colin,
> 
> Most of our workflows use R to generate graphs like that.  I'm not sure 
> if there are specific actors for doing this.  I think our workflow 
> developers have used custom R scripts in the past.  Does anyone know of 
> an example?
> 
> chad
> 
> 
> Colin Campbell wrote:
>> Is it possible to make a graph similar to the one in the attachment 
>> using Kepler? -- 
>> -Colin Campbell
>>
>> ------------------------------------------------------------------------
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Kepler-users mailing list
>> Kepler-users at kepler-project.org
>> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
> _______________________________________________
> Kepler-users mailing list
> Kepler-users at kepler-project.org
> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
> 



More information about the Kepler-users mailing list