Page MenuHomePhabricator

Create complete network plot in its function
Open, NormalPublic

Description

Currently the network plot for cluster analysis is not completely set up in its function. It's is finally stitched together in the report.

Event Timeline

eisenman created this task.May 27 2020, 6:15 PM
wiesenfa added a comment.EditedAug 6 2020, 10:09 AM

the function is network() and is already in the report

{r ,eval=T,fig.width=12, fig.height=6,include=FALSE}
if (length(relensemble)>2) {
  netw=network(object,
               method = "symdiff", 
               edge.col=grDevices::grey.colors,
               edge.lwd=1,
               rate=1.05,
               cols=cols
               )
  
  plot.new()
  leg=legend("topright",  names(netw$leg.col), lwd = 1, col = netw$leg.col, bg =NA,plot=F,cex=.8)
  w <- grconvertX(leg$rect$w, to='inches')
  addy=6+w
} else addy=1
{r network, fig.width=addy, fig.height=6,out.width='100%'}
if (length(relensemble)>2) {
  plot(netw,
       layoutType = "neato",
       fixedsize=TRUE,
       # fontsize,
       # width,
       # height,
       shape="ellipse",
       cex=.8
       )
}

the complication arises to handle the automatic sizing of the plot, which is why in the first chunk it reads out the width without plotting and in the second chunk the figure width is adapted

can be closed?

Is it not possible to create a plot first on a canvas that contains everything and as a second step add the scaled plot to the report?

this is more or less what I tried, ugliness is T27326. I think a ggplot solution mentioned there would be better

wiesenfa moved this task from In Progress to Done on the challengeR (v1.0) board.Sep 24 2020, 1:09 PM