4

Python: How to export Sympy image to png?

Who has any idea with this?

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900
user469652
  • 48,855
  • 59
  • 128
  • 165

1 Answers1

2

Use the saveimage method:

import sympy
x, y, z = sympy.symbols('xyz')
p = sympy.Plot(x * y ** 3 - y * x ** 3)
p.saveimage('/tmp/plot.png', format='png')
Mike Graham
  • 73,987
  • 14
  • 101
  • 130
unutbu
  • 842,883
  • 184
  • 1,785
  • 1,677