Formas básicas
Rectángulo <rect>
<svg>
<rect fill="orange"
stroke="black"
width="150"
height="75"
x="50"
y="25"
rx="10"
ry="10"/>
</svg>
fill es el color del relleno, stroke es el color del borde, width y height el ancjho y alto, x e y son las coordenadas de la posición del origen del rectángulo, la esquina superior izquierda, y rx y ry son los valores de redondeo del rectángulo.
También puede usarse atributos de estilo, con style, siguiendo la estructura de las reglas de CSS. un punto y coma separa cada declaración de la manera de nombre: valor.
Relación de propiedades: http://www.w3.org/TR/SVG11/propidx.html
<svg>
<rect x="50" y="25" rx="10" ry="10" width="150" height="75"
style="fill:rgb(0,0,255);stroke-width:1;stroke:rgb(0,0,0)"/>
</svg>
Círculo <circle>
<svg>
<circle cx="100" cy="50" r="40" stroke="black"
stroke-width="2" fill="red"/>
</svg>
cx y cy son las coordenadas del centro y r es el radio.
Elipse <ellipse>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<ellipse cx="300" cy="80" rx="100" ry="50"
style="fill:yellow;stroke:purple;stroke-width:2"/>
</svg>
cx y cy son las coordenadas del centro y rx es el radio horizontal y ry el radio vertical.
Línea <line>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<line x1="0.7cm"
y1="1cm"
x2="0.7cm"
y2="2.0cm"
style="stroke:blue;"/>
</svg>
x1,y1 representan las coordenadas del inicio de la línea y x2,y2 las del punto final.
Polilínea <polyline>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<polyline points="15, 5, 100 8,3 150"
fill="orange"
stroke="black"
stroke-width="4"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<polyline points="20,20 40,25 60,40 80,120 120,140 200,180"
style="fill:none;stroke:black;stroke-width:3" />
</svg>
Suelen ser líneas conectadas que crean una forma abierta, a la que le falta algún lado.
los puntos se marcan con parejas de x e y con la longitud.
Polígonos <polygone>
Es una forma cerrada de al menos tres lados
<polygon points="15, 5, 100 8,6 150"
fill="orange"
stroke="black"
stroke-width="4"/>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<polygon points="200,10 250,190 160,210"
style="fill:lime;stroke:purple;stroke-width:1"/>
</svg>
son las coordenadas x e y de los puntos del polígono.
si los puntos se cruzan puedes evitar que la zona rellena este vacía, mediante fill-rule.
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<polygon points="100,10 40,180 190,60 10,60 160,180"
style="fill:lime;stroke:purple;stroke-width:5;fill-rule:nonzero;" />
</svg>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<polygon points="100,10 40,180 190,60 10,60 160,180"
style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
</svg>
Texto <text>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<text x="0" y="15" fill="red">I love SVG</text>
</svg>
Texto en varias líneas
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<text x="10" y="20" style="fill:red;">Varias líneas:
<tspan x="10" y="45">Primera línea</tspan>
<tspan x="10" y="70">Segunda línea</tspan>
</text>
</svg>