'colramp' argument is what you are looking for, here is the example code.

library(flowViz)
data(GvHD)
fs <- GvHD[1:2]

#generate all colors you need
myColors <- gray.colors(255)
#reverse it as you want dark for high and white for low
myColors <- rev(myColors)
#wrap it into a ramp function
myColRamp <- colorRampPalette(myColors)

# pass the ramp function to xyplot
xyplot(`SSC-H`~`FSC-H`, fs, smooth = FALSE, xbin = 128, colramp = myColRamp)


Mike Jiang

On 03/18/2014 09:34 AM, Joachim Schumann wrote:
> Hi Mike,
>>
>> thanks for your answer. I think xbin is the only thing I need. But I
>> have another question: I want to create a xyplot of my data. The range
>> of e.g. columns FS.Log and FL.4.Log is from 0-4095. I want to display
>> the xyplot (FL.4.Log ~ FS.Log) as a grayscale image with 256 linear
>> gradiations. Black should indicate 4095 (maxRange) and white should
>> indicate 0 (minRange). Now I need 256 linear gradiations from black to
>> white. The data resolution should be 128.
>> Can you tell me how to create such a grayscale image? I attached an
>> image showing the grayscale.
>>
>> Best,
>> Joachim
>>
>>
>> Am 14.03.2014 18:07, schrieb Mike:
>> > `nbin` is for displaying the marginal events (i.e. those gray segments
>> > piled up at the edges)
>> >
>> > `binSize` is for `timeline plotting`, i.e. when you do 'xyplot' on a
>> > `flowFrame` without 'formula` supplied , for example:
>> >
>> > xyplot(GvHD[["s5a05"]], binSize = 100)
>> >
>> > So again, 'xbin' is the argument to adjust the 'resolution'  for
>> > 'non-smoothed' xyplot . e.g.
>> >
>> > xyplot(`FSC-H` ~ `SSC-H`, GvHD[["s5a05"]], smooth = FALSE, xbin = 32)
>> > #lower resolution and faster rendering
>> >
>> > xyplot(`FSC-H` ~ `SSC-H`, GvHD[["s5a05"]], smooth = FALSE, xbin = 128)
>> > #higher resolution and slower rendering
>> >
>> >
>> > Mike
>> >
>> >
>> > On 03/13/2014 04:08 AM, Joachim Schumann wrote:
>> >> Yes, i meant the xyplot. Can I also change the number of events
>> >> within one bin? The vignette sometimes says nbin, sometimes binSize.
>> >>
>> >> Am 12.03.2014 18:11, schrieb Mike:
>> >>> Not sure what you mean by `histogram`. If you are talking about
>> >>> `xyplot`, there is `xbin` argument to adjust resolution (when you
>> >>> set `smooth = FALSE`).
>> >>>
>> >>> Mike
>> >>> On 03/12/2014 05:32 AM, Joachim Schumann wrote:
>> >>>> Hi Mr. Jiang,
>> >>>>
>> >>>> I'm using flowViz to create a histogram of my flow cytometric data.
>> >>>> Is there any way I can adjust the data resolution  (eg to 128)
>> >>>> within the histogram?
>> >>>>
>> >>>> Best regards,
>> >>>> Joachim
>> >>>>
>> >>>
>> >>
>> >>
>> >
>>
>>
>> --
>> M. Sc. Joachim Schumann
>> Department of Environmental Microbiology
>> AG Flow Cytometry
>> Helmholtz Centre for Environmental Research - UFZ
>> Permoserstraße 15, 04318 Leipzig
>>
>> E-Mail: joachim.schumann@ufz.de
>> http://www.ufz.de
>>
> --
> Joachim Schumann
> Department of Environmental Microbiology
> AG Flow Cytometry
> Helmholtz Centre for Environmental Research - UFZ
> Permoserstraße 15, 04318 Leipzig
> E-Mail: joachim.schumann@ufz.de <mailto:joachim.schumann@ufz.de>
> http://www.ufz.de


	[[alternative HTML version deleted]]

