[R] Setting maximum value of the legend on an image.plot and animation

Peter Ehlers ehlers at ucalgary.ca
Sun Feb 6 00:14:49 CET 2011


Steve,

  I think that your second question may be answered by
  either setting the appropriate value for 'outdir' in
  ani.options() or by adding an outdir="yourdir" to the
  argument list in saveHTML.

Peter Ehlers

On 2011-02-05 09:22, Uwe Ligges wrote:
>
>
> On 01.02.2011 16:10, Steve_Friedman at nps.gov wrote:
>>
>> Hello,
>>
>> I'm doing the following:
>>
>> library(ncdf)
>> library(fields)
>> library(animation)
>>
>> saline<-  open.ncdf("salinity_1990.nc")
>> salt = get.var.ncdf(nc=saline, varid="Salinity")
>>
>> # create an animation of the complete temporal domain in the ncdf file.
>> saveHTML({
>>
>>           for (i in 1:364) {
>>             image.plot(salt[, , i])
>>         }
>>       }, img.name = "salinity.img", imgdir = "salinity_dir", htmlfile =
>> "salinity.html", zmax = c(0, 80),
>>          autobrowse = FALSE, title = "TIME SALINITY PREDICTIONS",
>>           description = c("This should plot 1 years daily salinity
>> predictions in Florida Bay")
>>         )
>>
>> Almost all of the data sets I work with are multi-temporal spatial forms.
>> Being able to view the time sequence is very important to us, The animation
>> procedure is very good. I appreciate its development.
>>
>> Here are my questions.
>> 1) I would like to find a procedure to set the maximum value of the legend
>> of an image.plot.  Each time step has a different maximum value, but for
>> the animation to be valuable, I need to standardize these to a maximum such
>> that the scale is equal in each time step.
>
>
> Specify the breaks manually using the argument "breaks" that can be
> passed to "..." in image.plot().
>
>
>> 2)  Secondly, when setting imgdir it only goes to a temp directory.  If I
>> define a directory, the new directory path is added to the default temp
>> directory path.  Is there a way to fix this so that the output directory is
>> truly defined in the saveHTML statements?
>
>
> I don't see a way, so just ask the maintainer of the animation package
> to allow for absolute paths or so.
>
> Uwe Ligges
>
>
>> I'm working on a windows XP machine using R 2.12.1.
>>
>>
>> Thanks
>> Steve
>>
>>
>> Steve Friedman Ph. D.
>> Ecologist  / Spatial Statistical Analyst
>> Everglades and Dry Tortugas National Park
>> 950 N Krome Ave (3rd Floor)
>> Homestead, Florida 33034
>>
>> Steve_Friedman at nps.gov
>> Office (305) 224 - 4282
>> Fax     (305) 224 - 4147
>>



More information about the R-help mailing list