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) -------------- n?chster Teil -------------- S=read.table("Sarrazin-2.5",as.is = default.stringsAsFactors()) par(tcl=0.5,las=1) png(file="partest-1.png",width=580,height=580) dev.control("enable") plot(V3,V2,xlab=" ",ylab="BIP, rel. zu Deutschland", pch=16,xlim=c(630,930),ylim=c(95,135)) dev.off() -------------- n?chster Teil -------------- S=read.table("Sarrazin-2.5",as.is = default.stringsAsFactors()) # par(tcl=0.5,las=1) png(file="partest-2.png",width=580,height=580) dev.control("enable") plot(V3,V2,xlab=" ",ylab="BIP, rel. zu Deutschland", pch=16,xlim=c(630,930),ylim=c(95,135),tcl=0.5,las=1) dev.off() -------------- n?chster Teil -------------- Ein Dateianhang mit Bin?rdaten wurde abgetrennt... Dateiname : partest-1.png Dateityp : image/png Dateigr??e : 4330 bytes Beschreibung: nicht verf?gbar URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20160107/57e400e9/attachment.png> -------------- n?chster Teil -------------- Ein Dateianhang mit Bin?rdaten wurde abgetrennt... Dateiname : partest-2.png Dateityp : image/png Dateigr??e : 4296 bytes Beschreibung: nicht verf?gbar URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20160107/57e400e9/attachment-0001.png>
> On Jan 7, 2016, at 2: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>______________________________________________Hi, Are you sure that partest-1 does not work and partest-2 does work, presuming those are the first and second scripts, respectively, you refer to above? In partest-2, you have the line: # par(tcl=0.5,las=1) which is commented out with the '#' and therefore will not be interpreted by R, thus non-functional. In partest-1, the line is: par(tcl=0.5,las=1) where it will be interpreted by R and thus functional. Regards, Marc Schwartz
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.
On 1/7/2016 2:30 AM, Hans Hau?mann 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?To make your par() work the way you expect, you could try moving it below the png() command. Create the device, then set the par().> > I am not sure whether I may attach the outputs of the two scripts, I > just try. > > Kind regards, > > Hans Hau?mann (Haussmann) > > > ______________________________________________ > 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.[[alternative HTML version deleted]]
> On Jan 7, 2016, at 12: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.Dear Hans; When using "external" or "non-interactive graphics devices, you need to put the par call after the device is opened rather than before it. Try instead: S=read.table("Sarrazin-2.5",as.is = default.stringsAsFactors()) # moved this call after the device opening call png(file="partest-2.png",width=580,height=580) par(tcl=0.5,las=1) dev.control("enable") plot(V3,V2,xlab=" ",ylab="BIP, rel. zu Deutschland", pch=16,xlim=c(630,930),ylim=c(95,135)) dev.off() Best; David.> > 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.David Winsemius Alameda, CA, USA