Add textboxes

This commit is contained in:
Cal W
2023-04-02 21:40:43 +10:00
parent e6bfabe80a
commit d9c4836038
3 changed files with 43 additions and 11 deletions

31
main.py
View File

@@ -45,8 +45,6 @@ if __name__ == "__main__":
"figTitle": f"Strain over Time (Runs {i+1} to {i+4})",
"figTitleFontSize": 16,
"figSize": (8,8), #Yay America, this is in inches :/ # Note: cm = 1/2.54
"xLabel": "x label",
"yLabel": "y label",
"plotDim": (2,2),
"subPlots":[]
}
@@ -54,10 +52,11 @@ if __name__ == "__main__":
for ii in range(i*4, 4 + i*4):
data1, data2 = makeActualDataGraph(ii)
newPlot = {
"title": f"Run: {ii+1}",
"xLabel": "Time (ms) - Δt = 10ms",
"yLabel": "Strain (ε)",
"plots":[
"title": f"Run {ii+1}",
"xLabel": "Time (ms)",
"yLabel": "Strain (ε)" if ii % 2 == 0 else "",
"plots": [
{"type": "text", "text": "Δt = 10ms", "x":0.99, "y":0.03, "align":("bottom", "right")},
{"type":"scatter", "x": data1["Time"], "y": data1["Strain"], "args":{"s":10, "zorder":2}, "label":"Upper", "colour": UQC["purple"]},
{"type":"scatter", "x": data2["Time"], "y": data2["Strain"], "args":{"s":10, "zorder":1}, "label":"Lower", "colour": UQC["dark_grey"]},
{"type":"plot", "x": data1["Time"], "y": data1["Strain"], "args":{"zorder":0, "alpha":0.25}, "colour": UQC["purple"]},
@@ -66,8 +65,24 @@ if __name__ == "__main__":
}
graphData["subPlots"].append(newPlot)
fig, _ = makeGraph(graphData, showPlot=False)
fig.savefig(f"./images/actualData_Runs_{i+1}-_{i+4}")
fig, ax = makeGraph(graphData, showPlot=False)
fig.savefig(f"./images/actualData_Runs_{i+1}-_{i+4}.png")
# Initial test Data
data1, data2 = makeActualDataGraph(8)
graphData = {
"title": f"Initial Test Data\n\"Run 0\"",
"xLabel": "Time (ms) - Δt = 10ms",
"yLabel": "Strain (ε)",
"plots":[
{"type":"scatter", "x": data1["Time"], "y": data1["Strain"], "args":{"s":10, "zorder":2}, "label":"Upper", "colour": UQC["purple"]},
{"type":"scatter", "x": data2["Time"], "y": data2["Strain"], "args":{"s":10, "zorder":1}, "label":"Lower", "colour": UQC["dark_grey"]},
{"type":"plot", "x": data1["Time"], "y": data1["Strain"], "args":{"zorder":0, "alpha":0.25}, "colour": UQC["purple"]},
{"type":"plot", "x": data2["Time"], "y": data2["Strain"], "args":{"zorder":0, "alpha":0.25}, "colour": UQC["dark_grey"]},
]
}
fig, _ = makeGraph(graphData)
fig.savefig("./images/initTestData.png")
# Calibration Data