Install Xgraph : sudo apt install Xgraph → You get a stable version 12.1 .
Testing Xgraph :
$ cd xvf ns-allinone-2.35/xgraph-12.2/examples/ && xgraph xgtest.xg .. And please note that 'xgraph' requires a file to open the "Xgraph GUI". I.e. $ xgraph does nothing.
"Permission denied" is a common error : If ns-allinone-2.xx was unpacked with 'sudo', or with a Windows© tool. Correct is :
$ tar xvf ns-allinone-2.35_gcc5.tar.gz
ns-allinone-2.35_gcc5.tar.gz, link https://drive.google.com/file/d/0B7S255p3kFXNVVlxR0ZNRGVORjQ/view?usp=sharing → This is the 2014 update, for gcc/g++ versions 4.4 .. 5.3 .
ns2-INFO https://drive.google.com/file/d/1FCjn-9fkR7tKeqClUpHsleaEdnoKRZzq/view?usp=sharing