I am doing some contour plots in matplotlib, and the dash duration is too long. The dashed line also does not look very good. I would like to manually set the length of the dash. I can set the exact stroke length when I make a simple plot using plt.plot (), however I cannot figure out how to do the same with the outline plot.
I think the following code should work, but I get an error:
File "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/backends/backend_macosx.py", line 80, in draw_path_collection offset_position) TypeError: failed to obtain the offset and dashes from the linestyle
Here is an example of what I'm trying to do, adapted from MPL examples:
import numpy as np import matplotlib.mlab as mlab import matplotlib.pyplot as plt delta = 0.025 x = np.arange(-3.0, 3.0, delta) y = np.arange(-2.0, 2.0, delta) X, Y = np.meshgrid(x, y) Z1 = mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0) Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
Thanks!
source share