I don't want an svg file, i want the string. Something like this:
svg_string = <svg width="134" height="32" viewBox="-1 -1 134 32"><path d="M 
0 14.3 L 7.169531 14.3 " fill="none" stroke="rgb(0,0,0)" 
stroke-width="1"></path><text x="0" y="9.962011" font-family="'Segoe UI'" 
font-size="13.3" textLength="7.169531" fill="rgb(0,0,0)">5</text><text 
x="0" y="26.26201" font-family="'Segoe UI'" font-size="13.3" 
textLength="7.169531" fill="rgb(0,0,0)">3</text><path d="M 11 15 L 21 15 " 
fill="none" stroke="rgb(0,0,0)" stroke-width="1"></path><path d="M 16 9.8 L 
16 19.8 " fill="none" stroke="rgb(0,0,0)" stroke-width="1"></path><text 
style="font-style: italic" x="25.16953" y="18.28633" font-family="'Segoe 
UI'" font-size="14" textLength="6.371094" fill="rgb(0,0,0)">x</text><path 
d="M 36 15 L 46 15 " fill="none" stroke="rgb(0,0,0)" 
stroke-width="1"></path><path d="M 41 9.8 L 41 19.8 " fill="none" 
stroke="rgb(0,0,0)" stroke-width="1"></path><path d="M 49.54063 14.3 L 
56.71016 14.3 " fill="none" stroke="rgb(0,0,0)" 
stroke-width="1"></path><text x="49.54063" y="9.962011" font-family="'Segoe 
UI'" font-size="13.3" textLength="7.169531" fill="rgb(0,0,0)">5</text><text 
style="font-style: italic" x="50.09912" y="26.26201" font-family="'Segoe 
UI'" font-size="13.3" textLength="6.052539" fill="rgb(0,0,0)">x</text><path 
d="M 61 15 L 71 15 " fill="none" stroke="rgb(0,0,0)" 
stroke-width="1"></path><path d="M 66 9.8 L 66 19.8 " fill="none" 
stroke="rgb(0,0,0)" stroke-width="1"></path><text x="74.71016" y="18.28633" 
font-family="'Segoe UI'" font-size="14" textLength="7.546875" 
fill="rgb(0,0,0)">3</text><rect x="85.25703" y="14.8" width="1" height="1" 
fill="none" stroke="rgb(0,0,0)" stroke-width="1"></rect><text x="89.25703" 
y="18.28633" font-family="'Segoe UI'" font-size="14" textLength="17.25391" 
fill="rgb(0,0,255)">sin</text><path d="M 115 8 A 4 7 0 0 0 115 22" 
fill="none" stroke="rgb(0,100,0)" stroke-width="1"></path><text 
style="font-style: italic" x="116.173" y="18.28633" font-family="'Segoe 
UI'" font-size="14" textLength="6.371094" fill="rgb(0,0,0)">x</text><path 
d="M 124 22 A 4 7 0 0 0 124 8" fill="none" stroke="rgb(0,100,0)" 
stroke-width="1"></path></svg>

четверг, 17 ноября 2022 г. в 17:01:56 UTC+3, Anton Makarov: 

> I need to convert sympy tree expression to svg, for instance:
> a = sympify("1+2/3")
> b = sympify("x+5/x+3*sin(x)")
> c = a + b
> and i need to convert c expression to svg string
>
>
>
>
> четверг, 17 ноября 2022 г. в 16:59:38 UTC+3, gu...@uwosh.edu: 
>
>> Are you trying to convert typeset math into a scalable vector graphic 
>> image (.svg) or do you mean something else?
>>
>> On Thursday, November 17, 2022 at 7:54:48 AM UTC-6 antonv...@gmail.com 
>> wrote:
>>
>>> I'm taking about result of calculations, for instance:
>>> expr = sympify("1+2/3*sin(x)")
>>> result = str(expr)
>>> and i need to convert result to svg. How can i do this?
>>>
>>>
>>> четверг, 17 ноября 2022 г. в 15:05:17 UTC+3, Anton Makarov: 
>>>
>>>> Hi, i am new to sympy. I need to convert the results of sympy 
>>>> calculations to svg string.
>>>> How can i do this?
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/efca067d-018d-4e49-ac2c-678a1c801637n%40googlegroups.com.

Reply via email to