I don't know how you get the handle to the matplotlib figure but there should be some way to do it.
On Mon, 21 Nov 2022 at 14:01, Антон Макаров <[email protected]> wrote: > > Thank you for answer. As far as I can understand the p1 variable in my sample > code is the object of mathplotlib library, right? > > > > Отправлено из мобильной Почты Mail.ru > > > понедельник, 21 ноября 2022 г., 16:51 +0300 от [email protected] > <[email protected]>: > > SymPy's save function is just using matplotlib so the question is not > really about SymPy but about matplotlib: > https://stackoverflow.com/questions/5453375/matplotlib-svg-as-string-and-not-a-file > > Oscar > > On Mon, 21 Nov 2022 at 10:57, Anton Makarov <[email protected]> wrote: > > > > Hi, i need to save figure from svg plotting module as svg string in order to > > insert it latter in my web application. At the moment i can only save plot > > as svg file: > > > > from sympy import symbols > > from sympy.plotting import plot > > > > x = symbols('x') > > p1 = plot(x, x**2, x**3, (x, 0, 6), show = False) > > p1.save("img123.svg") > > > > How can i save plot to get the svg string (P.S. i don't want to read the > > file "img123.svg" to get the svg string, i need to get it without creating > > temporary file)... > > > > -- > > 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 [email protected]. > > To view this discussion on the web visit > > https://groups.google.com/d/msgid/sympy/c65df323-b088-4cd3-9234-0381822eb686n%40googlegroups.com. > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/CAHVvXxQm3J56rg%2BR1mfiYxRXzS%3DLSJu2H912zaHkGL5MPr2FmQ%40mail.gmail.com. > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/1669039248.989992473%40f727.i.mail.ru. -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAHVvXxQtHZBQNZhBweZtifgEOOVtkXrAKxVFVMDSnqsKkkYcog%40mail.gmail.com.
