Untitled

 avatar
unknown
plain_text
a year ago
1.1 kB
4
Indexable
import matplotlib.pyplot as plt
import matplotlib.patches as patches

fig, ax = plt.subplots()

# Draw the resistors and connecting wires
ax.add_patch(patches.Rectangle((0.1, 0.6), 0.3, 0.1, fill=None, edgecolor='black'))  # First resistor
ax.add_patch(patches.Rectangle((0.6, 0.6), 0.3, 0.1, fill=None, edgecolor='black'))  # Second resistor
ax.add_patch(patches.Rectangle((1.1, 0.6), 0.3, 0.1, fill=None, edgecolor='black'))  # Third resistor

# Connecting wires
plt.plot([0, 0.1], [0.65, 0.65], color='black')  # Left wire
plt.plot([0.4, 0.6], [0.65, 0.65], color='black')  # Wire between first and second resistor
plt.plot([0.9, 1.1], [0.65, 0.65], color='black')  # Wire between second and third resistor
plt.plot([1.4, 1.5], [0.65, 0.65], color='black')  # Right wire

# Labels for resistors
plt.text(0.2, 0.65, '23 Ω', verticalalignment='center', horizontalalignment='center')
plt.text(0.7, 0.65, '25 Ω', verticalalignment='center', horizontalalignment='center')
plt.text(1.2, 0.65, '5 Ω', verticalalignment='center', horizontalalignment='center')

# Additional circuit elements
plt.plot([0
Editor is loading...
Leave a Comment