blockpy-edu / blockpy

Blockly that's more Python than JavaScript, powered with Skulpt
Apache License 2.0
391 stars 130 forks source link

Matplot can't show multiple bar graphs on one chart #117

Open thomaswp opened 1 year ago

thomaswp commented 1 year ago

BlockPy helpfully supports multiple line plots on the same canvas; however this does not work with bar plots:

import matplotlib.pyplot as plt

plt.bar([0.5, 1.5, 2.5], [5, 8, 2], width=0.5)
plt.bar([0, 1, 2], [2, 3, 2], width=0.5)
plt.show()

produces

image

rather than why Python would generate:

image

I'm guessing that this has something to do with the JS implementation of Matplot? Some students wanted to create comparative barcharts, so it's nice to be able to do.

thomaswp commented 1 year ago

Sounds like maybe you're using jsplotlib under the hood? If so, it may be fixed with an update.

thomaswp commented 1 year ago

Confirmed this is still present on the UDel instance.