blob: 257ad8d9152a760ecaed785a641215c870ec8df9 [file] [log] [blame]
Jeremy Ronquillodae11042018-02-21 09:21:44 -08001# Copyright 2017 Open Networking Foundation (ONF)
2#
3# Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
4# the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
5# or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
6#
7# TestON is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 2 of the License, or
10# (at your option) any later version.
11#
12# TestON is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with TestON. If not, see <http://www.gnu.org/licenses/>.
19#
20# If you have any questions, or if you don't understand R,
21# please contact Jeremy Ronquillo: j_ronquillo@u.pacific.edu
22
23imageWidth <- 15
24imageHeight <- 10
25imageDPI <- 200
26
27saveGraph <- function( outputFile ){
28 print( paste( "Saving result graph to", outputFile ) )
29
30 tryCatch( ggsave( outputFile,
31 width = imageWidth,
32 height = imageHeight,
33 dpi = imageDPI ),
34 error = function( e ){
35 print( "[ERROR]: There was a problem saving the graph due to a graph formatting exception. Error dump:" )
36 print( e )
37 quit( status = 1 )
38 }
39 )
40
41 print( paste( "[SUCCESS]: Successfully wrote result graph out to", outputFile ) )
42}