[chronojump] Power-Load graph advertizing in inverted parabole
- From: Xavier Padullés <xpadulles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Power-Load graph advertizing in inverted parabole
- Date: Thu, 11 Nov 2021 10:13:20 +0000 (UTC)
commit 916b6474554f8a400dc277a09df4dc171c331fb3
Author: Xavier Padullés <x padulles gmail com>
Date: Thu Nov 11 11:10:38 2021 +0100
Power-Load graph advertizing in inverted parabole
encoder/graph.R | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index ba9adb684..cccdd3f5a 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -2048,10 +2048,17 @@ paintCrossVariables <- function (paf, varX, varY, option,
round(xmax,1), " ", massUnit, sep="")
#do not show pmax because it can go out of graph, just show
in the legend
#text(xmax, pmax, label = paste("Pmax=", round(pmax,1),
"W*"), pos = 3, col = "red")
- legend(x = par("usr")[2], y = par("usr")[4]-(par("usr")[4] -
par("usr")[3])*0.1,
- legend = c(paste("Pmax = ", round(pmax,1), "W",
sep=""),
- paste("Load: ", round(xmax,1), massUnit,
sep = "")),
- xjust = 1, text.col = c("red", "black"), cex = 1.3)
+ if (coef.a < 0){
+ legend(x = par("usr")[2], y =
par("usr")[4]-(par("usr")[4] - par("usr")[3])*0.1,
+ legend = c(paste("Pmax = ", round(pmax,1),
"W", sep=""),
+ paste("Load: ", round(xmax,1),
massUnit, sep = "")),
+ xjust = 1, text.col = c("red", "black"), cex
= 1.3)
+ } else {
+ legend(x = par("usr")[2], y =
par("usr")[4]-(par("usr")[4] - par("usr")[3])*0.1,
+ legend = c("Data not fitted to expected
parabole",
+ "Middle points too low"),
+ xjust = 1, text.col = c("red", "red"), cex =
1.3)
+ }
mtext(text = paste("*", translateToPrint("Mean power
parabole using the Power-Load data"), sep=""), side = 4, line = 4)
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]