DaveL,
No, I have not received any replies, yours is the first.
I may have answered my own question. I did post back to the list but, it
appears that I sent the final (third) post to myself only and not the
list. DOH! I include it now below your message.
I am able to export pages to individual files in other formats but, now
I am stumbling over how to do a similar operation that will break-up a
multi-page .sgr file into several single-page (or smaller multi-page)
.sgr files. I am currently exploring dev.copy and still open to
suggestions.
Regarding your comments, individual pages are accessed by referencing
the GraphSheetPage class in the guiCreate() and guiModify() functions
(and others?). Does your 'extract individual graphs' comment refer to
the entire drawing area relative to a page or relative to a plot? I have
(in this case) four plots per page but, they each seem to have their own
graph area associated with the single plot area. Also, some of the
additional labelling and such that I add to each are not attached to the
associated plot. I can select and operate on any plot but, the extra
titles and such remain behind. This leads me to believe that even
selecting entire graph areas will not yet address my need.
Thanks for your reply, DaveT.
*************************************
Silviculture Data Analyst
Ontario Forest Research Institute
Ontario Ministry of Natural Resources
david.john.thompson@ontario.ca
http://ofri.mnr.gov.on.ca
*************************************
From: David L Lorenz [mailto:lorenz@usgs.gov]
Sent: June 1, 2007 08:56 AM
To: Thompson, David (MNR)
Subject: Re: [S] Extract multiple graphsheets from single file?
Dave,
Did anyone reply to your post?
I looked through some documentation and I can't see how to refer to
graphs on a page. The documentation for editable graphs discusses the
structure of graphs on a graphsheet, but does not address how pages show
up in referencing plots.
It is pretty easy to extract individual graphs, but apparently not
very easy to deal with pages.
Dave
#####################################################
From: Thompson, David (MNR)
Sent: May 25, 2007 11:09 AM
To: Thompson, David (MNR)
Subject: RE: [S] Extract multiple graphsheets from single file?
Hello yet again,
I seem to have solved my problem. This is what I did:
exportGraphSheetPages <- function(prefix='', ext='.wmf', extype='WMF'){
prefix <- prefix ; ext <- ext ; extype <- extype
gsname <- list(guiGetObjectNames('GraphSheetPage',
guiGetGSName()))
pname <- lapply(gsname, function(i) substring(i,
nchar(guiGetGSName())+2) )
fname <- lapply(pname, function(i, x, y) paste(x, i, y, sep=''),
x = prefix, y = ext)
lapply(1:length(gsname[[1]]), function(i, x, y, z){
guiModify('GraphSheet', Name=guiGetGSName(),
CurrentPage=x[[1]][i])
export.graph(FileName=y[[1]][i], Name=guiGetGSName(),
ExportType=z)
}, x = pname, y = fname, z = extype)
} # exportGraphSheetPages(prefix='', ext='', extype='')
exportGraphSheetPages("resid")
I'm satisfied with the results.
Comments?
Thanks, DaveT.
*************************************
Silviculture Data Analyst
Ontario Forest Research Institute
Ontario Ministry of Natural Resources
david.john.thompson@ontario.ca
http://ofri.mnr.gov.on.ca <http://ofri.mnr.gov.on.ca>
*************************************
From: s-news-owner@lists.biostat.wustl.edu
[mailto:s-news-owner@lists.biostat.wustl.edu] On Behalf Of Thompson,
David (MNR)
Sent: May 24, 2007 04:59 PM
To: s-news
Subject: Re: [S] Extract multiple graphsheets from single file?
Hello again,
I dove back into the archives again with a little better luck.
Found this excellent post:
www.biostat.wustl.edu/archives/cgi-bin/mesg.cgi?a=s-news&i=4384786F.8000
505%40blackmesacapital.com
Subject: Re: dev.copy on tabbed graphsheet device
From: Tony Plate
Date: Wed, 23 Nov 2005 07:10:55 -0700
. . . which led me to trying this:
gsname <- list(guiGetObjectNames("GraphSheetPage",
guiGetGSName()))
for(i in gsname) {
pname <- substring(i, nchar(guiGetGSName())+2)
fname <- paste(pname, ".wmf", sep="")
guiModify("GraphSheet", Name=guiGetGSName(),
CurrentPage=pname)
export.graph(FileName=fname, Name=guiGetGSName(),
ExportType="WMF")
} # gsname for graphsheet, pname for page, fname for file
. . . and a variety of permutations with no luck.
This code did generate a pair of character vectors, pname and fname, and
did seem to
ripple through the graphsheetpages, but I get no files output.
Suggestions?
By the way, I cannot confirm that each page in the .sgr file is actually
activated.
Thanks again, DaveT.
*************************************
Silviculture Data Analyst
Ontario Forest Research Institute
Ontario Ministry of Natural Resources
david.john.thompson@ontario.ca
http://ofri.mnr.gov.on.ca <http://ofri.mnr.gov.on.ca>
*************************************
-----Original Message-----
From: s-news-owner@lists.biostat.wustl.edu
[mailto:s-news-owner@lists.biostat.wustl.edu
<mailto:s-news-owner@lists.biostat.wustl.edu> ] On Behalf Of Thompson,
David (MNR)
Sent: May 24, 2007 02:43 PM
To: s-news
Subject: [S] Extract multiple graphsheets from single file?
Hello,
I have created a graph with many (48) graphsheets that each contain
two pairs of rf- and qq-plots with mods.
Is there an easy, quick, safe way to split this into multiple graphs?
Perhaps files with groups of eight pages (or even singles) per file?
Thanks, DaveT.
*************************************
Silviculture Data Analyst
Ontario Forest Research Institute
Ontario Ministry of Natural Resources
david.john.thompson@ontario.ca
http://ofri.mnr.gov.on.ca <http://ofri.mnr.gov.on.ca>
*************************************
--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu. To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message: unsubscribe s-news
#####################################################
|