[hyperSpec-help] Hyperspec, plot, and xlim, ylim - 2 questions

Claudia Beleites claudia.beleites at ipht-jena.de
Tue Feb 14 09:01:30 CET 2012


Dear Holger,

> hyperspec objects do support plot() but appear to not support xlim=c()  
> ylim=c().
> Is this right? and if so, is there another way to set these limits?
plot (i.e. plotspc) support xlim and ylim.
However, you need to give them in a list as parameter plot.args:

plot (chondro, plot.args = list (xlim = c (400, 3200)))

There are other parameters that take similar argument lists:
*.args which take parameters directed to the respective function. I
cannot just use ... as the additional arguments need to be directed to
these different functions.

I'm open for suggestions for a better and more intuitive interface here.

> I would like to plot an hyperspec object and add a second graph into the  
> same coordinate system via "lines()", scaling the resulting plot.

But not a second spectrum (or something that could be treated as a
spectrum, see e.g. decomposition) and then plotted by plot (second *
scaling, add = TRUE)?

Can you be a bit more specific and give us an example, particularly of
the second graph that should go into the spectra plot?

> 
> Second question -
> For lines(), I need the x-axis of the hyperspec object. When the hyperspec  
> object contains several spectra, how do I access the nth ordinate?
All spectra of the hyperSpec object have the same wavelength axis: use
wl (object)
to get them.

The plotting coordinates may be different, though:
- the x axis if xoffsets are used
- for the y axis, the most common form to give offsets is stacked = TRUE.

In any case, the exact plotting coordinates are invisibly returned by
plotspc:
coord <- plot (flu)
str (coord)


Does that help?

Best,

Claudia

 _______________________________________________
> hyperspec-help mailing list
> hyperspec-help at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/hyperspec-help


-- 
Claudia Beleites
Spectroscopy/Imaging
Institute of Photonic Technology
Albert-Einstein-Str. 9
07745 Jena
Germany

email: claudia.beleites at ipht-jena.de
phone: +49 3641 206-133
fax:   +49 2641 206-399






More information about the hyperspec-help mailing list