# TMVA output plots without using GUI

**URL:** <https://root-forum.cern.ch/t/tmva-output-plots-without-using-gui/42423>\
**Category:** TMVA\
**Created:** [November 24, 2020, 3:56pm UTC](https://root-forum.cern.ch/t/tmva-output-plots-without-using-gui/42423 "2020-11-24T15:56:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zoso](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/z/bcef8e/32.png) [@zoso](https://root-forum.cern.ch/u/zoso)\
**Post date:** [November 24, 2020, 3:56pm UTC](https://root-forum.cern.ch/t/tmva-output-plots-without-using-gui/42423/1 "2020-11-24T15:56:55Z")

</div>

Hi everyone,

I trained different methods using TMVA, obtained the output and weight files, and now I want to display the results in several plots.

I know there are some macros/scripts to produce these plots (e.g. variables.cxx()), but as far as I know this macros are GUI based, meaning that, each time I run it a window pops up displaying the plot. Since I’m remotely connected to lxplus this seems to be a problem, is there any way to just run the script and only save the file without displaying it in a window? The same applies for all scripts under TMVAGui.

I also found an alternative working on SWAN, but in all the examples the plots are produced immediately after the training, and my intention is to use the output already created by the training and then create the plots separately, is that possible?

Many thanks in advance. (ROOT version 6.22/02)

Cheers,  
Gonzalo

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [November 24, 2020, 4:56pm UTC](https://root-forum.cern.ch/t/tmva-output-plots-without-using-gui/42423/2 "2020-11-24T16:56:07Z")

</div>

@swunsch@moneta I am not sure what to suggest here, do you have something in mind?

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [November 25, 2020, 1:41pm UTC](https://root-forum.cern.ch/t/tmva-output-plots-without-using-gui/42423/3 "2020-11-25T13:41:44Z")

</div>

Hi,

The TMVAGUI library (libTMVAGUI) consists also of several functions defined in the namespace `TMVA` that you can call directly from the ROOT prompt or from a compiled program in batch.  
For example you can do this for the output distribution plot obtained from the tutorial `TMVAClassification.C`.

```auto
root -b 
root [0] gSystem->Load("libTMVAGui");
root [1] TMVA::mvas("dataset","TMVA.root");
root [2] canvas1->SaveAs("canvas1.pdf"); // save first canvas in a file

```

and in a similar way you can call the other functions defined in TMVAGUI. See the `tmva/tmvagui/inc/TMVA` and `tmva/tmvagui/src` directories for the list of available functions

Lorenzo

---

<div class="post-metadata">

**Author:** ![zoso](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/z/bcef8e/32.png) [@zoso](https://root-forum.cern.ch/u/zoso)\
**Post date:** [November 25, 2020, 2:44pm UTC](https://root-forum.cern.ch/t/tmva-output-plots-without-using-gui/42423/4 "2020-11-25T14:44:43Z")

</div>

Hi moneta,

thanks for you reply. Actually the “-b” flag is the solution for my problem, I completely forgot that.

Thanks again!
