-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
This program
import schemdraw
import schemdraw.elements as elm
def capacitor() -> schemdraw.Drawing:
with schemdraw.Drawing(show=False) as d:
d += elm.Capacitor()
return d
def tline() -> schemdraw.Drawing:
with schemdraw.Drawing(show=False) as d:
d += elm.Coax()
return d
def main() -> None:
with schemdraw.Drawing() as d:
d += elm.ElementDrawing(capacitor())
d += elm.ElementDrawing(tline())
d.draw()
if __name__ == "__main__":
main()
causes three plots to appear. One plot shows a capacitor, one shows a transmission line, and one shows a capacitor connected to a transmission line. Then, if I close them, a fourth plot appears, again showing a capacitor connected to a transmission line.
I see this as unexpected behavior. I would have thought that, because I have show=False in the sub-drawings, I would see only one plot.
If we change main to be this
def main() -> None:
d = capacitor()
d.draw()
then one plot appears, showing a capacitor, and when I close it a second plot appears, also showing a capacitor.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels