I have the same problem presented here , however the proposed solution did not work for me.
I am drawing a dataset that have a main drawing:

What is a graph whose axis boundaries vary from (-1, 1) in both x and y, with a margin set up with this piece of code:
plt.figure() plt.show(data) ## Add some margin l, r, b, t = plt.axis() dx, dy = rl, tb plt.axis([l-0.1*dx, r+0.1*dx, b-0.1*dy, t+0.1*dy])
The problem is that I have a more βcomplexβ plot in which some changes were made by me. This is the code that produces it:
def plot_quiver_singularities(min_points, max_points, vector_field_x, vector_field_y, file_path): """ Plot the singularities of vector field :param file_path : the path to save the data :param vector_field_x : the vector field x component to be plot :param vector_field_y : the vector field y component to be plot :param min_points : a set (x, y) of min points field :param max_points : a set (x, y) of max points field """ fig = plt.figure(figsize=(8, 8)) ax = fig.add_axes([.13, .3, .6, .6])
This creates the following image:

As you can see, the axis limits are not saved, and so far I have not found a reason.
Any help would be appreciated.
Thanks in advance.