Skip to content

Commit 9b79d52

Browse files
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.
1 parent 792dfdf commit 9b79d52

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎AnatomyOfMatplotlib-Part3-HowToSpeakMPL.ipynb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,8 @@
512512
"source": [
513513
"mpl.rc('axes', prop_cycle=cycler('color', ['r', 'orange', 'c', 'y']) +\n",
514514
" cycler('hatch', ['x', 'xx-', '+O.', '*']))\n",
515-
"x = np.array([0.4, 0.2, 0.5, 0.8, 0.6])\n",
516-
"y = [0, -5, -6, -5, 0]\n",
515+
"x = np.array([0.7, 0.3, 0.385, 0.6153, 0.6, 0.4, 0.2, 0.5, 0.8, 0.6])\n",
516+
"y = [0.65, 0.65, 0.1, 0.1, 0, 0, -5, -6, -5, 0]\n",
517517
"plt.fill(x+1, y)\n",
518518
"plt.fill(x+2, y)\n",
519519
"plt.fill(x+3, y)\n",

0 commit comments

Comments
 (0)