Before | After |
---|---|
Added clip_on = False
to plot
.
demo.py
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(4)
y = np.cos(x)
plt.plot(x, y, "o-", clip_on=False)
plt.xlim(0, 3)
plt.ylim(-1, 1)
With clip_on = False
, if you make a mistake in specifying the range, this will happen. In other words, clip_on = False
is in a state where it is OK to stick out.
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(10)
y = np.cos(x)
plt.plot(x, y, "o-", clip_on=False)
plt.xlim(0, 3)
plt.ylim(-1, 1)
python - How do I let my matplotlib plot go beyond the axes? - Stack Overflow http://stackoverflow.com/questions/9912206/how-do-i-let-my-matplotlib-plot-go-beyond-the-axes
Recommended Posts