TUDelft-CITG / OpenCLSim

Rule driven scheduling of cyclic activities for in-depth comparison of alternative operating strategies.
https://openclsim.readthedocs.io
MIT License
14 stars 17 forks source link

When two requests are fired at the same time plots are mixed #70

Closed SiggyF closed 5 years ago

SiggyF commented 5 years ago

Summary

Description

When requesting energy plot and equipment plot at the same time the plots are mixed up (line of energy use appears in equipment plot).

Request both url's at the same time: http://openclsim.westeurope.azurecontainer.io:5000/equipment_plot http://openclsim.westeurope.azurecontainer.io:5000/energy_plot

This is due to the pyplot interface being used instead of the ax interface, for example here: https://github.com/TUDelft-CITG/OpenCLSim/blob/master/openclsim/plot.py#L714

All references to plt., except for plt.subplots() should be replaced with the corresponding axes function. For example plt.title('title') should become ax.set_title('title'). The problem is that plt uses the concept of a current figure, which changes when plt.subplots is called twice in two different requests.

uijl commented 5 years ago

This should be fixed with #72.