[R] "par(tcl=0.5,las=1)" doesn't work
Ben Tupper
ben.bighair at gmail.com
Thu Jan 7 15:27:33 CET 2016
Hi,
I think it may be the order in which your par() configuration occurs relative to png(). When you open a new device, as you have with png(), the default par() values for that device are exposed. If you move your par() statement to *after* your call to png() you get the result you desire.
S=read.table("Sarrazin-2.5",as.is = default.stringsAsFactors())
#par(tcl=0.5,las=1) # - move to after you open the device
png(file="partest-1.png",width=580,height=580)
par(tcl=0.5,las=1) # - configure the device after opening it
dev.control("enable")
plot(V3,V2,xlab=" ",ylab="BIP, rel. zu Deutschland", pch=16,xlim=c(630,930),ylim=c(95,135))
dev.off()
See the 'details' section of ?par - "Each device has its own set of graphical parameters." I take that to mean a new set of parameters are exposed.
Cheers,
Ben
P.S. I wonder if that sentence might have more value if it read like this, "Configure each device after opening as each device has its own set of graphical parameters."
> On Jan 7, 2016, at 3:30 AM, Hans Haußmann <hhaussmann at arcor.de> wrote:
>
> Hi Bert Gunter and David Winsemius,
>
> sorry for sending my first post to R-help in German and thank you David for your efforts to translate.
>
> Here are two scripts now. In the first one the graphics parameters "tcl" and "las" are not recognized, in the second one they are. Why not in the first one?
>
> I am not sure whether I may attach the outputs of the two scripts, I just try.
>
> Kind regards,
>
> Hans Haußmann (Haussmann)
> <partest-1.txt><partest-2.txt><partest-1.png><partest-2.png>______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
More information about the R-help
mailing list