Roberto
2012-Apr-27 20:24 UTC
[R] Hyperspec package: need to change spectra names in a stacked plot
Hi all, I need to insert the name of spectra in a stacked plot obtained with hyperspec. I use this command plot(spectra [c(-1:-4, -6:-8, -10:-12, -14:-16)], stacked = T) but, in this way R draw nameless spectra on the Y axis. How can I solve the problem? Thank you for any suggestion. Best regards, Roberto -- View this message in context: http://r.789695.n4.nabble.com/Hyperspec-package-need-to-change-spectra-names-in-a-stacked-plot-tp4593690p4593690.html Sent from the R help mailing list archive at Nabble.com.
Peter Ehlers
2012-Apr-28 17:47 UTC
[R] Hyperspec package: need to change spectra names in a stacked plot
On 2012-04-27 13:24, Roberto wrote:> Hi all, > I need to insert the name of spectra in a stacked plot obtained with > hyperspec. > > I use this command > plot(spectra [c(-1:-4, -6:-8, -10:-12, -14:-16)], stacked = T) > > but, in this way R draw nameless spectra on the Y axis. > > How can I solve the problem?Your code is not reproducible. (And do use TRUE instead of T; sooner or later it *will* bite you.) I think that you might be able to accomplish what I think you want by setting the argument axis.args, e.g. plot(x, stacked=TRUE, axis.args = list(y = list(c("apple", "banana", ....)))) Peter Ehlers> > Thank you for any suggestion. > Best regards, > Roberto