Koffler Daniel wrote:
Dear R Users!
I've want to save a lattice "parallel" plot with legend as png:
Plotting with legend works well, but when trying to save the plot there occurs
a problem with the legend.
###################################################
require(lattice)
#Some data:
data<-matrix(rnorm(100),ncol=5)
#Plot works
parallel(data)
legend("topright",legend=c("let's","rock"),col=c("black","red"),pch=1)
Really? Did this work for you?
You're mixing lattice and traditional graphics functions.
For lattice, you need the key= argument (or auto.key).
Here's a start:
parallel(~iris[1:4], iris,
key =
list(
corner=c(1, 1),
lines = list(lty = c(1, 2),
lwd = c(1, 3),
col = c("black", "red")),
text = list(c("here", "there"))
)
)
-Peter Ehlers
#Writing the legend doesn't
png("test.png")
parallel(data)
legend("topright",legend=c("let's","rock"),col=c("black","red"),pch=1)
dev.off()
####################################################
Thanks for your help,
Daniel Koffler
Fachhochschule Wiener Neustadt f?r Wirtschaft und Technik Ges.m.b.H.
University of Applied Sciences Wiener Neustadt for Business and Engineering
Ltd., Austria
Johannes Gutenberg-Stra?e 3
2700 Wiener Neustadt
Austria, Europe
ATU: 37772406
Firmenbuchnummer: 77005v
Firmenbuchgericht: Landesgericht Wiener Neustadt
DVR: 0798771
Der Inhalt dieses E-Mails ist ausschliesslich fuer den bezeichneten Adressaten
bestimmt. Jede Form der Kenntnisnahme, Veroeffentlichung, Vervielfaeltigung
oder Weitergabe des Inhalts dieses E-Mails durch unberechtigte Dritte ist
unzulaessig. Wir bitten Sie, sich mit dem Absender des E-Mails in Verbindung zu
setzen, falls Sie nicht der Adressat dieses E-Mails sind und das Material von
Ihrem Computer zu loeschen.
This e-mail and any attachments are confidential and int...{{dropped:6}}
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.