[chronojump] load Cairo library in sprint and MIF



commit 069c15aeafbf5863df81bb3b1c06b9c1aae00e0f
Author: Xavier Padullés <x padulles gmail com>
Date:   Mon May 29 10:36:33 2017 +0200

    load Cairo library in sprint and MIF

 r-scripts/maximumIsometricForce.R |    4 +++-
 r-scripts/sprintUtil.R            |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/r-scripts/maximumIsometricForce.R b/r-scripts/maximumIsometricForce.R
index 8ea3cf2..a314fd5 100644
--- a/r-scripts/maximumIsometricForce.R
+++ b/r-scripts/maximumIsometricForce.R
@@ -23,8 +23,10 @@
 
 prepareGraph <- function(os, pngFile, width, height)
 {
-        if(os == "Windows")
+        if(os == "Windows"){
+                library("Cairo")
                 Cairo(width, height, file = pngFile, type="png", bg="white")
+        }
         else
                 png(pngFile, width=width, height=height)
         #pdf(file = "/tmp/maxIsomForce.pdf", width=width, height=height)
diff --git a/r-scripts/sprintUtil.R b/r-scripts/sprintUtil.R
index b8aeeff..d8c96d6 100644
--- a/r-scripts/sprintUtil.R
+++ b/r-scripts/sprintUtil.R
@@ -93,8 +93,10 @@ splitTime <- function(Vmax, K, position, tolerance = 0.001, initTime = 1)
 
 prepareGraph <- function(os, pngFile, width, height)
 {
-       if(os == "Windows")
+       if(os == "Windows"){
+               library("Cairo")
                Cairo(width, height, file = pngFile, type="png", bg="white")
+       }
        else
                png(pngFile, width=width, height=height)
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]