Re: [R] png scaling problem
If you have not already tried it try creating a fig file: xfig(myfile.fig) plot(1:10) dev.off() and then using the fig2dev utility (find it via google) to convert it to a tiff: fig2dev -L tiff myfile.fig myfile.tiff On 9/2/05, Knut Krueger [EMAIL PROTECTED] wrote: Probably a better first question is, why are you using a bitmapped graphics format if you need the image to be re-scaled? I need a 1000 dpi tif file in a size of appr. 10 to 10 cm for applied animal behaviour science: http://authors.elsevier.com/GuideForAuthors.html?PubID=503301dc=GFA images to one of the following formats (Note the resolution requirements for line drawings, halftones, and line/halftone combinations given below.): EPS: Vector drawings. Embed the font or save the text as graphics. TIFF: Colour or greyscale photographs (halftones): always use a minimum of 300 dpi. TIFF: Bitmapped line drawings: use a minimum of 1000 dpi. TIFF: Combinations bitmapped line/half-tone (colour or greyscale): a minimum of 500 dpi is required. DOC, XLS or PPT: If your electronic artwork is created in any of these Microsoft Office applications please supply as is. I tired the Postscript file but the file is double heigh as width i do not know why. The problem was already discussed in the tread: [R] High resolution plots I have to send the images possibly yesterday and I am looking fo a suitable solution since two months now. I tired gsview with converting to all possible Tiff formats but the images appear not in color and in a strange black and white way Some readers are able to read it (Windows Image view) other not and I do not know which reader the journal will use :-( And the ylab is too small ... http://biostatistic.de/temp/1.tif http://biostatistic.de/temp/2.tif http://biostatistic.de/temp/3.tif http://biostatistic.de/temp/4.tif In general, bitmapped graphics do not resize well, though if you have a specific need and know a target image size, you can adjust various parameters to look decent. Are you going to view these images in a web browser, where you are concerned with display size and resolution? From your e-mail headers it appears you are on Windows. If you need a re-sizable graphic, use a vector based format such as wmf/emf, especially if you need the graphics embedded in a Windows application such as Word or Powerpoint. This is the default format under Windows when copying and pasting a graphic between applications. You can then, fairly freely, resize the image in the target application as you may require. If you are going to print the graphic directly or include it in a document for printing (as opposed to just viewing it), then use PDF or Postscript. Ok there is a second description for the file format :-( http://authors.elsevier.com/ArtworkInstructions.html?dc=AI2 there are pdf formats welcome but with defined conditions: Maybe anybody could give me a hint to get the files in the recommendet format. I will ask them immediately which whether the pdf is allowed or not, becaus they have two different instruction sites :-( Regards Knut __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] png scaling problem
Gabor Grothendieck schrieb: If you have not already tried it try creating a fig file: xfig(myfile.fig) plot(1:10) dev.off() and then using the fig2dev utility (find it via google) to convert it to a tiff: fig2dev -L tiff myfile.fig myfile.tiff Error:: fig2def: broken pipe ghostscript aborted? command was gs -q -dSAFER -sDEVICE=tiff24nc -r80 -g3830x506 -sOutputFile=44.tif __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] png scaling problem
Knut, Gabor has provided a possible approach here. Your comments on using postscript make me wonder how your code looked. The following, for example, will create a 4 inch by 4 inch square plot to an encapsulated postscript file (EPS). It will also specify/include required resources for the Helvetica font, which is one of the requirements on the page you reference. Since Helvetica is one of the standard Adobe PS fonts, I don't believe that it is necessary to actually embed the font here, which would be the case if you used a non-standard font. If you open the EPS file in a text editor, you will see many lines referring to 'Resources' and fonts. postscript(RPlot.eps, onefile = FALSE, horizontal = FALSE, paper = special, height = 4, width = 4, family = Helvetica, font = Helvetica) barplot(1:10) dev.off() They keys above are the 'onefile', 'horizontal' and 'paper' arguments, which must be set as above to generate an EPS file with the specified size and bounding box. The page referenced mentions creating the image as close as possible to the actual size required, so be sure to set the 'height' and 'width' arguments per that specification. Using postscript here will also better enable the 50% reduction that is mentioned, given the vector based format here. The key here also is to be sure that the plot looks good in the target format, not on the screen, which includes text size, readability and positioning, etc. HTH, Marc Schwartz On Fri, 2005-09-02 at 02:03 -0400, Gabor Grothendieck wrote: If you have not already tried it try creating a fig file: xfig(myfile.fig) plot(1:10) dev.off() and then using the fig2dev utility (find it via google) to convert it to a tiff: fig2dev -L tiff myfile.fig myfile.tiff On 9/2/05, Knut Krueger [EMAIL PROTECTED] wrote: Probably a better first question is, why are you using a bitmapped graphics format if you need the image to be re-scaled? I need a 1000 dpi tif file in a size of appr. 10 to 10 cm for applied animal behaviour science: http://authors.elsevier.com/GuideForAuthors.html?PubID=503301dc=GFA images to one of the following formats (Note the resolution requirements for line drawings, halftones, and line/halftone combinations given below.): EPS: Vector drawings. Embed the font or save the text as graphics. TIFF: Colour or greyscale photographs (halftones): always use a minimum of 300 dpi. TIFF: Bitmapped line drawings: use a minimum of 1000 dpi. TIFF: Combinations bitmapped line/half-tone (colour or greyscale): a minimum of 500 dpi is required. DOC, XLS or PPT: If your electronic artwork is created in any of these Microsoft Office applications please supply as is. I tired the Postscript file but the file is double heigh as width i do not know why. The problem was already discussed in the tread: [R] High resolution plots I have to send the images possibly yesterday and I am looking fo a suitable solution since two months now. I tired gsview with converting to all possible Tiff formats but the images appear not in color and in a strange black and white way Some readers are able to read it (Windows Image view) other not and I do not know which reader the journal will use :-( And the ylab is too small ... http://biostatistic.de/temp/1.tif http://biostatistic.de/temp/2.tif http://biostatistic.de/temp/3.tif http://biostatistic.de/temp/4.tif In general, bitmapped graphics do not resize well, though if you have a specific need and know a target image size, you can adjust various parameters to look decent. Are you going to view these images in a web browser, where you are concerned with display size and resolution? From your e-mail headers it appears you are on Windows. If you need a re-sizable graphic, use a vector based format such as wmf/emf, especially if you need the graphics embedded in a Windows application such as Word or Powerpoint. This is the default format under Windows when copying and pasting a graphic between applications. You can then, fairly freely, resize the image in the target application as you may require. If you are going to print the graphic directly or include it in a document for printing (as opposed to just viewing it), then use PDF or Postscript. Ok there is a second description for the file format :-( http://authors.elsevier.com/ArtworkInstructions.html?dc=AI2 there are pdf formats welcome but with defined conditions: Maybe anybody could give me a hint to get the files in the recommendet format. I will ask them immediately which whether the pdf is allowed or not, becaus they have two different instruction sites :-( Regards Knut __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!
Re: [R] png scaling problem
but back to the last problem, what could be wrong that the ylab is not displayed as expected? with regards Knut __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] png scaling problem
Knut Krueger schrieb: Ok there is a second description for the file format :-( http://authors.elsevier.com/ArtworkInstructions.html?dc=AI2 there are pdf formats welcome but with defined conditions: Maybe anybody could give me a hint to get the files in the recommendet format. I will ask them immediately which whether the pdf is allowed or not, becaus they have two different instruction sites :-( This one is genarally for elsvier journals, but if there is a special description in the journal page, authors must use this ... means: EPS: Vector drawings. Embed the font or save the text as graphics. TIFF: Colour or greyscale photographs (halftones): always use a minimum of 300 dpi. TIFF: Bitmapped line drawings: use a minimum of 1000 dpi. TIFF: Combinations bitmapped line/half-tone (colour or greyscale): a minimum of 500 dpi is required. with regards Knut Krueger -- with regards Knut Krueger http://www.biostatistic.de __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] png scaling problem
I can't reproduce this problem. It works fine for me. Some possibilities are: 1. check which version of fig2dev you are using. If you are on Windows I am using the fig2dev that comes in winfgi142.zip by Andreas Schmidt found at: http://user.cs.tu-berlin.de/~huluvu/WinFIG.htm Here is the version info I get: C:\binfig2dev -h | findstr Windows Windows version 2 (02/08/2004) by Andreas Schmidt 2. Also, it seems from your output that fig2dev uses ghostscript. I am using ghostscript 8.13. Check what version you are using. On 9/2/05, Knut Krueger [EMAIL PROTECTED] wrote: Gabor Grothendieck schrieb: If you have not already tried it try creating a fig file: xfig(myfile.fig) plot(1:10) dev.off() and then using the fig2dev utility (find it via google) to convert it to a tiff: fig2dev -L tiff myfile.fig myfile.tiff Error:: fig2def: broken pipe ghostscript aborted? command was gs -q -dSAFER -sDEVICE=tiff24nc -r80 -g3830x506 -sOutputFile=44.tif __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] png scaling problem
On Fri, 2005-09-02 at 15:08 +0200, Knut Krueger wrote: but back to the last problem, what could be wrong that the ylab is not displayed as expected? with regards Knut The TIF files seem to be OK. However, the PNG files, as a result of your attempt to scale the plot, do not have enough margin space for side = 2 (left). You would need to adjust the settings for par(mar) and perhaps adjust the overall plot size in the png() call. This is one of the reasons why trying to scale a bitmapped image is problematic. If you want to have finer control over the text annotation, use something like the following: # Create just the 'bare' barplot and save the bar # midpoints in 'mp' mp - barplot(1:10, xaxt = n, yaxt = n, ann = FALSE) # Now create the x axis labels, using 'mp' for placement # 'cex' controls text size. # See ?axis for more details axis(1, at = mp, labels = LETTERS[1:10], cex = 1.25) # Do the same for the y axis axis(2, at = seq(0, 10, 2), cex = 1) # Do the x axis label, using mtext() # See ?mtext mtext(1, line = 3, text = X Axis Label, cex = 1.5) # Same for y axis mtext(2, line = 2.5, text = y Axis Label, cex = 1.5) # Now the title mtext(3, line = 2, text = Main Barplot Title, cex = 4) Again, with the above, be sure to check the output in the target format, not on the screen. They will not always be the same. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] png scaling problem
thx I will try it ... think I will be newbie in R for the next 10 jears ... And I don't know why wh choosed the only journal which don't want pdf files :-( __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] png scaling problem - solved :-)
Gabor Grothendieck schrieb: I can't reproduce this problem. It works fine for me. Some possibilities are: 1. check which version of fig2dev you are using. If you are on Windows I am using the fig2dev that comes in winfgi142.zip by Andreas Schmidt found at: http://user.cs.tu-berlin.de/~huluvu/WinFIG.htm Here is the version info I get: C:\binfig2dev -h | findstr Windows Windows version 2 (02/08/2004) by Andreas Schmidt I have Windows version 2.1 (11/08/2004) by Andreas Schmidt 2. Also, it seems from your output that fig2dev uses ghostscript. I am using ghostscript 8.13. Check what version you are using. 8.51 but the most easy solution was the link to winfig - Now I need three systems to convert the files ?!? ghostscript fig2dev and winfig but it works fine :-) I will write down this solution in our forum ( If the paper is submitted) and will post you the link. If anybody else will need the same you could post only the link ;-) thx Knut __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] png scaling problem - solved :-)
Yet another Windows solution without winfig: 1. Create a postscript image in R 2. Open this image in Ghostscript 3. Select a reasonable resolution using Display Settings in ghostscript 4. Copy the image via clipboard into your favorite image viewer (e.g. IrfanView) 5. Save the image in the required format. Thomas P. PS: But the supermost ;-) flexible tool to perform such tasks is, of course, ImageMagick. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] png scaling problem
On Thu, 2005-09-01 at 21:51 +0200, Knut Krueger wrote: scaling-4 xywidth-480 resolution-150 png(filename = c:/r/anschluss/plots/4.png, width = xywidth*scaling, height = xywidth*scaling,pointsize = 12, bg = white, res = resolution*scaling) .. barplot(xrow,col = barcolors,cex.axis=scaling, ylab=mean time till attachment in sec,cex.lab=1.2*scaling) I tried to scale the barplot but there is one strange result: scaling=1 http://biostatistic.de/temp/1.png--- the ylab is ok scaling=2 http://biostatistic.de/temp/2.png--- the ylab is not ok scaling=4 http://biostatistic.de/temp/4.png--- the ylab is terrible is there any better solution to scale the resolution and the width/height? with regards Knut Probably a better first question is, why are you using a bitmapped graphics format if you need the image to be re-scaled? In general, bitmapped graphics do not resize well, though if you have a specific need and know a target image size, you can adjust various parameters to look decent. Are you going to view these images in a web browser, where you are concerned with display size and resolution? From your e-mail headers it appears you are on Windows. If you need a re-sizable graphic, use a vector based format such as wmf/emf, especially if you need the graphics embedded in a Windows application such as Word or Powerpoint. This is the default format under Windows when copying and pasting a graphic between applications. You can then, fairly freely, resize the image in the target application as you may require. If you are going to print the graphic directly or include it in a document for printing (as opposed to just viewing it), then use PDF or Postscript. The latter in EPS format, can be imported into many Windows applications like Word, including the generation of a preview image. However, they don't look good for direct use in presentations (unless you print to a PS file and then convert to PDF for viewing). See ?Devices for more information. With a better idea of how you plan to use the graphic(s), we can offer more specific recommendations on how to proceed. Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] png scaling problem
Probably a better first question is, why are you using a bitmapped graphics format if you need the image to be re-scaled? I need a 1000 dpi tif file in a size of appr. 10 to 10 cm for applied animal behaviour science: http://authors.elsevier.com/GuideForAuthors.html?PubID=503301dc=GFA images to one of the following formats (Note the resolution requirements for line drawings, halftones, and line/halftone combinations given below.): EPS: Vector drawings. Embed the font or save the text as graphics. TIFF: Colour or greyscale photographs (halftones): always use a minimum of 300 dpi. TIFF: Bitmapped line drawings: use a minimum of 1000 dpi. TIFF: Combinations bitmapped line/half-tone (colour or greyscale): a minimum of 500 dpi is required. DOC, XLS or PPT: If your electronic artwork is created in any of these Microsoft Office applications please supply as is. I tired the Postscript file but the file is double heigh as width i do not know why. The problem was already discussed in the tread: [R] High resolution plots I have to send the images possibly yesterday and I am looking fo a suitable solution since two months now. I tired gsview with converting to all possible Tiff formats but the images appear not in color and in a strange black and white way Some readers are able to read it (Windows Image view) other not and I do not know which reader the journal will use :-( And the ylab is too small ... http://biostatistic.de/temp/1.tif http://biostatistic.de/temp/2.tif http://biostatistic.de/temp/3.tif http://biostatistic.de/temp/4.tif In general, bitmapped graphics do not resize well, though if you have a specific need and know a target image size, you can adjust various parameters to look decent. Are you going to view these images in a web browser, where you are concerned with display size and resolution? From your e-mail headers it appears you are on Windows. If you need a re-sizable graphic, use a vector based format such as wmf/emf, especially if you need the graphics embedded in a Windows application such as Word or Powerpoint. This is the default format under Windows when copying and pasting a graphic between applications. You can then, fairly freely, resize the image in the target application as you may require. If you are going to print the graphic directly or include it in a document for printing (as opposed to just viewing it), then use PDF or Postscript. Ok there is a second description for the file format :-( http://authors.elsevier.com/ArtworkInstructions.html?dc=AI2 there are pdf formats welcome but with defined conditions: Maybe anybody could give me a hint to get the files in the recommendet format. I will ask them immediately which whether the pdf is allowed or not, becaus they have two different instruction sites :-( Regards Knut __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html