Skip to content

Commit

Permalink
fixing empty plot when no bouts detected problem
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviermirat committed Jan 30, 2025
1 parent f6f6ef7 commit d1e16d0
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion zebrazoom/code/GUI/GUI_InitialClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -1749,10 +1749,25 @@ def showGraphForAllBoutsCombined(self, numWell, numPoiss, dataRef, visualization

headXFinal = []
headYFinal = []
if len(dataRef["wellPoissMouv"][numWell][numPoiss]) == 0:
try:
from zebrazoom.dataAPI.getDataPerTimeInterval import getDataPerTimeInterval
HeadPos = getDataPerTimeInterval(self.currentResultFolder, numWell, numPoiss, None, None, "HeadPos")
headXFinal.extend([HeadPos[0][0]])
headYFinal.extend([HeadPos[0][1]])
except Exception as e:
print(f"An error occurred: {e}")
except KeyboardInterrupt: # Allow manual interruption (CTRL+C)
print("Program interrupted by user!")
except SystemExit:
print("System exit requested!")
for numMouv in range(0, len(dataRef["wellPoissMouv"][numWell][numPoiss])):
headXFinal.extend(dataRef["wellPoissMouv"][numWell][numPoiss][numMouv]["HeadX"])
headYFinal.extend(dataRef["wellPoissMouv"][numWell][numPoiss][numMouv]["HeadY"])
plt.plot(headXFinal, headYFinal)
if len(dataRef["wellPoissMouv"][numWell][numPoiss]) == 0:
plt.plot(headXFinal, headYFinal, 'o')
else:
plt.plot(headXFinal, headYFinal)
if not(graphScaling):
plt.xlim(0, dataRef["wellPositions"][numWell]["lengthX"])
plt.ylim(dataRef["wellPositions"][numWell]["lengthY"], 0)
Expand Down

1 comment on commit d1e16d0

@oliviermirat
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2

  • in GUI video visualization fixing empty plot when no bouts detected problem

Please sign in to comment.