I need help customizing my plots. I want the canvas to look approximately like the default 2D-graph template from MacOS’s Grapher (see screenshot).

To clarify – I need
- a centered axis
- a grid (preferably with an additional darker grid every 1 unit)
- axislines with arrows
- only one zero at the origo (when I tried my best, I got one zero from the x-axis and a second one from the y-axis.), slightly moved to the left so it’s not behind the y-axis
I really appreciate your help!
This definitely falls under the category of more trouble than it’s worth with matplotlib, but here you go. Also, for the basic case, have a look at the centering spines demo in the documentation.
You can do this in a few different ways, but for the best visual effect, consider something along the lines of the following. It’s far from perfect, but it’s reasonably flexible:
I deliberately didn’t set the x and y major tick intervals to 1, but that’s easy to do.
ax.xaxis.set_major_locator(MultipleLocator(1))Now you can just call
center_spinesto do something like this: