Advertisement

test


import matplotlib.pyplot as plt import matplotlib.patches as patches # Define plot dimensions fig, ax = plt.subplots(figsize=(10, 12)) # Set plot limits ax.set_xlim(0, 100) ax.set_ylim(0, 120) # Draw floors as rectangles for i in range(4): floor_bottom = i * 30 floor_top = floor_bottom + 30 # Draw Small Unit ax.add_patch(patches.Rectangle((10, floor_bottom), 20, 30, edgecolor='black', facecolor='lightblue', lw=2)) ax.text(20, floor_bottom + 15, 'Small Unit', ha='center', va='center', fontsize=12, color='black') # Draw 3-Bedroom Unit ax.add_patch(patches.Rectangle((30, floor_bottom), 60, 30, edgecolor='black', facecolor='lightgreen', lw=2)) ax.text(60, floor_bottom + 15, '3-Bedroom Unit', ha='center', va='center', fontsize=12, color='black') # Annotate important areas on the ground floor ax.text(15, 5, 'Entrance & Parking', fontsize=10) ax.text(50, 15, 'Living Room & Dining', fontsize=10, ha='center') ax.text(85, 15, 'Kitchen', fontsize=10, ha='right') ax.text(50, 25, 'Bedrooms', fontsize=10, ha='center') # Add a staircase ax.add_patch(patches.Rectangle((5, 0), 5, 120, edgecolor='black', facecolor='lightgrey', lw=2)) ax.text(2.5, 60, 'Staircase', ha='center', va='center', rotation=90, fontsize=10) # Add labels plt.title('4-Storied Building Layout on 5.34 Satak Plot', fontsize=14) plt.xlabel('Width (ft)') plt.ylabel('Height (ft)') # Show plot plt.grid(False) plt.gca().set_aspect('equal', adjustable='box') plt.show()

Post a Comment

0 Comments