# Draw circuit schematic in pure Julia

**URL:** <https://discourse.julialang.org/t/draw-circuit-schematic-in-pure-julia/126592>\
**Category:** Visualization\
**Tags:** plotting, makie, quantum-circuits\
**Created:** [March 5, 2025, 7:15pm UTC](https://discourse.julialang.org/t/draw-circuit-schematic-in-pure-julia/126592 "2025-03-05T19:15:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![albertomercurio](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albertomercurio/32/27051_2.png) [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Post date:** [March 5, 2025, 7:15pm UTC](https://discourse.julialang.org/t/draw-circuit-schematic-in-pure-julia/126592/1 "2025-03-05T19:15:56Z")

</div>

Hello,

I need to draw some circuit schematic like the following

 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/d/dd43d224b3cd167f8c42841ea9ea6708c6fa0104.png)

And then embedding this schematic in my plots made with Makie.jl

The current approaches I have investigated so far are **circuitkz** and **schemdraw**. The first is directly embedded in latex, but I find it very difficult but also not so fancy as the image above. The second is a python package, which I’m still exploring now.

However, while I was trying schemdraw, I was thinking if this can be seamlessly done directly in Julia, maybe also directly using Makie.jl functions. But I don’t know if the amount of work to do worth it.

---

<div class="post-metadata">

**Author:** ![albertomercurio](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albertomercurio/32/27051_2.png) [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Post date:** [March 6, 2025, 6:04pm UTC](https://discourse.julialang.org/t/draw-circuit-schematic-in-pure-julia/126592/2 "2025-03-06T18:04:47Z")

</div>

In other words, how would you suggest to structure this possible package?

Should I define specific `struct`s for Resistor, Capacitor, etc…, like in **schemdraw**? What should they contain? Like the `poly` object and what else?

Moreover, how should I manage the package dependencies? Should all CairoMakie.jl, GLMakie.jl, WGLMakie.jl be direct dependencies of the package? This would make it very heavy I think.

Finally, should I use Makie.jl’s recipes?

---

<div class="post-metadata">

**Author:** ![sgaure](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sgaure/32/14779_2.png) [@sgaure](https://discourse.julialang.org/u/sgaure)\
**Post date:** [March 6, 2025, 6:30pm UTC](https://discourse.julialang.org/t/draw-circuit-schematic-in-pure-julia/126592/3 "2025-03-06T18:30:25Z")

</div>

You could perhaps take a look at this one, which is somewhat similar:

> [@\[ANN\] DeviceLayout.jl - CAD for quantum integrated circuits (and more?)](https://discourse.julialang.org/t/ann-devicelayout-jl-cad-for-quantum-integrated-circuits-and-more/126502/1):
>
> Hello! DeviceLayout.jl is a new package for computer-aided design of superconducting quantum integrated circuits, developed at the AWS Center for Quantum Computing. The package supports the generation of 2D layouts and 3D models of complex devices using a low-level geometry interface together with a high-level schematic-driven workflow. It’s a successor to PainterQubits/Devices.jl that began as a fork when its primary author joined the AWS CQC. You can learn more by checking out [the docs](https://aws-cqc.github.io/DeviceLayout.jl/), includ…

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [March 6, 2025, 6:55pm UTC](https://discourse.julialang.org/t/draw-circuit-schematic-in-pure-julia/126592/4 "2025-03-06T18:55:01Z")

</div>

Likely will have some overlap with:

> **[GitHub - bradcarman/ModelingToolkitDesigner.jl: A helper tool for visualizing and editing a...](https://github.com/bradcarman/ModelingToolkitDesigner.jl)**
>
> A helper tool for visualizing and editing a ModelingToolkit.jl system connections

 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/e/3e7a344b6029b0c2a48978077b330b8e442ebb8d.jpeg)

---

<div class="post-metadata">

**Author:** ![albertomercurio](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albertomercurio/32/27051_2.png) [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Post date:** [March 7, 2025, 5:52pm UTC](https://discourse.julialang.org/t/draw-circuit-schematic-in-pure-julia/126592/5 "2025-03-07T17:52:18Z")

</div>

Wow, this package seems very advanced. But it seems more in the design rather than generic schematic like the figure I have attached. In other words, can this package reproduce an image similar to that?

---

<div class="post-metadata">

**Author:** ![albertomercurio](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albertomercurio/32/27051_2.png) [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Post date:** [March 7, 2025, 5:53pm UTC](https://discourse.julialang.org/t/draw-circuit-schematic-in-pure-julia/126592/6 "2025-03-07T17:53:07Z")

</div>

Thank you for citing this package. I think however that the style is different from the image I have attached before.

---

<div class="post-metadata">

**Author:** ![gpeairs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gpeairs/32/44414_2.png) [@gpeairs](https://discourse.julialang.org/u/gpeairs)\
**Post date:** [March 10, 2025, 3:16pm UTC](https://discourse.julialang.org/t/draw-circuit-schematic-in-pure-julia/126592/7 "2025-03-10T15:16:36Z")

</div>

You’re right that DeviceLayout.jl is oriented more towards physical layout/design than circuit schematic drawings. You could use it to draw a schematic like this by defining components like Resistor, composite components combining them in parallel, and so on, but I wouldn’t really recommend it. (I actually prototyped a kit for drawings like this with DeviceLayout.jl but ultimately preferred circuitikz for this use case. You can definitely draw your example in circuitikz, but it’s true that there’s a learning curve.) It’s not graphics-oriented, so for example the color fill on the transmission line would be especially tedious to define. To me the major limitation is that we don’t have support for nice TeX labels like in your example. (Although maybe if we had a Makie backend…)
