How do I change the Matplotlib axis limits for a plot given by a specific library(trackpy)?

181 Views Asked by At

This function gives me a plot. However I want to change the default axis. It says in documentation that ax refers to:

ax : matplotlib axes object, optional.

I tried to input the axis limit as ax=([0 100 0 500]) for example but it recognizes it as a tuple or a list. How is the correct way to input it?

Thanks!

1

There are 1 best solutions below

3
jwalton On

The trackpy.plot_traj functions returns a matplotlib axes object.

So, you'll want something like:

ax = trackpy.plot_traj(traj)
ax.set_xlim([0, 100])
ax.set_ylim([0, 500])