0

enter image description here

I am running a code which will print multiple plots while in a for loop in a jupyter notebook.But I am getting a behavior as shown above. How do I avoid this and not print each plot top of each other while running inside for loop in jupyter?

for(i in names(cb_sniffer_outs_list)){
    if(length(cb_sniffer_outs_list[[i]]) > 2 || length(vartrix_outs_list_comb[[i]]) > 2){
      ven <- venndetail(list(cb_sniffer = cb_sniffer_outs_list[[i]], 
                vartrix = vartrix_outs_list_comb[[i]])) 
      print(i)
      print(plot(ven))
    }
    else{next}
    }

I tried the following code

for(i in names(cb_sniffer_outs_list)){
    if(length(cb_sniffer_outs_list[[i]]) > 2 || length(vartrix_outs_list_comb[[i]]) > 2){
      ven <- venndetail(list(cb_sniffer = cb_sniffer_outs_list[[i]], vartrix = vartrix_outs_list_comb[[i]])) 
      print(i)
      print(plot(ven))
    }
    else{next}
    }

and got this (image attached above)

kjetil b halvorsen
  • 1,206
  • 2
  • 18
  • 28
Saad Khan
  • 1
  • 2
  • You'd probably get more knowledgeable people seeing this post if you include mention of the packages in the post, or maybe the main plotting one in the title. For example, I cannot tell if you could plug into something like [this solution](https://stackoverflow.com/a/22993508/8508004) or [here](https://stackoverflow.com/a/33281280/8508004) easily. (I envision you want each plot as a separate row maybe? You may want to be clear on your preference in your post.) – Wayne Feb 07 '23 at 17:06
  • Yes I would ideally want each plot as a separate row in the jupyter lab notebook. – Saad Khan Feb 07 '23 at 19:11

0 Answers0