Electrical Elements¶
Two-Terminal Elements¶
Two-terminal element definitions
- class schemdraw.elements.twoterm.Breaker(*, dots=None, **kwargs)¶
Circuit breaker
- Keyword Arguments:
dots – Show connection dots
arc_lw – Line width of breaker arc
arc_color – Color of breaker arc
- class schemdraw.elements.twoterm.CPE(*args, **kwargs)¶
Constant Phase Element
- class schemdraw.elements.twoterm.Capacitor(*, polar=None, **kwargs)¶
- Parameters:
polar (
Optional[bool]) – Add polarity + sign
- class schemdraw.elements.twoterm.Capacitor2(*, polar=None, **kwargs)¶
Capacitor (curved bottom plate)
- Parameters:
polar (
Optional[bool]) – Add polarity + sign
- class schemdraw.elements.twoterm.CapacitorTrim(*args, **kwargs)¶
Trim capacitor
- Keyword Arguments:
trim_lw – Line width of trim
trim_color – Color of trim
- class schemdraw.elements.twoterm.CapacitorVar(*args, **kwargs)¶
Variable capacitor
- Keyword Arguments:
arrowwidth – Width of arrowhead
arrowlength – Length of arrowhead
arrow_lw – Line width of arrow
arrow_color – Color of arrow
- class schemdraw.elements.twoterm.Crystal(*args, **kwargs)¶
Crystal oscillator
- class schemdraw.elements.twoterm.CurrentMirror(*args, **kwargs)¶
Current mirror with optional common terminal
- Anchors:
scommon
- class schemdraw.elements.twoterm.Diac(*args, **kwargs)¶
Diac (diode for alternating current)
- class schemdraw.elements.twoterm.Diode(*args, **kwargs)¶
- class schemdraw.elements.twoterm.DiodeShockley(*args, **kwargs)¶
Shockley Diode
- class schemdraw.elements.twoterm.DiodeTVS(*args, **kwargs)¶
Transient-Voltage Suppression (TVS) Diode
- class schemdraw.elements.twoterm.DiodeTunnel(*args, **kwargs)¶
Tunnel Diode
- class schemdraw.elements.twoterm.FuseIEC(*args, **kwargs)¶
Fuse (IEC Style)
- class schemdraw.elements.twoterm.FuseIEEE(*args, **kwargs)¶
Fuse (IEEE Style)
- class schemdraw.elements.twoterm.FuseUS(*, dots=None, **kwargs)¶
Fuse (U.S. Style)
- Parameters:
dots (
Optional[bool]) – Show dots on connections to fuse
- fill(color=True)¶
Set element fill
- Return type:
Element
- class schemdraw.elements.twoterm.Inductor(core=0, **kwargs)¶
- Keyword Arguments:
core – Number of core lines to draw parallel to inductor
core_ls – Line style of core
core_lw – Line width of core
core_color – Color of core
- class schemdraw.elements.twoterm.Inductor2(*, loops=None, core=0, **kwargs)¶
Inductor, drawn as cycloid (loopy)
- Keyword Arguments:
loops – Number of inductor loops [default: 4]
core – Number of core lines to draw parallel to inductor
core_ls – Line style of core
core_lw – Line width of core
core_color – Color of core
- class schemdraw.elements.twoterm.Josephson(*, box=None, **kwargs)¶
Josephson Junction
- Parameters:
box (
Optional[bool]) – Draw a square around the Josephson X symbol
- class schemdraw.elements.twoterm.LED(*args, **kwargs)¶
Light emitting diod
- Keyword Arguments:
arrowwidth – Width of arrowhead
arrowlength – Length of arrowhead
arrow_lw – Line width of arrow
arrow_color – Color of arrow
- class schemdraw.elements.twoterm.LED2(*args, **kwargs)¶
Light emitting diode (curvy light lines)
- Keyword Arguments:
arrowwidth – Width of arrowhead
arrowlength – Length of arrowhead
arrow_lw – Line width of arrow
arrow_color – Color of arrow
- class schemdraw.elements.twoterm.Memristor(*args, **kwargs)¶
Memristor (resistor with memory)
- class schemdraw.elements.twoterm.Memristor2(*args, **kwargs)¶
Memristor (resistor with memory), alternate style
- class schemdraw.elements.twoterm.Norator(*args, **kwargs)¶
- class schemdraw.elements.twoterm.Nullator(*args, **kwargs)¶
This element does not support filling
- class schemdraw.elements.twoterm.Photodiode(*args, **kwargs)¶
Photo-sensitive diode
- Keyword Arguments:
arrowwidth – Width of arrowhead
arrowlength – Length of arrowhead
arrow_lw – Line width of arrow
arrow_color – Color of arrow
- schemdraw.elements.twoterm.Photoresistor¶
alias of
PhotoresistorIEEE
- schemdraw.elements.twoterm.PhotoresistorBox¶
alias of
PhotoresistorIEC
- class schemdraw.elements.twoterm.PhotoresistorIEC(*args, **kwargs)¶
Photo-resistor (European style)
- Keyword Arguments:
arrowwidth – Width of arrowhead
arrowlength – Length of arrowhead
arrow_lw – Line width of arrow
arrow_color – Color of arrow
- class schemdraw.elements.twoterm.PhotoresistorIEEE(*args, **kwargs)¶
Photo-resistor (U.S. style)
- Keyword Arguments:
arrowwidth – Width of arrowhead
arrowlength – Length of arrowhead
arrow_lw – Line width of arrow
arrow_color – Color of arrow
- schemdraw.elements.twoterm.PotBox¶
alias of
PotentiometerIEC
- schemdraw.elements.twoterm.Potentiometer¶
alias of
PotentiometerIEEE
- class schemdraw.elements.twoterm.PotentiometerIEC(*args, **kwargs)¶
Potentiometer (European style)
- Anchors:
tap
- Keyword Arguments:
arrowwidth – Width of arrowhead
arrowlength – Length of arrowhead
tap_length – Length of tap line
- class schemdraw.elements.twoterm.PotentiometerIEEE(*args, **kwargs)¶
Potentiometer (U.S. style)
- Anchors:
tap
- Keyword Arguments:
arrowwidth – Width of arrowhead
arrowlength – Length of arrowhead
tap_length – Length of tap line
- schemdraw.elements.twoterm.RBox¶
alias of
ResistorIEC
- schemdraw.elements.twoterm.RBoxVar¶
alias of
ResistorVarIEC
- schemdraw.elements.twoterm.Resistor¶
alias of
ResistorIEEE
- class schemdraw.elements.twoterm.ResistorIEC(*args, **kwargs)¶
Resistor as box (IEC/European style)
- class schemdraw.elements.twoterm.ResistorIEEE(*args, **kwargs)¶
Resistor (IEEE/U.S. style)
- schemdraw.elements.twoterm.ResistorVar¶
alias of
ResistorVarIEEE
- class schemdraw.elements.twoterm.ResistorVarIEC(*args, **kwargs)¶
Variable resistor (European style)
- Keyword Arguments:
arrowwidth – Width of arrowhead
arrowlength – Length of arrowhead
arrow_lw – Line width of arrow
arrow_color – Color of arrow
- class schemdraw.elements.twoterm.ResistorVarIEEE(*args, **kwargs)¶
Variable resistor (U.S. style)
- Keyword Arguments:
arrowwidth – Width of arrowhead
arrowlength – Length of arrowhead
arrow_lw – Line width of arrow
arrow_color – Color of arrow
- class schemdraw.elements.twoterm.Rshunt(*args, **kwargs)¶
Shunt Resistor
- class schemdraw.elements.twoterm.SCR(*args, **kwargs)¶
Silicon controlled rectifier (or thyristor)
- Anchors:
gate
- class schemdraw.elements.twoterm.Schottky(*args, **kwargs)¶
Schottky Diode
- class schemdraw.elements.twoterm.SparkGap(*args, **kwargs)¶
Spark Gap
- Keyword Arguments:
gap – Width of gap between arrows
arrowwidth – Width of arrowheads
arrowlength – Length of arrowheads
- class schemdraw.elements.twoterm.Thermistor(*args, **kwargs)¶
- class schemdraw.elements.twoterm.Triac(*args, **kwargs)¶
- Anchors:
gate
- class schemdraw.elements.twoterm.Varactor(*args, **kwargs)¶
Varactor Diode/Varicap/Variable Capacitance Diode
- class schemdraw.elements.twoterm.VoltageMirror(*args, **kwargs)¶
Voltage mirror with optional common terminal
This element does not support filling
- Anchors:
scommon
- class schemdraw.elements.twoterm.Zener(*args, **kwargs)¶
Zener Diode
Sources, meters, and lamp elements
- class schemdraw.elements.sources.Battery(*args, **kwargs)¶
- class schemdraw.elements.sources.BatteryCell(*args, **kwargs)¶
Cell
- class schemdraw.elements.sources.BatteryDouble(*args, **kwargs)¶
Double-stack Battery
- class schemdraw.elements.sources.Lamp(*args, **kwargs)¶
Incandescent Lamp
- Keyword Arguments:
filament_lw – Line width of filament
filament_color – Color of filament
- class schemdraw.elements.sources.Lamp2(*args, **kwargs)¶
Incandescent Lamp (with X through a Source)
- Keyword Arguments:
filament_lw – Line width of filament
filament_color – Color of filament
- class schemdraw.elements.sources.MeterA(*args, **kwargs)¶
Ammeter
- class schemdraw.elements.sources.MeterAnalog(inputs=True, needle_percent=70, **kwargs)¶
Analog meter drawn as a box
- Parameters:
inputs (
bool) – Show input connectionsneedle_percent (
float) – Position of the needle along the window from 0 to 100needle_color – Color of the needle
needle_width – Line width of the needle
window_fill – Fill color for window area
input_ofst – (x, y) offset of input connectors
input_lw – Line width of input connector circles
input_rad – Radius of input connector circles
input_fill – Fill color of input connector circles
- class schemdraw.elements.sources.MeterArrow(*args, **kwargs)¶
Meter with diagonal arrow
- Keyword Arguments:
arrowwidth – Width of arrowhead
arrowlength – length of arrowhead
arrow_lw – Line width of arrow
arrow_color – Color of arrow
- class schemdraw.elements.sources.MeterBox(inputs=True, **kwargs)¶
Base class for square meter/scope boxes
- Keyword Arguments:
width – Width and height of square box
corner – Corner radius
input_ofst – Distance from corner to input connections
input_lw – line width of connector circles
input_rad – radius of connector circles
input_fill – Fill coloro of connector circles
- class schemdraw.elements.sources.MeterDigital(inputs=True, **kwargs)¶
Digital meter drawn as a box
- Parameters:
inputs (
bool) – Show input connectionsscreen_fill – Fill color for screen area
screen_lw – Line width of the screen
input_ofst – (x, y) offset of input connectors
input_lw – Line width of input connector circles
input_rad – Radius of input connector circles
input_fill – Fill color of input connector circles
- class schemdraw.elements.sources.MeterI(*args, **kwargs)¶
Current Meter (I)
- class schemdraw.elements.sources.MeterOhm(*args, **kwargs)¶
Ohm meter
- class schemdraw.elements.sources.MeterV(*args, **kwargs)¶
Volt meter
- class schemdraw.elements.sources.Neon(*args, **kwargs)¶
Neon bulb
- class schemdraw.elements.sources.Oscilloscope(signal='none', inputs=True, **kwargs)¶
Oscilloscope drawn as a box
- Parameters:
signal (
str) – Type of signal to display on the screen. ‘sine’, ‘square’, or ‘triangle’inputs (
bool) – Show input connectionsscreen_fill – Fill color for screen area
screen_lw – Line width of the screen
grid – Whether to show grid over the screen
grid_color – Color for the oscope grid
grid_lw – Line width of the grid
signal_lw – Line width of the displayed signal
signal_color – Color of the displayed signal
input_ofst – (x, y) offset of input connectors
input_lw – Line width of input connector circles
input_rad – Radius of input connector circles
input_fill – Fill color of input connector circles
- class schemdraw.elements.sources.Solar(*args, **kwargs)¶
Solar source
- Keyword Arguments:
arrowwidth – Width of arrowhead
arrowlength – length of arrowhead
arrow_lw – Line width of arrow
arrow_color – Color of arrow
- class schemdraw.elements.sources.Source(*args, **kwargs)¶
Generic source element
- class schemdraw.elements.sources.SourceControlled(*args, **kwargs)¶
Generic controlled source
- class schemdraw.elements.sources.SourceControlledI(*args, **kwargs)¶
Controlled current source
- Keyword Arguments:
arrowwidth – Width of arrowhead
arrowlength – length of arrowhead
arrow_lw – Line width of arrow
arrow_color – Color of arrow
- class schemdraw.elements.sources.SourceControlledV(*args, **kwargs)¶
Controlled voltage source
- class schemdraw.elements.sources.SourceI(*args, **kwargs)¶
Current source
- Keyword Arguments:
arrowwidth – Width of arrowhead
arrowlength – length of arrowhead
arrow_lw – Line width of arrow
arrow_color – Color of arrow
- class schemdraw.elements.sources.SourcePulse(*args, **kwargs)¶
Pulse source
- Keyword Arguments:
pulse_lw – Line width of pulse curve
pulse_color – Color of pulse curve
- class schemdraw.elements.sources.SourceRamp(*args, **kwargs)¶
Ramp/sawtooth source
- Keyword Arguments:
ramp_lw – Line width of ramp curve
ramp_color – Color of ramp curve
- class schemdraw.elements.sources.SourceSin(*args, **kwargs)¶
Source with sine
- Keyword Arguments:
sin_lw – Line width of sine curve
sin_color – Color of sine curve
- class schemdraw.elements.sources.SourceSquare(*args, **kwargs)¶
Square wave source
- Keyword Arguments:
square_lw – Line width of square curve
square_color – Color of square curve
- class schemdraw.elements.sources.SourceTriangle(*args, **kwargs)¶
Triangle source
- Keyword Arguments:
tri_lw – Line width of triangle curve
tri_color – Color of triangle curve
- class schemdraw.elements.sources.SourceV(*args, **kwargs)¶
Voltage source
One-terminal Elements¶
One terminal element definitions
- class schemdraw.elements.oneterm.Antenna(*args, **kwargs)¶
- class schemdraw.elements.oneterm.AntennaLoop(*args, **kwargs)¶
Loop antenna (diamond style)
- class schemdraw.elements.oneterm.AntennaLoop2(*args, **kwargs)¶
Loop antenna (square style)
- class schemdraw.elements.oneterm.Ground(*, lead=None, **kwargs)¶
Ground connection
- Keyword Arguments:
lead – Show lead wire [default: True]
- class schemdraw.elements.oneterm.GroundChassis(*args, **kwargs)¶
Chassis ground
- Keyword Arguments:
lead – Show lead wire
- class schemdraw.elements.oneterm.GroundSignal(*, lead=True, **kwargs)¶
Signal ground
- Keyword Arguments:
lead – Show lead wire
- class schemdraw.elements.oneterm.NoConnect(*args, **kwargs)¶
No Connection
- class schemdraw.elements.oneterm.Vdd(*args, **kwargs)¶
Vdd connection
- Keyword Arguments:
lead – Show lead wire
- class schemdraw.elements.oneterm.Vss(*args, **kwargs)¶
Vss connection
- Keyword Arguments:
lead – Show lead wire
Switches¶
Switches and buttons
- class schemdraw.elements.switches.Button(nc=False, contacts=True, **kwargs)¶
Push button switch
- Parameters:
nc (
bool) – Normally closedcontacts (
bool) – Draw contacts as open circles
- class schemdraw.elements.switches.Switch(action=None, contacts=True, nc=False, **kwargs)¶
Toggle Switch
- Parameters:
action (
Optional[Literal['open','close']]) – action arrow (‘open’ or ‘close’)contacts (
bool) – Draw contacts as open circlesnc (
bool) – Draw normally closed contact linearrowwidth – Width of arrowhead
arrowlength – Length of arrowhead
arrow_lw – line width of arrow
arrow_color – Color of arrow
- class schemdraw.elements.switches.SwitchDIP(*, n=3, pattern=None, switchcolor=None, swidth=None, spacing=None, **kwargs)¶
DIP switch
- Parameters:
n (
int) – Number of switchespattern (
Optional[Sequence[bool]]) – Boolean sequence indicating whether each switch is flipped up or downswitchcolor (
Optional[str]) – Fill color for flipped switches [default: #333333]swidth (
Optional[float]) – Width of one switch [default: 0.4]spacing (
Optional[float]) – Spacing between switches [default: 0.2]
- class schemdraw.elements.switches.SwitchDpdt(link=True, contacts=True, **kwargs)¶
Double-pole double-throw switch
- Parameters:
link (
bool) – Show dotted line linking switch leverscontacts (
bool) – Draw contacts as open circles
- Anchors:
p1
p2
t1
t2
t3
t4
- class schemdraw.elements.switches.SwitchDpst(link=True, contacts=True, **kwargs)¶
Double-pole single-throw switch
- Parameters:
link (
bool) – Show dotted line linking switch leverscontacts (
bool) – Draw contacts as open circles
- Anchors:
p1
p2
t1
t2
- class schemdraw.elements.switches.SwitchReed(*args, **kwargs)¶
Reed Switch
- class schemdraw.elements.switches.SwitchRotary(*, n=4, dtheta=None, theta0=None, radius=1, arrowlen=0.75, arrowcontact=0, **kwargs)¶
Rotary Switch
- Parameters:
n (
int) – number of contactsdtheta (
Optional[float]) – angle in degrees between each contacttheta0 (
Optional[float]) – angle in degrees of first contactradius (
float) – radius of switcharrowlen (
float) – length of switch arrowarrowcontact (
int) – index of contact to point to
Values for dtheta and theta will be calculated based on n if not provided.
- Anchors:
P
T[x] for each contact (starting at 1)
- class schemdraw.elements.switches.SwitchSpdt(action=None, contacts=True, **kwargs)¶
Single-pole double throw switch.
- Parameters:
action (
Optional[Literal['open','close']]) – action arrow (‘open’ or ‘close’)contacts (
bool) – Draw contacts as open circles
- Anchors:
a
b
c
- class schemdraw.elements.switches.SwitchSpdt2(action=None, contacts=True, **kwargs)¶
Single-pole double throw switch, throws above and below.
- Parameters:
action (
Optional[Literal['open','close']]) – action arrow (‘open’ or ‘close’)contacts (
bool) – Draw contacts as open circlesarrowwidth – Width of arrowhead
arrowlength – Length of arrowhead
arrow_lw – line width of arrow
arrow_color – Color of arrow
- Anchors:
a
b
c
Lines¶
Lines, Arrows, and Labels
- class schemdraw.elements.lines.Annotate(k=0.75, th1=75, th2=180, arrow='<-', *, arrowlength=None, arrowwidth=None, **kwargs)¶
Draw a curved arrow pointing to at position, ending at to position, with label location at the tail of the arrow (See also Arc3).
- Parameters:
k (
float) – Control point factor. Higher k means tighter curve.th1 (
float) – Angle at which the arc leaves start pointth2 (
float) – Angle at which the arc leaves end pointarrow (
str) – arrowhead specifier, such as ‘->’, ‘<-’, ‘<->’, or ‘-o’arrowlength (
Optional[float]) – Length of arrowhead [default: 0.25]arrowwidth (
Optional[float]) – Width of arrowhead [default: 0.2]
- class schemdraw.elements.lines.Arc2(k=0.5, arrow=None, **kwargs)¶
Arc Element
Use at and to methods to define endpoints.
Arc2 is a quadratic Bezier curve with control point halfway between the endpoints, generating a symmetric ‘C’ curve.
- Parameters:
k (
float) – Control point factor. Higher k means more curvature.arrow (
Optional[str]) – arrowhead specifier, such as ‘->’, ‘<-’, ‘<->’, or ‘-o’
- Anchors:
start end ctrl mid
- class schemdraw.elements.lines.Arc3(k=0.75, th1=0.0, th2=180, arrow=None, *, arrowlength=None, arrowwidth=None, **kwargs)¶
Arc Element
Use at and to methods to define endpoints.
Arc3 is a cubic Bezier curve. Control points are set to extend the curve at the given angle for each endpoint.
- Parameters:
k (
float) – Control point factor. Higher k means tighter curve.th1 (
float) – Angle at which the arc leaves start pointth2 (
float) – Angle at which the arc leaves end pointarrow (
Optional[str]) – arrowhead specifier, such as ‘->’, ‘<-’, ‘<->’, or ‘-o’arrowlength (
Optional[float]) – Length of arrowhead [default: 0.25]arrowwidth (
Optional[float]) – Width of arrowhead [default: 0.2]
- Anchors:
start end center ctrl1 ctrl2
- class schemdraw.elements.lines.ArcLoop(radius=0.6, arrow=None, *, arrowlength=None, arrowwidth=None, **kwargs)¶
Loop Arc
Use at and to methods to define endpoints.
ArcLoop is an arc drawn as part of a circle.
- Parameters:
radius (
float) – Radius of the arcarrow (
Optional[str]) – arrowhead specifier, such as ‘->’, ‘<-’, ‘<->’, or ‘-o’ [default: None]arrowlength (
Optional[float]) – Length of arrowhead [default: 0.25]arrowwidth (
Optional[float]) – Width of arrowhead [default: 0.2]
- Anchors:
start end mid BL BR TL TR
- class schemdraw.elements.lines.ArcN(k=0.75, arrow=None, *, arrowlength=None, arrowwidth=None, **kwargs)¶
N-Curve Arc
Use at and to methods to define endpoints.
ArcN approaches the endpoints vertically, leading to a ‘N’ shaped curve
- Parameters:
k (
float) – Control point factor. Higher k means tighter curve.arrow (
Optional[str]) – arrowhead specifier, such as ‘->’, ‘<-’, ‘<->’, or ‘-o’ [default: None]arrowlength (
Optional[float]) – Length of arrowhead [default: 0.25]arrowwidth (
Optional[float]) – Width of arrowhead [default: 0.2]
- class schemdraw.elements.lines.ArcZ(k=0.75, arrow=None, *, arrowlength=None, arrowwidth=None, **kwargs)¶
Z-Curve Arc
Use at and to methods to define endpoints.
ArcZ approaches the endpoints horizontally, leading to a ‘Z’ shaped curve
- Parameters:
k (
float) – Control point factor. Higher k means tighter curve.arrow (
Optional[str]) – arrowhead specifier, such as ‘->’, ‘<-’, ‘<->’, or ‘-o’ [default: None]arrowlength (
Optional[float]) – Length of arrowhead [default: 0.25]arrowwidth (
Optional[float]) – Width of arrowhead [default: 0.2]
- class schemdraw.elements.lines.Arrow(*, double=False, arrowwidth=None, arrowlength=None, **kwargs)¶
- Parameters:
double (
bool) – Show arrowhead on both ends- Keyword Arguments:
arrow – arrowhead specifier, such as ‘->’, ‘<-’, ‘<->’, ‘-o’, or ‘|->’
arrowwidth – Width of arrow head [default: 0.15]
arrowlength – Length of arrow head [default: 0.25]
- class schemdraw.elements.lines.Arrowhead(*args, **kwargs)¶
- Parameters:
headwidth – width of arrow head [default: .15]
headlength – length of arrow head [default: .25]
- class schemdraw.elements.lines.CurrentLabel(*, length=None, top=None, reverse=None, ofst=None, headlength=None, headwidth=None, **kwargs)¶
Current label arrow drawn above an element
Use .at() method to place the label over an existing element.
- Parameters:
reverse (
Optional[bool]) – Reverse the arrow directionofst (
Optional[float]) – Offset distance from centerline of element [default: 0.4]length (
Optional[float]) – Length of the arrow [default: 2]top (
Optional[bool]) – Draw arrow on top or bottom of element [default: True]headlength (
Optional[float]) – Length of arrowhead [default: 0.3]headwidth (
Optional[float]) – Width of arrowhead [default: 0.2]
- at(xy, dx=0, dy=0)¶
Specify CurrentLabel position.
If xy is an Element, arrow will be centered along element and its color will also be inherited.
- Parameters:
xy (XY | tuple[‘Element’, str]) – The absolute (x, y) position or an
over (Element instance to center the arrow)
- Return type:
Element
- class schemdraw.elements.lines.CurrentLabelInline(direction='in', ofst=0.8, start=True, *, headlength=None, headwidth=None, **kwargs)¶
Current direction arrow, inline with element.
Use .at() method to place arrow on an Element instance
- Parameters:
direction (
Literal['in','out']) – arrow direction ‘in’ or ‘out’ of elementofst (
float) – Offset along lead lengthstart (
bool) – Arrow at start or end of elementheadlength (
Optional[float]) – Length of arrowhead [default: 0.3]headwidth (
Optional[float]) – Width of arrowhead [default: 0.3]
- at(xy)¶
Specify CurrentLabelInline position.
If xy is an Element, arrow will be placed along the element’s leads and the arrow color will be inherited.
- Parameters:
xy (XY | Element) – The absolute (x, y) position or an
on (Element instance to place the arrow)
- Return type:
Element
- class schemdraw.elements.lines.DataBusLine(*args, **kwargs)¶
Straight Line with bus indication stripe
- class schemdraw.elements.lines.Dot(*, radius=None, open=None, **kwargs)¶
Connection Dot
- Keyword Arguments:
radius – Radius of dot [default: 0.075]
open – Draw as an open circle [default: False]
- class schemdraw.elements.lines.DotDotDot(*, radius=None, open=None, **kwargs)¶
Ellipsis element
- Keyword Arguments:
radius – Radius of dots [default 0.075]
open – Draw dots as open circles [default: False]
“Ellipsis” is a reserved keyword in Python used for slicing, thus the name DotDotDot.
- class schemdraw.elements.lines.Encircle(elm_list=None, *, padx=None, pady=None, includelabels=True, **kwargs)¶
Draw ellipse around all elements in the list
- Parameters:
elm_list (
Optional[Sequence[Element]]) – List of elements to enclosepadx (
Optional[float]) – Horizontal distance from elements to loop [default: .2]pady (
Optional[float]) – Vertical distance from elements to loop [default: .2]includelabels (
bool) – Include labels in the ellipse
- class schemdraw.elements.lines.EncircleBox(elm_list=None, *, cornerradius=0.3, padx=None, pady=None, includelabels=True, **kwargs)¶
Draw rounded box around all elements in the list
- Parameters:
elm_list (
Optional[Sequence[Element]]) – List elements to enclosecornerraidus – radius of corner rounding [default: 0.3]
padx (
Optional[float]) – Horizontal distance from elements to loop [default: 0.2]pady (
Optional[float]) – Vertical distance from elements to loop [default: 0.2]includelabels (
bool) – Include labels in the box
- class schemdraw.elements.lines.Gap(*args, **kwargs)¶
Gap for labeling port voltages, for example. Draws nothing, but provides place to attach a label such as (‘+’, ‘V’, ‘-‘).
- Keyword Arguments:
lblloc – Label location within the gap [center]
lblalign – Label alignment [(center, center)]
lblofst – Offset to label [0]
- class schemdraw.elements.lines.Label(label=None, **kwargs)¶
Label element.
For more options, use Label().label() method.
- Parameters:
label (
Optional[str]) – text to display.
- class schemdraw.elements.lines.Line(*, arrow=None, **kwargs)¶
Straight Line
- Parameters:
arrow (
Optional[str]) – arrowhead specifier, such as ‘->’, ‘<-’, ‘<->’, ‘-o’, or ‘|->’- Keyword Arguments:
arrowwidth – Width of arrowhead [default: .15]
arrowlength – Length of arrowhead [default: 0.25]
- class schemdraw.elements.lines.LoopArrow(direction='cw', theta1=35, theta2=-35, width=1.0, height=1.0, **kwargs)¶
Loop arrow, for mesh analysis notation
- Parameters:
direction (
Literal['cw','ccw']) – loop direction ‘cw’ or ‘ccw’theta1 (
float) – Angle of start of loop arrowtheta2 (
float) – Angle of end of loop arrowwidth (
float) – Width of loopheight (
float) – Height of loop
- class schemdraw.elements.lines.LoopCurrent(elm_list=None, direction='cw', theta1=35, theta2=-35, pad=0.2, **kwargs)¶
Loop current label, for mesh analysis notation, placed within a box of 4 existing elements.
- Parameters:
elm_list (
Optional[Sequence[Element]]) – List of 4 elements surrounding loop, in order (top, right, bottom, left)direction (
Literal['cw','ccw']) – loop direction ‘cw’ or ‘ccw’theta1 (
float) – Angle of start of loop arrowtheta2 (
float) – Angle of end of loop arrowpad (
float) – Distance from elements to loop
- class schemdraw.elements.lines.Rect(corner1=(0, 0), corner2=(1, 1), *, fill=None, lw=None, ls=None, **kwargs)¶
Rectangle Element
Used mainly for buliding more complex elements. Corner arguments are relative to Element coordinates, not Drawing coordinates.
- Parameters:
corner1 (
Union[Tuple[float,float],Point]) – Position of top-left cornercorner2 (
Union[Tuple[float,float],Point]) – Position of bottom-right cornerfill (
Optional[str]) – Color to fill if not None [default: inherit]lw (
Optional[float]) – Line width [default: inherit]ls (
Optional[Literal['-',':','--','-.']]) – Line style ‘-’, ‘–’, ‘:’, etc. [default: inherit]
- class schemdraw.elements.lines.Tag(*, width=None, height=0.625, **kwargs)¶
Tag/flag element for labeling signal names.
Because text size is unknown until drawn, must specify width manually to fit a given text label.
- Parameters:
width (
Optional[float]) – Width of the tag [default: 1.5]height (
Optional[float]) – Height of the tag [default: 0.625]
- class schemdraw.elements.lines.VoltageLabelArc(*, length=None, top=None, reverse=None, ofst=None, headlength=None, headwidth=None, **kwargs)¶
Voltage Label as Arc along element path
Use .at() method to place the label over an existing element.
- Parameters:
top (
Optional[bool]) – Draw arrow on top or bottom of element [default: True]reverse (
Optional[bool]) – Reverse the arrow directionbend – Distance to bend the arc at its maximum height
ofst (
Optional[float]) – Offset distance from centerline of elementlength (
Optional[float]) – Length of the arrow [default: 1.75]headlength (
Optional[float]) – Length of arrowhead [default: 0.3]headwidth (
Optional[float]) – Width of arrowhead [default: 0.2]
- class schemdraw.elements.lines.Wire(shape='-', k=1, *, arrow=None, **kwargs)¶
Connect the .at() and .to() positions with lines depending on shape
- Parameters:
shape (
str) – Determines shape of wire: -: straight line |-: right-angle line starting vertically -|: right-angle line starting horizontally ‘z’: diagonal line with horizontal end segments ‘N’: diagonal line with vertical end segments n: n- or u-shaped lines c: c- or ↄ-shaped linesk (
float) – Distance before the wire changes directions in n and c shapes.arrow (
Optional[str]) – arrowhead specifier, such as ‘->’, ‘<-’, ‘<->’, or ‘-o’
- class schemdraw.elements.lines.ZLabel(*, ofst=None, hofst=None, length=None, lengthtip=None, headlength=None, headwidth=None, **kwargs)¶
Right-angle arrow, often used to indicate impedance looking in to a node
Use .at() method to place the label over an existing element.
- Parameters:
ofst (
Optional[float]) – Vertical offset from centerline of elementhofst (
Optional[float]) – Horizontal offset from center of elementlength (
Optional[float]) – Length of the arrow tail [default: 1]lengthtip (
Optional[float]) – Length of the arrow tip [default: 0.5]headlength (
Optional[float]) – Arrowhead length [default: 0.25]headwidth (
Optional[float]) – Arrowhead width [default: 0.15]
- at(xy)¶
Specify Element position.
If xy is an Element, arrow will be centered along element and its color will also be inherited.
- Parameters:
xy (XY | Element) – The absolute (x, y) position or an
over (Element instance to center the arrow)
- Return type:
Element
Cables and Connectors¶
Cable elements, coaxial and triaxial
- class schemdraw.elements.cables.Coax(*, length=None, radius=None, leadlen=None, **kwargs)¶
Coaxial cable element.
- Parameters:
length (
Optional[float]) – Total length of the cable, excluding lead extensions. [default: 3]radius (
Optional[float]) – Radius of shield [default: 0.3]leadlen (
Optional[float]) – Distance (x) from start of center conductor to start of shield. [default: 0.6]
- Anchors:
shieldstart
shieldstart_top
shieldend
shieldend_top
shieldcenter
shieldcenter_top
- class schemdraw.elements.cables.Triax(*, length=None, leadlen=None, radiusinner=None, radiusouter=None, shieldofststart=None, shieldofstend=None, **kwargs)¶
Triaxial cable element.
- Parameters:
length (
Optional[float]) – Total length of the cable [default: 3]radiusinner (
Optional[float]) – Radius of inner guard [default: 0.3]radiusouter (
Optional[float]) – Radius of outer shield [default: 0.6]leadlen (
Optional[float]) – Distance (x) from start of center conductor to start of guard. [default: 0.6]shieldofststart (
Optional[float]) – Distance from start of inner guard to start of outer shield [default: 0.3]shieldofstend (
Optional[float]) – Distance from end of outer shield to end of inner guard [default: 0.3]
- Anchors:
shieldstart
shieldstart_top
shieldend
shieldend_top
shieldcenter
shieldcenter_top
guardstart
guardstart_top
guardend
guardend_top
Connectors and bus lines
- class schemdraw.elements.connectors.BusConnect(n=1, up=True, *, dy=None, lwbus=None, l=None, **kwargs)¶
Data bus connection.
Adds the short diagonal lines that break out a bus (wide line) to connect to an Ic or Header element.
- Parameters:
n (
int) – Number of parallel linesup (
bool) – Slant up or downdy (
Optional[float]) – Distance between parallel lines [default: 0.6]lwbus (
Optional[float]) – Line width of bus line [default: 4]l (
Optional[float]) – length of connection lines [default: 3]
- Anchors:
start
end
p[X] where X is int for each data line
- class schemdraw.elements.connectors.BusLine(lw=None, **kwargs)¶
Data bus line. Just a wide line.
Use BusConnect to break out connections to the BusLine.
- Parameters:
lw (
Optional[float]) – Line width [default: 4]
- class schemdraw.elements.connectors.CoaxConnect(*, radius=None, radiusinner=None, fillinner=None, **kwargs)¶
Coaxial connector
- Parameters:
radius (
Optional[float]) – Radius of outer shell [defualt: 0.4]radiusinner (
Optional[float]) – Radius of inner conductor [default: 0.12]fillinner (
Optional[str]) – Color to fill inner conductor [default: bg]
- Anchors:
center
N
S
E
W
- class schemdraw.elements.connectors.DA15(*, pinspacing=None, edge=None, number=None, pinfill=None, **kwargs)¶
DA-15 Connector
- Parameters:
pinspacing (
Optional[float]) – Distance between pins [default: 0.6]edge (
Optional[float]) – Distance between edge and pins [default: 0.3]number (
Optional[bool]) – Draw pin numbers [default: False]pinfill (
Optional[str]) – Color to fill pin circles [default: bg]
- Anchors:
pin1 thru pin15
- class schemdraw.elements.connectors.DB25(*, pinspacing=None, edge=None, number=None, pinfill=None, **kwargs)¶
DB25 Connector
- Parameters:
pinspacing (
Optional[float]) – Distance between pins [default: 0.6]edge (
Optional[float]) – Distance between edge and pins [default: 0.3]number (
Optional[bool]) – Draw pin numberspinfill (
Optional[str]) – Color to fill pin circles [default: bg]
- Anchors:
pin1 thru pin25
- class schemdraw.elements.connectors.DC37(*, pinspacing=None, edge=None, number=None, pinfill=None, **kwargs)¶
DC-37 Connector
- Parameters:
pinspacing (
Optional[float]) – Distance between pins [default: 0.6]edge (
Optional[float]) – Distance between edge and pins [default: 0.3]number (
Optional[bool]) – Draw pin numbers [default: False]pinfill (
Optional[str]) – Color to fill pin circles [default: bg]
- Anchors:
pin1 thru pin37
- class schemdraw.elements.connectors.DD50(*, pinspacing=None, edge=None, number=None, pinfill=None, **kwargs)¶
DD-50 Connector
- Parameters:
pinspacing (
Optional[float]) – Distance between pins [default: 0.6]edge (
Optional[float]) – Distance between edge and pins [default: 0.3]number (
Optional[bool]) – Draw pin numbers [default: False]pinfill (
Optional[str]) – Color to fill pin circles [default: bg]
- Anchors:
pin1 thru pin50
- class schemdraw.elements.connectors.DE9(*, pinspacing=None, edge=None, number=None, pinfill=None, **kwargs)¶
DE9 Connector (also known as DB9)
- Parameters:
pinspacing (
Optional[float]) – Distance between pins [default: 0.6]edge (
Optional[float]) – Distance between edge and pins [default: 0.3]number (
Optional[bool]) – Draw pin numbers [default: False]pinfill (
Optional[str]) – Color to fill pin circles [default: bg]
- Anchors:
pin1 thru pin9
- class schemdraw.elements.connectors.Header(rows=4, cols=1, pinsleft=None, pinsright=None, *, style=None, numbering=None, shownumber=None, pinalignleft=None, pinalignright=None, pinfontsizeright=None, pinfontsizeleft=None, pinspacing=None, edge=None, pinfill=None, **kwargs)¶
Header connector element
- Parameters:
rows (
int) – Number of rowscols (
int) – Number of columns. Pin numbering requires 1 or 2 columnspinsleft (
Optional[Sequence[str]]) – List of pin labels for left sidepinsright (
Optional[Sequence[str]]) – List of pin labels for right sidestyle (
Optional[Literal['round','square','screw']]) – Connector style, ‘round’, ‘square’, or ‘screw’ [default: round]numbering (
Optional[Literal['lr','ud','ccw']]) – Pin numbering order. ‘lr’ for left-to-right numbering, ‘ud’ for up-down numbering, or ‘ccw’ for counter-clockwise (integrated-circuit style) numbering. Pin 1 is always at the top-left corner, unless flip method is also called. [default: lr]shownumber (
Optional[bool]) – Draw pin numbers outside the headerpinalignleft (
Optional[Literal['center','top','bottom','base']]) – Vertical alignment for pins on left side (‘center’, ‘top’, ‘bottom’) [default: ‘bottom’]pinalignright (
Optional[Literal['center','top','bottom','base']]) – Vertical alignment for pins on right side (‘center’, ‘top’, ‘bottom’) [default: ‘bottom’]pinfontsizeleft (
Optional[float]) – Font size for pin labels on left [default: 9]pinfontsizeright (
Optional[float]) – Font size for pin labels on right [default: 9]pinspacing (
Optional[float]) – Distance between pins [default: 0.6]edge (
Optional[float]) – Distance between header edge and first pin row/column [default: 0.3]pinfill (
Optional[str]) – Color to fill pin circles [default: bg]
- Anchors:
pin[X] for each pin
- class schemdraw.elements.connectors.Jack(*args, **kwargs)¶
Jack (female connector)
- class schemdraw.elements.connectors.Jumper(*, pinspacing=None, **kwargs)¶
Jumper for use on a Header element
Set position using at() method with a Header pin location, e.g. Jumper().at(H.in1)
- Parameters:
pinspacing (
Optional[float]) – Spacing between pins [default: 0.6]
- class schemdraw.elements.connectors.OrthoLines(*, n=1, dy=None, xstart=None, arrow=None, **kwargs)¶
Orthogonal multiline connectors
Use at() and to() methods to specify starting and ending location of OrthoLines.
The default lines are spaced to provide connection to pins with default spacing on Ic element or connector such as a Header.
- Parameters:
n (
int) – Number of parallel linesdy (
Optional[float]) – Distance between parallel lines [default: 0.6]xstart (
Optional[float]) – Fractional distance (0-1) to start vertical portion of first ortholine
- class schemdraw.elements.connectors.Plug(*args, **kwargs)¶
Plug (male connector)
- class schemdraw.elements.connectors.RightLines(*, n=1, dy=None, arrow=None, **kwargs)¶
Right-angle multi-line connectors
Use at() and to() methods to specify starting and ending location.
The default lines are spaced to provide connection to pins with default spacing on Ic element or connector such as a Header.
- Parameters:
n (
int) – Number of parallel linesdy (
Optional[float]) – Distance between parallel lines [default: 0.6]
- class schemdraw.elements.connectors.Terminal(*, r=None, open=None, **kwargs)¶
Terminal element
- Parameters:
r (
Optional[float]) – Radius of terminal [default: 0.18]open (
Optional[bool]) – Draw as open circle
Transistors¶
Transistor elements
- class schemdraw.elements.transistors.AnalogBiasedFet(*, bulk=None, offset_gate=None, source_arrow=None, **kwargs)¶
Generic biased small-signal Field Effect Transistor, analog style
- Parameters:
bulk (
Optional[bool]) – Draw bulk contactoffset_gate (
Optional[bool]) – Draw gate on the source side of the transistor, rather than middlesource_arrow (
Optional[bool]) – Draw source dot on the transistor if bulk dot is not drawn
- Anchors:
source drain gate bulk (if bulk=True) center
- class schemdraw.elements.transistors.AnalogNFet(*, bulk=None, offset_gate=None, source_arrow=None, **kwargs)¶
N-type Field Effect Transistor, analog style
- Parameters:
bulk (
Optional[bool]) – Draw bulk contactoffset_gate (
Optional[bool]) – Draw gate on the source side of the transistor, rather than middlesource_arrow (
Optional[bool]) – Draw source arrow on the transistor if bulk arrow is not drawn
- Anchors:
source drain gate bulk (if bulk=True) center
- class schemdraw.elements.transistors.AnalogPFet(*, bulk=None, offset_gate=None, source_arrow=None, **kwargs)¶
P-type Field Effect Transistor, analog style
- Parameters:
bulk (
Optional[bool]) – Draw bulk contactoffset_gate (
Optional[bool]) – Draw gate on the source side of the transistor, rather than middlesource_arrow (
Optional[bool]) – Draw source arrow on the transistor if bulk arrow is not drawn
- Anchors:
source drain gate bulk (if bulk=True) center
- class schemdraw.elements.transistors.Bjt(*, circle=None, **kwargs)¶
Bipolar Junction Transistor (untyped)
- Parameters:
circle (
Optional[bool]) – Draw circle around the transistor
- Anchors:
collector
emitter
base
center
- class schemdraw.elements.transistors.Bjt2(*, circle=None, **kwargs)¶
Bipolar Junction Transistor (untyped) which extends collector/emitter leads to the desired length
- Parameters:
circle (
Optional[bool]) – Draw circle around the transistor
- Anchors:
collector
emitter
base
- class schemdraw.elements.transistors.BjtNpn(*, circle=None, **kwargs)¶
NPN Bipolar Junction Transistor
- Parameters:
circle (
Optional[bool]) – Draw circle around the transistor
- Anchors:
collector
emitter
base
center
- class schemdraw.elements.transistors.BjtNpn2(*, circle=None, **kwargs)¶
NPN Bipolar Junction Transistor which extends collector/emitter leads to the desired length
- Parameters:
circle (
Optional[bool]) – Draw circle around the transistor
- Anchors:
collector
emitter
base
- class schemdraw.elements.transistors.BjtPnp(*, circle=None, **kwargs)¶
PNP Bipolar Junction Transistor
- Parameters:
circle (
Optional[bool]) – Draw circle around the transistor
- Anchors:
collector
emitter
base
center
- class schemdraw.elements.transistors.BjtPnp2(*, circle=None, **kwargs)¶
PNP Bipolar Junction Transistor which extends collector/emitter leads to the desired length
- Parameters:
circle (
Optional[bool]) – Draw circle around the transistor
- Anchors:
collector
emitter
base
- class schemdraw.elements.transistors.BjtPnp2c(*, circle=None, **kwargs)¶
PNP Bipolar Junction Transistor with 2 collectors
- Parameters:
circle (
Optional[bool]) – Draw circle around the transistor
- Anchors:
collector
emitter
base
C2
center
- class schemdraw.elements.transistors.BjtPnp2c2(*, circle=None, **kwargs)¶
2-Collector PNP Bipolar Junction Transistor which extends collector/emitter leads to the desired length
- Parameters:
circle (
Optional[bool]) – Draw circle around the transistor
- Anchors:
collector
emitter
base
C2
- class schemdraw.elements.transistors.JFet(*, circle=None, **kwargs)¶
Junction Field Effect Transistor (untyped)
- Anchors:
source
drain
gate
center
- class schemdraw.elements.transistors.JFet2(*, circle=None, **kwargs)¶
Junction Field Effect Transistor (untyped) which extends collector/emitter leads to the desired length
- Anchors:
source
drain
gate
- class schemdraw.elements.transistors.JFetN(*, circle=None, **kwargs)¶
N-type Junction Field Effect Transistor
- Parameters:
circle (
Optional[bool]) – Draw circle around the transistor
- Anchors:
source
drain
gate
center
- class schemdraw.elements.transistors.JFetN2(*, circle=None, **kwargs)¶
N-type Junction Field Effect Transistor which extends collector/emitter leads to the desired length
- Parameters:
circle (
Optional[bool]) – Draw circle around the transistor
- Anchors:
source
drain
gate
- class schemdraw.elements.transistors.JFetP(*, circle=None, **kwargs)¶
P-type Junction Field Effect Transistor
- Parameters:
circle (
Optional[bool]) – Draw circle around the transistor
- Anchors:
source
drain
gate
center
- class schemdraw.elements.transistors.JFetP2(*, circle=None, **kwargs)¶
P-type Junction Field Effect Transistor which extends collector/emitter leads to the desired length
- Parameters:
circle (
Optional[bool]) – Draw circle around the transistor
- Anchors:
source
drain
gate
- class schemdraw.elements.transistors.NFet(*, bulk=None, **kwargs)¶
N-type Field Effect Transistor
- Parameters:
bulk (
Optional[bool]) – Draw bulk contact [default: False]
- Anchors:
source
drain
gate
center
- class schemdraw.elements.transistors.NFet2(*, bulk=None, **kwargs)¶
N-type Field Effect Transistor which extends source/drain leads to the desired length
- Parameters:
bulk (
Optional[bool]) – Draw bulk contact [default: False]
- Anchors:
source
drain
gate
- class schemdraw.elements.transistors.NMos(diode=False, circle=False, **kwargs)¶
N-type Metal Oxide Semiconductor Field Effect Transistor
- Args:
diode: Draw body diode circle: Draw circle around the mosfet
- Anchors:
source
drain
gate
Note: vertical orientation. For horizontal orientation, see NMos2.
- class schemdraw.elements.transistors.NMos2(diode=False, circle=False, **kwargs)¶
N-type Metal Oxide Semiconductor Field Effect Transistor
- Args:
diode: Draw body diode circle: Draw circle around the mosfet circle_lw: Line width of circle
- Anchors:
source
drain
gate
Note: horizontal orientation. For vertical orientation, see NMos.
- class schemdraw.elements.transistors.PFet(*, bulk=None, **kwargs)¶
P-type Field Effect Transistor
- Parameters:
bulk (
Optional[bool]) – Draw bulk contact
- Anchors:
source drain gate center
- class schemdraw.elements.transistors.PFet2(*, bulk=None, **kwargs)¶
P-type Field Effect Transistor which extends source/drain leads to the desired length
- Parameters:
bulk (
Optional[bool]) – Draw bulk contact [default: False]
- Anchors:
source
drain
gate
- class schemdraw.elements.transistors.PMos(diode=False, circle=False, **kwargs)¶
P-type Metal Oxide Semiconductor Field Effect Transistor
- Args:
diode: Draw body diode circle: Draw circle around the mosfet
- Anchors:
source
drain
gate
Note: vertical orientation. For horizontal orientation, see PMos2.
- class schemdraw.elements.transistors.PMos2(diode=False, circle=False, **kwargs)¶
P-type Metal Oxide Semiconductor Field Effect Transistor
- Args:
diode: Draw body diode circle: Draw circle around the mosfet
- Anchors:
source
drain
gate
Note: horizontal orientation. For vertical orientation, see PMos.
Transformers¶
Transformer element definitions
- class schemdraw.elements.xform.Transformer(t1=4, t2=4, *, core=None, loop=None, align='center', **kwargs)¶
Add taps to the windings on either side using the .taps method.
- Parameters:
t1 (int | Sequence[int]) – Turns on primary (left) side
t2 (int | Sequence[int]) – Turns on secondary (right) side
core (Optional[bool]) – Draw the core (parallel lines) [default: True]
loop (Optional[bool]) – Use spiral/cycloid (loopy) style [default: False]
- Anchors:
p1: primary side 1
p2: primary side 2
s1: secondary side 1
s2: secondary side 2
Other anchors defined by taps method
- tap(name, pos, side='primary')¶
Add a tap
A tap is simply a named anchor definition along one side of the transformer.
- Parameters:
name (
str) – Name of the tap/anchorpos (
int) – Turn number from the top of the tapside (
Literal['primary','secondary','left','right']) – Primary (left) or Secondary (right) side
- Return type:
Opamp and Integrated Circuits¶
Operation amplifier
- class schemdraw.elements.opamp.Opamp(*, sign=None, leads=None, **kwargs)¶
Operational Amplifier.
- Keyword Arguments:
sign – Draw +/- labels at each input
leads – Draw short leads on input/output
- Anchors:
in1
in2
out
vd
vs
n1
n2
n1a
n2a
Integrated Circuit Element
- class schemdraw.elements.intcircuits.DFlipFlop(preclr=False, preclrinvert=True, **kwargs)¶
D-Type Flip Flop
- Parameters:
preclr (
bool) – Show preset and clear inputspreclrinvert (
bool) – Add invert bubble to preset and clear inputs
- Keyword Arguments:
size – Size of the box [default: (2, 3)]
- Anchors:
D
CLK
Q
Qbar
PRE
CLR
- class schemdraw.elements.intcircuits.Ic(size=None, pins=None, slant=0, **kwargs)¶
Integrated Circuit - box with arbitrary pins and labels along each side
- Parameters:
size (
Union[Tuple[float,float],Point,None]) – (width, height) in drawing unitspins (
Optional[Sequence[IcPin]]) – list of IcPin instancesslant (
float) – Angle to slant top/bottom of IC (ie for multiplexers)pinspacing – spacing between pins, in drawing units
- pin(side='L', name=None, pin=None, pos=None, slot=None, invert=False, invertradius=0.15, color=None, rotation=0, anchorname=None, lblsize=None, href=None, decoration=None)¶
Add a pin to the IC
- Parameters:
name (str | None) – Input/output name (inside the box)
pin (str | None) – Pin name/number (outside the box)
side (Side) – Side of box for the pin, ‘left’, ‘right’, ‘top’, ‘bottom’
pos (float | None) – Pin position along the side, fraction from 0-1
slot (str | None) – Slot definition of pin location, given in ‘X/Y’ format. ‘2/4’ is the second pin on a side with 4 pins.
invert (bool) – Add an invert bubble to the pin
invertradius (float) – Radius of invert bubble
color (str | None) – Color for the pin and label
rotation (float) – Rotation for label text
anchorname (str | None) – Named anchor for the pin
lblsize (float | None) – Font size for label
href (Optional[str]) – Hyperline target (jump to)
decoration (Optional[str]) – “underline” or “overline”
- property pinnames: list[str]¶
List of all pin names
- side(side='L', spacing=0, pad=0.5, leadlen=0.5, label_ofst=0.15, label_size=14.0, pinlabel_ofst=0.05, pinlabel_size=11.0)¶
Set parameters for spacing/layout of one side
- Parameters:
side (
Literal['top','bot','lft','rgt','bottom','left','right','L','R','T','B']) – Side of box to definespacing (
float) – Distance between pinspad (
float) – Distance from box edge to first pinleadlen (
float) – Length of pin lead extensionslabel_ofst (
float) – Offset between box and label (inside box)label_size (
float) – Font size of label (inside box)pinlabel_ofst (
float) – Offset between box and pin label (outside box)pinlabel_size (
float) – Font size of pin label (outside box)
- class schemdraw.elements.intcircuits.Ic555(*args, **kwargs)¶
555 Timer IC
- class schemdraw.elements.intcircuits.IcBox(w, h, y1, y2)¶
- h¶
Alias for field number 1
- w¶
Alias for field number 0
- y1¶
Alias for field number 2
- y2¶
Alias for field number 3
- class schemdraw.elements.intcircuits.IcDIP(*, pins=None, names=None, notch=None, width=None, pinw=None, spacing=None, number=None, fontsize=None, pfontsize=None, **kwargs)¶
Dual-inline Package Integrated Circuit.
- Parameters:
names (
Optional[Sequence[str]]) – List of names for each pin to display inside the box- Keyword Arguments:
pins – number of pins [default: 8]
notch – Show the notch at top of box [default: True]
width – Width of the box [default: 3]
pinw – Width and height of each pin [default: 0.6]
spacing – Distance between each pin [default: 0.5]
number – Show pin numbers inside each pin [default: True]
fontsize – Size for pin name labels [default: 12]
pfontsize – Size for pin number labels [default: 10]
- Anchors:
p[x] - Each pin
p[x]_in - Inside contact for each pin
If signal names are provided, they will also be added as anchors along with _in inside variants.
- class schemdraw.elements.intcircuits.IcPin(name=None, pin=None, side='L', pos=None, slot=None, invert=False, invertradius=0.15, color=None, rotation=0, anchorname=None, lblsize=None, href=None, decoration=None, pinlblsize=None)¶
Integrated Circuit Pin
- Parameters:
name (str | None) – Input/output name (inside the box)
pin (str | None) – Pin name/number (outside the box)
side (Side) – Side of box for the pin, ‘left’, ‘right’, ‘top’, ‘bottom’
pos (float | None) – Pin position along the side, fraction from 0-1
slot (str | None) – Slot definition of pin location, given in ‘X/Y’ format. ‘2/4’ is the second pin on a side with 4 pins.
invert (bool) – Add an invert bubble to the pin
invertradius (float) – Radius of invert bubble
color (str | None) – Color for the pin and label
rotation (float) – Rotation for label text
anchorname (str | None) – Named anchor for the pin
- class schemdraw.elements.intcircuits.IcSide(spacing=0.0, pad=0.25, leadlen=0.5, label_ofst=0.15, label_size=14.0, pinlabel_ofst=0.05, pinlabel_size=11.0)¶
Pin layout parameters for one side of an Ic
- class schemdraw.elements.intcircuits.JKFlipFlop(preclr=False, preclrinvert=True, **kwargs)¶
J-K Flip Flop
- Parameters:
preclr (
bool) – Show preset and clear inputspreclrinvert (
bool) – Add invert bubble to preset and clear inputs
- Keyword Arguments:
size – Size of the box [default: (2, 3)]
- Anchors:
J
K
CLK
Q
Qbar
PRE
CLR
- class schemdraw.elements.intcircuits.Multiplexer(demux=False, size=None, pins=None, slant=25, **kwargs)¶
- Parameters:
demux (
bool) – Draw as demultiplexersize (
Union[Tuple[float,float],Point,None]) – (Width, Height) of boxpins (
Optional[Sequence[IcPin]]) – List of IcPin instances defining the inputs/outputsslant (
float) – Slant angle of top/bottom edges
- Keyword Arguments:
pinspacing – Spacing between pins [default: 0.6]
edgepadH – Padding between top/bottom and first pin [default: 0.25]
edgepadW – Padding between left/right and first pin [default: 0.25]
lofst – Offset between edge and label (inside box) [default: 0.15]
lsize – Font size of labels (inside box) [default: 14]
plblofst – Offset between edge and pin label (outside box) [default: 0.05]
plblsize – Font size of pin labels (outside box) [default: 11]
If a pin is named ‘>’, it will be drawn as a proper clock signal input.
- Anchors:
inL[X] - Each pin on left side
inR[X] - Each pin on right side
inT[X] - Each pin on top side
inB[X] - Each pin on bottom side
pin[X] - Each pin with a number
CLK (if clock pin is defined with ‘>’ name)
Pins with names are also defined as anchors (if the name does not conflict with other attributes).
- class schemdraw.elements.intcircuits.SevenSegment(*, decimal=None, digit=None, segcolor=None, tilt=None, labelsegments=None, anode=None, cathode=None, **kwargs)¶
A seven-segment display digit.
- Keyword Arguments:
decimal – Show decimal point segment [default: False]
digit – Number to display [default: 8]
segcolor – Color of segments [default: red]
tilt – Tilt angle in degrees [default: 10]
labelsegments – Add a-g labels to each segment [default: True]
anode – Add common anode pin [default: False]
cathode – Add common cathode pin [default: False]
- Anchors:
a
b
c
d
e
f
g
dp
cathode
anode
- class schemdraw.elements.intcircuits.VoltageRegulator(*args, **kwargs)¶
Voltage regulator
- Keyword Arguments:
size – Size of the box [default: (2, 1.5)]
- Anchors:
in
out
gnd
- schemdraw.elements.intcircuits.sevensegdigit(bottom=0, left=0, seglen=1.5, segw=0.3, spacing=0.12, decimal=False, digit=8, segcolor='red', tilt=10, labelsegments=True)¶
Generate drawing segments for a 7-segment display digit. Use for building new elements incorporating a 7-segment display.
- Parameters:
bottom (float) – Location of bottom of digit
left (float) – Location of left side of digit
seglen (float) – Length of one segment
segw (float) – Width of one segment
spacing (float) – Distance between segments in corners
decimal (bool) – Show decimal point segment
digit (int | str) – Number to display
segcolor (str) – Color of segments
tilt (float) – Tilt angle in degrees
labelsegments (bool) – Add a-g labels to each segment
anode – Add common anode pin
cathode – Add common cathode pin
size – Total size of the box
- Return type:
list[SegmentType]
- Returns:
List of Segments making the digit
Other¶
Other elements
- class schemdraw.elements.misc.AudioJack(*, radius=None, ring=False, ringswitch=False, dots=True, switch=False, open=None, **kwargs)¶
Audio Jack with 2 or 3 connectors and optional switches.
- Parameters:
ring (
bool) – Show ring (third conductor) contactswitch (
bool) – Show switch on tip contactringswitch (
bool) – Show switch on ring contactdots (
bool) – Show connector dotsradius (
Optional[float]) – Radius of connector dots [default: 0.075]
- Anchors:
tip
sleeve
ring
ringswitch
tipswitch
- class schemdraw.elements.misc.Mic(*args, **kwargs)¶
Microphone element with two inputs.
- Anchors:
in1
in2
- class schemdraw.elements.misc.Motor(*args, **kwargs)¶
- class schemdraw.elements.misc.Speaker(*args, **kwargs)¶
Speaker element with two inputs.
- Anchors:
in1
in2
Compound elements made from groups of other elements
- class schemdraw.elements.compound.ElementCompound(**kwargs)¶
Element onto which other elements can be added like a drawing
- move(dx=0, dy=0)¶
Move relative to current position
- Return type:
None
- move_from(xy, dx=0, dy=0, theta=None)¶
Move relative to xy position
- Return type:
None
- class schemdraw.elements.compound.Optocoupler(box=True, boxfill='none', boxpad=0.2, base=False, **kwargs)¶
Optocoupler element
- Parameters:
box (
bool) – Draw a box around the optocouplerboxfill (
str) – Color to fill the boxboxpad (
float) – Padding between phototransistor and boxbase (
bool) – Add a base contact to the phototransistor
- Anchors:
anode
cathode
emitter
collector
base (if base==True)
- class schemdraw.elements.compound.Rectifier(*args, **kwargs)¶
Diode Rectifier Bridge
- Parameters:
fill – Fill the didoes
labels – Labels to draw on each resistor
- Anchors:
N
S
E
W
- class schemdraw.elements.compound.Relay(unit=2, cycl=False, switch='spst', core=True, box=True, boxfill='none', boxpad=0.25, swreverse=False, swflip=False, link=True, **kwargs)¶
Relay element with an inductor and switch
- Parameters:
unit (
float) – Unit length of the inductorcycloid – Use cycloid style inductor
switch (
str) – Switch style ‘spst’, ‘spdt’, ‘dpst’, ‘dpdt’swreverse (
bool) – Reverse the switchswflip (
bool) – Flip the switch up/downcore (
bool) – Show inductor core barlink (
bool) – Show dotted line linking inductor and switchbox (
bool) – Draw a box around the relayboxfill (
str) – Color to fill the boxboxpad (
float) – Spacing between components and box
- class schemdraw.elements.compound.Wheatstone(vout=False, labels=None, **kwargs)¶
Wheatstone Resistor Bridge
- Parameters:
vout (
bool) – draw output terminals inside the bridgelabels (
Optional[Sequence[str]]) – Labels to draw on each resistor
- Anchors:
N
S
E
W
vo1 (if vout==True)
vo2 (if vout==True)
Twoport elements made from groups of other elements
- class schemdraw.elements.twoports.CurrentTransactor(reverse_output=False, **kwargs)¶
Current transactor
- Parameters:
bpadx – Horizontal padding from edge of either component
bpady – Vertical padding from edge of either component
minw – Margin around component if smaller than minw
terminals – Draw with terminals extending past box
component_offset – Offset between input and output element
box – Draw twoport outline
boxfill – Color to fill the twoport if not None
boxlw – Line width of twoport outline
boxls – Line style of twoport outline ‘-’, ‘–’, ‘:’, etc.
reverse_output (
bool) – Switch direction of output source, defaults to False
- Anchors:
in_p
in_n
out_p
out_n
center
- class schemdraw.elements.twoports.ElementTwoport(input_element, output_element, boxpadx=0.2, boxpady=0.2, minw=0.5, terminals=True, unit=1.5, width=2.15, box=True, boxfill=None, boxlw=None, boxls=None, **kwargs)¶
Compound twoport element
- Parameters:
input_element (
type[Element2Term]) – The element forming the input branch of the twoportoutput_element (
type[Element2Term]) – The element forming the output branch of the twoportbpadx – Horizontal padding from edge of either component
bpady – Vertical padding from edge of either component
minw (
float) – Margin around component if smaller than minwterminals (
bool) – Draw with terminals extending past boxunit (
float) – Length of input and output elementwidth (
float) – Width of the twoport boxbox (
bool) – Draw twoport outlineboxfill (
Optional[str]) – Color to fill the twoport if not Noneboxlw (
Optional[float]) – Line width of twoport outlineboxls (
Optional[Literal['-',':','--','-.']]) – Line style of twoport outline ‘-’, ‘–’, ‘:’, etc.
- Anchors:
in_p
in_n
out_p
out_n
center
- class schemdraw.elements.twoports.Nullor(*args, **kwargs)¶
- Parameters:
bpadx – Horizontal padding from edge of either component
bpady – Vertical padding from edge of either component
minw – Margin around component if smaller than minw
terminals – Draw with terminals extending past box
component_offset – Offset between input and output element
box – Draw twoport outline
boxfill – Color to fill the twoport if not None
boxlw – Line width of twoport outline
boxls – Line style of twoport outline ‘-’, ‘–’, ‘:’, etc.
- Anchors:
in_p
in_n
out_p
out_n
center
- class schemdraw.elements.twoports.TransadmittanceTransactor(reverse_output=False, **kwargs)¶
Transadmittance transactor
- Parameters:
bpadx – Horizontal padding from edge of either component
bpady – Vertical padding from edge of either component
minw – Margin around component if smaller than minw
terminals – Draw with terminals extending past box
component_offset – Offset between input and output element
box – Draw twoport outline
boxfill – Color to fill the twoport if not None
boxlw – Line width of twoport outline
boxls – Line style of twoport outline ‘-’, ‘–’, ‘:’, etc.
reverse_output (
bool) – Switch direction of output source, defaults to False
- Anchors:
in_p
in_n
out_p
out_n
center
- class schemdraw.elements.twoports.TransimpedanceTransactor(reverse_output=False, **kwargs)¶
Transimpedance transactor
- Parameters:
bpadx – Horizontal padding from edge of either component
bpady – Vertical padding from edge of either component
minw – Margin around component if smaller than minw
terminals – Draw with terminals extending past box
component_offset – Offset between input and output element
box – Draw twoport outline
boxfill – Color to fill the twoport if not None
boxlw – Line width of twoport outline
boxls – Line style of twoport outline ‘-’, ‘–’, ‘:’, etc.
reverse_output (
bool) – Switch direction of output source, defaults to False
- Anchors:
in_p
in_n
out_p
out_n
center
- class schemdraw.elements.twoports.TwoPort(sign=True, arrow=True, reverse_output=False, **kwargs)¶
Generic Twoport
- Parameters:
bpadx – Horizontal padding from edge of either component
bpady – Vertical padding from edge of either component
minw – Margin around component if smaller than minw
terminals – Draw with terminals extending past box
component_offset – Offset between input and output element
box – Draw twoport outline
boxfill – Color to fill the twoport if not None
boxlw – Line width of twoport outline
boxls – Line style of twoport outline ‘-’, ‘–’, ‘:’, etc.
sign (
bool) – Draw input and output terminal labelsarrow (
bool) – Draw arrow from input to output
- Anchors:
in_p
in_n
out_p
out_n
center
- class schemdraw.elements.twoports.VMCMPair(*args, **kwargs)¶
Nullor
- Parameters:
bpadx – Horizontal padding from edge of either component
bpady – Vertical padding from edge of either component
minw – Margin around component if smaller than minw
terminals – Draw with terminals extending past box
component_offset – Offset between input and output element
box – Draw twoport outline
boxfill – Color to fill the twoport if not None
boxlw – Line width of twoport outline
boxls – Line style of twoport outline ‘-’, ‘–’, ‘:’, etc.
- Anchors:
in_p
in_n
out_p
out_n
center
- class schemdraw.elements.twoports.VoltageTransactor(reverse_output=False, **kwargs)¶
Voltage transactor
- Parameters:
bpadx – Horizontal padding from edge of either component
bpady – Vertical padding from edge of either component
minw – Margin around component if smaller than minw
terminals – Draw with terminals extending past box
component_offset – Offset between input and output element
box – Draw twoport outline
boxfill – Color to fill the twoport if not None
boxlw – Line width of twoport outline
boxls – Line style of twoport outline ‘-’, ‘–’, ‘:’, etc.
reverse_output (
bool) – Switch direction of output source, defaults to False
- Anchors:
in_p
in_n
out_p
out_n
center
Vacuum Tubes
- class schemdraw.elements.tubes.DualVacuumTube(cathode='heated', anodetype='plate', grids_left=1, grids_right=1, heater=True, **kwargs)¶
Dual Vacuum Tube
- Keyword Arguments:
cathode – Cathode style ‘heated’, ‘cold’, or ‘none’
anodetype – Anode style ‘plate’, ‘dot’, or ‘none’
grids_left – Number of grids for left element
grids_right – Number of grids for right element
heater – Show heater filament
- Anchors:
anodeA
anodeB
gridA[_X]
gridA_[X]R
gridB[_X]
gridB_[X]R
cathodeA
cathodeA_R
cathodeB
cathodeB_R
heat1
heat2
- class schemdraw.elements.tubes.NixieTube(anodes=3, cathode='T', anodetype='narrow', grid=False, **kwargs)¶
Nixie Tube
- Keyword Arguments:
anodes – Number of anode connections
cathode – Cathode style ‘T’, ‘cold’, or ‘none’
anodetype – Anode type ‘narrow’ or ‘dot’
grid – Show grid
- Anchors:
anode[X]
cathode
grid
grid_R
- class schemdraw.elements.tubes.Pentode(strap=False, heater=False, split='none', **kwargs)¶
Pentode Vacuum Tube
- Keyword Arguments:
strap – Connect suppressor grid to cathode
heater – Show heater filament
split – Draw open envelope on ‘left’ or ‘right’ side
- Anchors:
anode
cathode
cathode_R
suppressor
suppressor_R
screen
screen_R
control
control_R
heat1
heat2
- class schemdraw.elements.tubes.Tetrode(heater=False, split='none', **kwargs)¶
Tetrode Vacuum Tube
- Keyword Arguments:
heater – Show heater filament
split – Draw open envelope on ‘left’ or ‘right’ side
- Anchors:
anode
cathode
cathode_R
screen
screen_R
control
control_R
heat1
heat2
- class schemdraw.elements.tubes.Triode(heater=False, split='none', **kwargs)¶
Triode Vacuum Tube
- Keyword Arguments:
heater – Show heater filament
split – Draw open envelope on ‘left’ or ‘right’ side
- Anchors:
anode
cathode
cathode_R
control
control_R
heat1
heat2
- class schemdraw.elements.tubes.TubeBase(**kwargs)¶
Base class for vacuum tubes
- class schemdraw.elements.tubes.TubeDiode(heater=False, split='none', **kwargs)¶
Vacuum Tube Diode
- Keyword Arguments:
heater – Show heater filament
split – Draw open envelope on ‘left’ or ‘right’ side
- Anchors:
anode
cathode
cathode_R
heat1
heat2
- class schemdraw.elements.tubes.VacuumTube(*, cathode='heated', anodetype='plate', grids=1, heater=True, split='none', **kwargs)¶
Generic Configrable Vacuum Tube
- Keyword Arguments:
cathode – Cathode style ‘heated’, ‘cold’, or ‘none’
anodetype – Anode style ‘plate’, ‘dot’, ‘narrow’, or ‘none’
grids – Number of grids
heater – Show heater filament
split – Draw open envelope on ‘left’ or ‘right’ side
- Style Parameters:
tube_lw: linewidth of envelope anode_lw: linewidth of anode cathode_lw: linewidth of cathode heat_lw: linewidth of heater grid_lw’ linewidth of grid n_grid_dashes: number of grid dashes dot_radius: radius of dot for cold cathode
- Anchors:
anode
grid[_X]
grid_[X]R
cathode
cathode_R
heat1
heat2