avoid producing a eps-graphic with 2 pages by mixing traditional and grid graphics

+1 vote

I used this r-programm to generate an eps-graphic. unfortunately it produces a graphic with

one empty page and then the correct one and the problem is the graphic mixing

bv_setEPS1<-function(width1,height1)#set eps boundingbox
{
   args<-list(width=width1,height=height1)
   force <- list(onefile = TRUE, horizontal = FALSE, paper = "special")
   args[names(force)] <- force
   do.call("ps.options", args)
}
 
 
pievalues<-c(3,3,3,3)
 
h<-17.9*0.75*(15/25.2)/2.54
w<-17.9*0.75/2.54
sc<-0.75*17.9/25.2
 
bv_setEPS1(width1=w,height1=h)
ifont<-"Helvetica"
 
postscript(file="filename")#zeichne EPS
 
pushViewport(viewport(  #A
   layout=grid.layout(3,1,widths=sc*unit(c(25.2),c("cm")),
               heights=sc*unit(c(0.5,2,12.5),c("cm","cm","cm")))))
              
pushViewport(viewport(layout.pos.col=1, layout.pos.row=3))#main region  
par(mai=c(0,0,0,0))
layout(matrix(c(1,2),byrow=TRUE,ncol=2),widths=c(1,1))#lcm(6),lcm(6)))
       scal<-1.5
bisector<-bv_pie3D(x=pievalues,edges=100,radius=0.9*scal,height=0.16*scal,theta=pi/18*4,start=pi/2,border=par("fg"),
                col=pieColors,labels=NULL,labelpos=NULL,labelcol=par("fg"),labelcex=0.75*scal,
                sector.order=NULL,explode=0.0,shade=0.4,main="",pty="s")
popViewport()#main region
             
#oberer balken  
pushViewport(viewport(layout.pos.col=1, layout.pos.row=2,
           gp=gpar(fill=rgb(216,232,200,maxColorValue=255),
           col=rgb(216,232,200,maxColorValue=255) )))
grid.rect()
#beschriftung oberer balken
grid.text(bv_gnames(g),
          gp=gpar(col="black",fontfamily=ifont,cex=sc),
          just=c("center","center"))
popViewport()#oberer balken
             
popViewport()#A
             
dev.off()  
The result is like this:       

Aug 23, 2018 in Data Analytics by terasi
• 170 points

recategorized Aug 24, 2018 by Vardhan 39 views

2 answers to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
+1 vote

The bv_set() is missing from your code hence I can't reproduce the result and tweak the parameters to bring the output in one page.

You can refer to following page to customize the plot parameters: https://bit.ly/2ocZroZ

answered Aug 27, 2018 by Anmol
• 1,620 points
0 votes
Supplement: The function bv_pie3D must be plotrix::pie3d and is a traditional

graphic from the plotrix package. The Viewport functions are from grid graphics.

I have also exprimentet with baseViewports() recommended for combining

traditional grid graphics but without sucess.
answered Aug 27, 2018 by terasi
• 170 points
@terasi, how does @bolder's answer below help?

Related Questions In Data Analytics

0 votes
1 answer

How to export a graph to .eps file with R?

The easiest way that I could suggest ...READ MORE

answered Apr 27, 2018 in Data Analytics by darklord
• 6,140 points
559 views
0 votes
1 answer

How to filter a data frame with dplyr and tidy evaluation in R?

Requires the use of map_df to run each model, ...READ MORE

answered May 16, 2018 in Data Analytics by DataKing99
• 8,100 points
43 views
0 votes
1 answer

Dynamically select element from a list and work with it - Shiny R

Follow these steps: Import the data into R Check ...READ MORE

answered Dec 5, 2018 in Data Analytics by Maverick
• 10,000 points
240 views
0 votes
2 answers

What is difference between Distributed search head and Search head cluster?

 A distributed environment describes the separation of ...READ MORE

answered Dec 3, 2018 in Data Analytics by Ali
• 10,290 points
104 views
0 votes
2 answers

"Train" and "Test" sets in Data Science

Normally to perform supervised learning you need ...READ MORE

answered Aug 2, 2018 in Data Analytics by ANMOL
• 3,620 points
25 views
0 votes
2 answers

Installing MXNet for R in Windows System

You can install it for python in ...READ MORE

answered Dec 3, 2018 in Data Analytics by Kalgi
• 35,750 points
175 views
+1 vote
3 answers

Problem with installation of Wordcloud in anaconda

Using Anaconda Python 3.6 version For Windows ...READ MORE

answered Aug 7, 2018 in Data Analytics by Priyaj
• 56,120 points
1,711 views
0 votes
1 answer

How to pass command line arguments to run a Rscript

1. For taking an argument from the ...READ MORE

answered Aug 6, 2018 in Data Analytics by Anmol
• 1,620 points
57 views
0 votes
2 answers

When scoring a logistic regression model , is having the predicted variable in test dataset mandatory ?

Answer to your follow up question: We can ...READ MORE

answered Oct 17, 2018 in Data Analytics by Anmol
• 1,620 points
32 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.