[chronojump] ForcePosition doesn't plot the graph by default
- From: Xavier Padullés <xpadulles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] ForcePosition doesn't plot the graph by default
- Date: Mon, 24 Feb 2020 10:31:57 +0000 (UTC)
commit 7e4a222f741e0a7f4028b3d7b81cca31f1ea76c5
Author: Xavier Padullés <x padulles gmail com>
Date: Mon Feb 24 11:17:14 2020 +0100
ForcePosition doesn't plot the graph by default
r-scripts/forcePosition.R | 43 +++++++++++++++++++++++--------------------
1 file changed, 23 insertions(+), 20 deletions(-)
---
diff --git a/r-scripts/forcePosition.R b/r-scripts/forcePosition.R
index d7162ba1..6ee603ae 100644
--- a/r-scripts/forcePosition.R
+++ b/r-scripts/forcePosition.R
@@ -6,7 +6,8 @@ getDynamicsFromForceSensor <- function(file = "/home/xpadulles/.local/share/Chro
stiffness = 71.93, #71.93 N/m measured in the black rubber
angle = 0,
smooth = 5,
- conMinDisplacement = 0.1, eccMinDisplacement = 0.1
+ conMinDisplacement = 0.1, eccMinDisplacement = 0.1,
+ plotGraph = FALSE
)
{
forceSensor = read.csv(file, sep =";", dec = ",", header = TRUE)
@@ -74,25 +75,27 @@ getDynamicsFromForceSensor <- function(file = "/home/xpadulles/.local/share/Chro
#Getting the basic information of each repetition
repetitions = getRepetitions(dynamics[, "time"], dynamics[, "position"], dynamics[, "rawForce"],
conMinDisplacement, eccMinDisplacement)
- #commented because the graph is shown on getRepetitions
- # plot(#dynamics[, "time"]
- # dynamics[, "position"]
- # , type = "l", xlab = "Time", ylab = "Position"
- #,xlim = c(50, 150)
- #, ylim = c(0.25,1.1)
- #, axes = F
- # )
-
- # plot(position2, type = "l")
- # lines(dynamics[, "time"], dynamics[, "position2"], col = "grey")
-
- points(#dynamics[repetitions$extremesSamples, "time"],
- repetitions$extremesSamples,
- dynamics[repetitions$extremesSamples,"position"])
- text(repetitions$extremesSamples, dynamics[repetitions$extremesSamples,"position"], pos =4
- #, paste("(", round(dynamics[repetitions$extremesSamples, "time"], digits = 4), ", ",
round(dynamics[repetitions$extremesSamples,"position"], digits = 4), ")", sep="")
- , paste("(",repetitions$extremesSamples, ", ",
round(dynamics[repetitions$extremesSamples,"position"], digits = 2), ")", sep=""), cex = 0.66
- )
+ if(plotGraph == TRUE){
+ plot(#dynamics[, "time"]
+ dynamics[, "position"]
+ , type = "l", xlab = "Time", ylab = "Position"
+ #,xlim = c(50, 150)
+ #, ylim = c(0.25,1.1)
+ #, axes = F
+ )
+
+ # plot(position2, type = "l")
+ # lines(dynamics[, "time"], dynamics[, "position2"], col = "grey")
+
+ points(#dynamics[repetitions$extremesSamples, "time"],
+ repetitions$extremesSamples,
+ dynamics[repetitions$extremesSamples,"position"])
+ text(repetitions$extremesSamples, dynamics[repetitions$extremesSamples,"position"], pos =4
+ #, paste("(", round(dynamics[repetitions$extremesSamples, "time"], digits = 4), ", ",
round(dynamics[repetitions$extremesSamples,"position"], digits = 4), ")", sep="")
+ , paste("(",repetitions$extremesSamples, ", ",
round(dynamics[repetitions$extremesSamples,"position"], digits = 2), ")", sep=""), cex = 0.66
+
+ )
+ }
return(list(
time=dynamics[,"time"],
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]