diff --git a/Gallery/Contours/NCL_coneff_11.py b/Gallery/Contours/NCL_coneff_11.py index 727349b4c..38a1acd9e 100644 --- a/Gallery/Contours/NCL_coneff_11.py +++ b/Gallery/Contours/NCL_coneff_11.py @@ -59,9 +59,8 @@ cmap='white') # Use white cmap to have a white background # Set the colors for the hatches -for i, collection in enumerate(p.collections): - collection.set_edgecolor(colors[i % len(colors)]) - collection.set_linewidth(0.) +p.set_edgecolors(colors) +p.set_linewidth(0.) # Set linewidth of hatches plt.rcParams['hatch.linewidth'] = 2.5 diff --git a/Gallery/Contours/NCL_hov_3.py b/Gallery/Contours/NCL_hov_3.py index 0151a8f6e..ecd7e4c24 100644 --- a/Gallery/Contours/NCL_hov_3.py +++ b/Gallery/Contours/NCL_hov_3.py @@ -67,14 +67,7 @@ levels=np.arange(-6, 12, 2), colors='black', linestyles="-", - linewidths=.2) - -# Set 0 level contour line to a thicker linewidth -# If you try to access the "levels" attribute of cs (cs.levels), -# the list of levels is: [-6, -4, -2, 0, 2, 4, 6, 8, 10] -# level 0 is at the 3rd index of that list, so those contour lines -# can be accessed at cs.collections[3] -cs.collections[3].set_linewidth(1) + linewidths=[.2, .2, .2, 1, .2, .2, .2, .2, .2]) # Label the contour levels -4, 0, and 4 cl = ax.clabel(cs, fmt='%d', levels=[-4, 0, 4])