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.
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 theax
interface, for example here: https://github.com/TUDelft-CITG/OpenCLSim/blob/master/openclsim/plot.py#L714All references to
plt.
, except forplt.subplots()
should be replaced with the corresponding axes function. For exampleplt.title('title')
should becomeax.set_title('title')
. The problem is thatplt
uses the concept of a current figure, which changes whenplt.subplots
is called twice in two different requests.