Plotting 3D Polygons in python-matplotlib

I was unsuccessful browsing web for a solution for the following simple question: How to draw 3D polygon (say a filled rectangle or triangle) using vertices values? I have tried many ideas but all failed, see: from mpl_toolkits.mplot3d import Axes3D from matplotlib.collections import PolyCollection import matplotlib.pyplot as plt fig = plt.figure() ax = Axes3D(fig) x … Read more

How to set xlim and ylim for a subplot in matplotlib

I would like to limit the X and Y axis in matplotlib for a specific subplot. The subplot figure itself doesn’t have any axis property. I want for example to change only the limits for the second plot: import matplotlib.pyplot as plt fig=plt.subplot(131) plt.scatter([1,2],[3,4]) fig=plt.subplot(132) plt.scatter([10,20],[30,40]) fig=plt.subplot(133) plt.scatter([15,23],[35,43]) plt.show() Answers: Thank you for visiting the … Read more