From 6df262b1e2381d09e7cfa3037841cdf6148b82d4 Mon Sep 17 00:00:00 2001 From: Cyrille Bonamy Date: Tue, 4 Feb 2020 14:17:41 +0100 Subject: [PATCH] update example --- examples/plot_contour_unstructured.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/examples/plot_contour_unstructured.py b/examples/plot_contour_unstructured.py index 2b7f808..0756d3b 100644 --- a/examples/plot_contour_unstructured.py +++ b/examples/plot_contour_unstructured.py @@ -71,8 +71,8 @@ ############################################################################### -# Plots the contour of the interpolted scalarfield phi and add a patch -# -------------------------------------------------------------------- +# Plots the contour of the interpolted scalarfield phi, streamlines and a patch +# ----------------------------------------------------------------------------- # # .. note:: The scalar field phi reprensents the concentration of sediment in # in a 2D two-phase flow simulation of erosion below a pipeline @@ -94,14 +94,10 @@ levels = np.arange(0.1, 0.63, 0.001) plt.contourf(xi/d, yi/d, phi_i, cmap=plt.cm.Reds, levels=levels) - -############################################################################### -# Calculates and adds the streamlines on the same plot -# ---------------------------------------------------- -# # Calculation of the streamline width as a function of the velociy magnitude vel_i = np.sqrt(velx_i**2 + vely_i**2) lw = pow(vel_i, 1.5)/vel_i.max() +# Plots the streamlines plt.streamplot(xi/d, yi/d, velx_i, vely_i, color='C0', density=[2, 1], linewidth=lw, arrowsize=0.05)