Here's a collection of notes on commands for manipulating tabbed
graphsheets under Windows. The first three functions in this list are
what you need to cycle through the pages in a tabbed graphsheet.
* guiGetGSName() # to get the name of the currently active graphsheet --
you can change active graphsheet by selecting with mouse (can replace
"GSD2" below by guiGetGSName())
* guiGetObjectNames("GraphSheetPage", "GSD2") # to get the names of all
the pages in the graphsheet "GSD2"
* guiModify("GraphSheet", Name="GSD2", CurrentPage="Page1") # sets the
currently displayed page in a graphsheet
* guiGetPlotName("GSD2", GraphNum=1, PlotNum=1) # get the name of a plot
(default 1) on a page (default 1) in the current graphsheet
* guiGetPropertyValue("GraphSheet", Name="GSD2", "CurrentPage") #
returns the name of the currently displayed page in the graphsheet
graphsheet(Name="FooBar", ...) # set the name of the graphsheet when
creating it
* guiModify( "GraphSheet", Name = "GSD2", NewName = "MyGraph") # change
the name of graphsheet "GSD2"
* guiModify( "GraphSheetPage", Name = "GSD2$1", NewName = "MyPage") #
change the name of a page (graphsheet name remains "GSD2")
* guiCreate( "GraphSheetPage", Name = "GSD2$Page1") # create a new
graphsheet page
* guiPrint(Name="GSD2", StartPage=??, EndPage=??) # print some pages
from a graphsheet (help page says that pages must be specified as
numbers, don't know if this is true)
* guiSave("GraphSheet", Name="GSD2", FileName="file.sgr") # saves the
whole graphsheet (all pages) in a file
* export.graph(FileName="GSD2.eps", Name="GSD2", ExportType="EPS") #
saves the currently active page as an EPS file (many other types are
available)
* guiRemoveContents("GraphSheet", Name="GSD2"): remove the contents of
the current page (note that "Clear" on the popup-menu on the page tab
appears not to work properly)
* guiRemove("GraphSheetPate", Name=page.name): remove a page from the
graphsheet (get page names using guiGetObjectNames("GraphSheetPage",
"GSD2")). Warning: removing the last page seems to make the graphsheet
non-functional.
hope this helps,
Tony Plate
andreas.krause@novartis.com wrote:
I have a graphsheet device with tabbed pages, for example by entering (on
S-Plus 6.2 Prof Windows in this case)
dotplot(site ~ yield | year, data=barley, layout=c(1,1))
If I now enter
dev.copy(wmf.graph, file="graph-###.wmf")
only the currently active page gets exported and not the entire set of
graphs.
I would need to cycle through the pages and activate each before calling
dev.copy, so it seems.
So how can I activate the pages one after the other or use a completely
different, more elegant approach?
Thank you very much in advance!
Andreas Krause
PS. For the full context: the problem is that wmf.graph uses a different
specification of colors than graphsheet, and I find them difficult to map.
That's why I want to use dev.copy instead of simply opening a wmf.graph
device and re-running the commands. I hate the color implementation(s!).
--------------------------------------------------------------------
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
|