-
Notifications
You must be signed in to change notification settings - Fork 10
DefMake_symbol
Jim Pivarski edited this page Mar 15, 2015
·
1 revision
- summary Create new SVG symbol objects from a template of useful shapes
- labels Reference,Version1
_(This page applies only to the 1.x branch of SVGFig.)_
Creates a new instance of an SVG symbol to avoid cross-linking objects. The user must supply a new identifier.
- make_symbol(id, shape, attribute=value)*
id | _*required*_ | a new identifier (string/Unicode) | ||||
shape | _default_="dot" | the shape name from *symbol_templates* | ||||
attribute=value list | _keyword list_ | modify the SVG attributes of the new symbol, e.g. stroke="red", fill="yellow" |
Symbol templates come from a dictionary in the svgfig namespace called *symbol_templates*.
"dot" | a circular dot | |||
"box" | a square box | |||
"uptri" | an upward-pointing triangle | |||
"downtri" | a downward-pointing triangle |
>>> import svgfig >>> svgfig.symbol_templates {'box': <symbol (1 sub) overflow='visible' viewBox='0 0 1 1' />, ...