1

I'm trying to use sympy's plotting capabilities, but I can't find a way to modify the xticks. Is that even possible? Since, according to the documentation, sympy relies on matplotlib, I would think it is (maybe accessing the underlying matplotlib's axis), but I couldn't find an example anywhere.

A MWE:

import sympy as sp

t = sp.symbols('t')
f = sp.Piecewise((0, t < 0), (0, t > 2), (1, True))

sp.plotting.plot(f, (t, -1, 3), ylim=(0, 1.5))

# change ticks
# ....

Any hint?

Cheers.

manu
  • 1,333
  • 2
  • 11
  • 24
  • 1
    [This post](https://stackoverflow.com/a/46813804/12046409) explains how to move a plot from sympy to matplotlib. (One of the comments there explains about adaption to recent sympy versions) – JohanC May 18 '20 at 13:14
  • That did the trick!! Thank you so much!! – manu May 18 '20 at 19:50

0 Answers0