From 9b79d529b091dabbe87c9771643f791bb2282c65 Mon Sep 17 00:00:00 2001 From: Benn Roth Date: Wed, 11 Jul 2018 13:53:25 -0500 Subject: [PATCH 1/2] Add knot to Ugly Tie shape Added geometry to the Ugly Tie polygon to look like a knot. It remains a single polygon so color will affect both visible parts. At large zooms/resolutions a connection between the right side of the knot and the main tie is visible because the points on right side of the knot are not perfectly in-line with the upper right corner of the tie where the two larger parts of the shape are visible. If this becomes an issue, doing some math to find evenly dividing, aligned points near the current values would make the connecting section of the polygon zero width. --- AnatomyOfMatplotlib-Part3-HowToSpeakMPL.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AnatomyOfMatplotlib-Part3-HowToSpeakMPL.ipynb b/AnatomyOfMatplotlib-Part3-HowToSpeakMPL.ipynb index d7bbf0e..70384ab 100644 --- a/AnatomyOfMatplotlib-Part3-HowToSpeakMPL.ipynb +++ b/AnatomyOfMatplotlib-Part3-HowToSpeakMPL.ipynb @@ -512,8 +512,8 @@ "source": [ "mpl.rc('axes', prop_cycle=cycler('color', ['r', 'orange', 'c', 'y']) +\n", " cycler('hatch', ['x', 'xx-', '+O.', '*']))\n", - "x = np.array([0.4, 0.2, 0.5, 0.8, 0.6])\n", - "y = [0, -5, -6, -5, 0]\n", + "x = np.array([0.7, 0.3, 0.385, 0.6153, 0.6, 0.4, 0.2, 0.5, 0.8, 0.6])\n", + "y = [0.65, 0.65, 0.1, 0.1, 0, 0, -5, -6, -5, 0]\n", "plt.fill(x+1, y)\n", "plt.fill(x+2, y)\n", "plt.fill(x+3, y)\n", From 2fd6c31b53cd05ecd77cca1118d9655a94bb5133 Mon Sep 17 00:00:00 2001 From: Benn Roth Date: Fri, 13 Jul 2018 09:27:04 -0500 Subject: [PATCH 2/2] Removed invisible connecting geometry repeated first point in 5th position to close knot shape. Added `np.nan` non-rending connection point. --- AnatomyOfMatplotlib-Part3-HowToSpeakMPL.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AnatomyOfMatplotlib-Part3-HowToSpeakMPL.ipynb b/AnatomyOfMatplotlib-Part3-HowToSpeakMPL.ipynb index 70384ab..110301a 100644 --- a/AnatomyOfMatplotlib-Part3-HowToSpeakMPL.ipynb +++ b/AnatomyOfMatplotlib-Part3-HowToSpeakMPL.ipynb @@ -512,8 +512,8 @@ "source": [ "mpl.rc('axes', prop_cycle=cycler('color', ['r', 'orange', 'c', 'y']) +\n", " cycler('hatch', ['x', 'xx-', '+O.', '*']))\n", - "x = np.array([0.7, 0.3, 0.385, 0.6153, 0.6, 0.4, 0.2, 0.5, 0.8, 0.6])\n", - "y = [0.65, 0.65, 0.1, 0.1, 0, 0, -5, -6, -5, 0]\n", + "x = np.array([0.7, 0.3, 0.385, 0.6153, 0.7, np.nan, 0.6, 0.4, 0.2, 0.5, 0.8, 0.6])\n", + "y = [0.65, 0.65, 0.1, 0.1, 0.65, np.nan, 0, 0, -5, -6, -5, 0]\n", "plt.fill(x+1, y)\n", "plt.fill(x+2, y)\n", "plt.fill(x+3, y)\n", pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy