Skip to content

Instantly share code, notes, and snippets.

@Samshal
Created April 21, 2026 05:48
Show Gist options
  • Select an option

  • Save Samshal/1123673786f77478bc0dd6d369696fec to your computer and use it in GitHub Desktop.

Select an option

Save Samshal/1123673786f77478bc0dd6d369696fec to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
import numpy as np
length, width = 10, 8 # metres
fig, ax = plt.subplots(figsize=(8, 6))
ax.set_xticks(np.arange(0, length+1, 1))
ax.set_yticks(np.arange(0, width+1, 1))
ax.grid(True)
ax.plot([0, length, length, 0, 0], [0, 0, width, width, 0], linewidth=2)
ax.set_xlabel("Length (m)")
ax.set_ylabel("Width (m)")
ax.set_xlim(0, length); ax.set_ylim(0, width)
ax.set_aspect('equal', adjustable='box')
plt.title("Office Floor Plan Template")
plt.savefig("office_floorplan_template.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment