python - Drawing rectangular grid using matplotlib -
is there easy way in python using pyplot (matplotlib) create rectangular grid (like this, perhaps gridded) this:
i pretty new python, , there may simple solution this, have been unable find it.
thanks in advance.
it's not clear details you're going here's start...
import matplotlib.pyplot plt ax = plt.subplot(1, 1, 1) ax.spines['left'].set_position('zero') ax.spines['right'].set_color('none') ax.spines['bottom'].set_position('zero') ax.spines['top'].set_color('none') ax.spines['left'].set_smart_bounds(true) ax.spines['bottom'].set_smart_bounds(true) ax.xaxis.set_ticks_position('bottom') ax.yaxis.set_ticks_position('left') ax.set_xticks(range(-5, 6)) ax.set_yticks(range(-5, 6)) ax.set_xlim((-5.5, 5.5)) ax.set_ylim((-5.5, 5.5)) ax.grid() plt.show()
Comments
Post a Comment