diff --git a/.idea/.gitignore b/.idea/.gitignore index 3fb4ad6c..27ba71a8 100644 --- a/.idea/.gitignore +++ b/.idea/.gitignore @@ -6,3 +6,10 @@ /dataSources.local.xml # Editor-based HTTP Client requests /httpRequests/ +# Computer-specific configurations [1] +.idea/misc.xml +.idea/other.xml +Python.iml + +# References: +# 1. https://gitbook.tw/chapters/using-git/ignore diff --git a/.idea/encodings.xml b/.idea/encodings.xml index b1722402..bbd4ca1f 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -2,6 +2,11 @@ + + + + + diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index d1a816be..b1e3cb5f 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -2,14 +2,5 @@ \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 357fb3d8..571c616b 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,9 +1,12 @@ + + - + diff --git a/.idea/other.xml b/.idea/other.xml index 640fd80b..ae2fc2eb 100644 --- a/.idea/other.xml +++ b/.idea/other.xml @@ -3,5 +3,6 @@ \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 00000000..f5f27444 --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 2.ipynb b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 2.ipynb new file mode 100644 index 00000000..abc77f45 --- /dev/null +++ b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 2.ipynb @@ -0,0 +1,309 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "source": [ + "It's important to enclose every key's value even if the key has only one value.\n", + "\n", + "This is because Python permits accessing a character in a string, e.g." + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "code", + "execution_count": 1, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "o\n" + ] + } + ], + "source": [ + "my_string = \"Hello World\"\n", + "\n", + "print(my_string[4])" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "markdown", + "source": [ + "As a result, in the following case, if a key's value is not enclosed in a pair of brackets,\n", + "Python interpreter might think you want to access individual character in a string during\n", + "the iteration when you do not." + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "code", + "execution_count": 2, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Wasim', 'Nick', 'Mike']\n" + ] + }, + { + "ename": "KeyError", + "evalue": "'A'", + "output_type": "error", + "traceback": [ + "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[1;31mKeyError\u001B[0m Traceback (most recent call last)", + "Cell \u001B[1;32mIn[2], line 34\u001B[0m\n\u001B[0;32m 29\u001B[0m queue\u001B[38;5;241m.\u001B[39mappend(neighbour)\n\u001B[0;32m 31\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m visited\n\u001B[1;32m---> 34\u001B[0m \u001B[38;5;28mprint\u001B[39m(\u001B[43mbfs\u001B[49m\u001B[43m(\u001B[49m\u001B[43mgraph\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mGraph\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mstart\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[38;5;124;43mAmin\u001B[39;49m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[43m)\u001B[49m)\n", + "Cell \u001B[1;32mIn[2], line 24\u001B[0m, in \u001B[0;36mbfs\u001B[1;34m(graph, start)\u001B[0m\n\u001B[0;32m 22\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m node \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;129;01min\u001B[39;00m visited:\n\u001B[0;32m 23\u001B[0m visited\u001B[38;5;241m.\u001B[39mappend(node)\n\u001B[1;32m---> 24\u001B[0m neighbours \u001B[38;5;241m=\u001B[39m \u001B[43mgraph\u001B[49m\u001B[43m[\u001B[49m\u001B[43mnode\u001B[49m\u001B[43m]\u001B[49m \u001B[38;5;66;03m# Use neighbors to represent the node's directly connected nodes.\u001B[39;00m\n\u001B[0;32m 26\u001B[0m \u001B[38;5;66;03m# Now, add the node's neighbours one by one to the queue.\u001B[39;00m\n\u001B[0;32m 27\u001B[0m \u001B[38;5;28;01mfor\u001B[39;00m neighbour \u001B[38;5;129;01min\u001B[39;00m neighbours:\n", + "\u001B[1;31mKeyError\u001B[0m: 'A'" + ] + } + ], + "source": [ + "# Adjacency list\n", + "Graph = {\"Amin\": [\"Wasim\", \"Nick\", \"Mike\"],\n", + " \"Wasim\": [\"Imran\", \"Amin\"],\n", + " \"Nick\": \"Amin\",\n", + " \"Mike\": \"Amin\",\n", + " \"Imran\": [\"Wasim\", \"Faras\"],\n", + " \"Faras\": \"Imran\"\n", + " }\n", + "\n", + "print(Graph[\"Amin\"])\n", + "\n", + "def bfs(graph, start):\n", + " visited = [] # This contains all the vertices that have been visited. Initially, it will be empty.\n", + " visited.append(start)\n", + "\n", + " queue = graph[start] # This contains all the vertices that we have want to visit in next iterations.\n", + "\n", + " # Check if there exists even a single element in the queue.\n", + " while queue:\n", + " # Pop the first node from the queue and chose that node as the current node of this iteration.\n", + " node = queue.pop(0)\n", + " if node not in visited:\n", + " visited.append(node)\n", + " neighbours = graph[node] # Use neighbors to represent the node's directly connected nodes.\n", + "\n", + " # Now, add the node's neighbours one by one to the queue.\n", + " for neighbour in neighbours:\n", + " if neighbour not in visited: # To prevent graph[start] from being added again.\n", + " queue.append(neighbour)\n", + "\n", + " return visited\n", + "\n", + "\n", + "print(bfs(graph=Graph, start=\"Amin\"))" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "markdown", + "source": [ + "This time, enclose every dictionary key's value even if the key has only one value." + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "code", + "execution_count": 3, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Wasim', 'Nick', 'Mike']\n", + "['Amin', 'Wasim', 'Nick', 'Mike', 'Imran', 'Faras']\n" + ] + } + ], + "source": [ + "# Adjacency list\n", + "Graph = {\"Amin\": [\"Wasim\", \"Nick\", \"Mike\"],\n", + " \"Wasim\": [\"Imran\", \"Amin\"],\n", + " \"Nick\": [\"Amin\"],\n", + " \"Mike\": [\"Amin\"],\n", + " \"Imran\": [\"Wasim\", \"Faras\"],\n", + " \"Faras\": [\"Imran\"]\n", + " }\n", + "\n", + "print(Graph[\"Amin\"])\n", + "\n", + "def bfs(graph, start):\n", + " visited = [] # This contains all the vertices that have been visited. Initially, it will be empty.\n", + " visited.append(start)\n", + "\n", + " queue = graph[start] # This contains all the vertices that we have want to visit in next iterations.\n", + "\n", + " # Check if there exists even a single element in the queue.\n", + " while queue:\n", + " # Pop the first node from the queue and chose that node as the current node of this iteration.\n", + " node = queue.pop(0)\n", + " if node not in visited:\n", + " visited.append(node)\n", + " neighbours = graph[node] # Use neighbors to represent the node's directly connected nodes.\n", + "\n", + " # Now, add the node's neighbours one by one to the queue.\n", + " for neighbour in neighbours:\n", + " if neighbour not in visited: # To prevent graph[start] from being added again.\n", + " queue.append(neighbour)\n", + "\n", + " return visited\n", + "\n", + "\n", + "print(bfs(graph=Graph, start=\"Amin\"))" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "markdown", + "source": [ + "# Let's do an aptitude test by feeding the program some more test cases.\n", + "Let's make the program an aptitude test by feeding it some more test cases." + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "code", + "execution_count": 4, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[4, 2, 8, 1, 3, 5, 10]\n" + ] + } + ], + "source": [ + "# Adjacency list\n", + "graph = {4: [2, 8],\n", + " 2: [4, 1, 3],\n", + " 8: [4, 5, 10],\n", + " 1: [2], # [] is added in order to align the format with other elements in this dict.\n", + " 3: [2],\n", + " 5: [8],\n", + " 10: [8]\n", + " }\n", + "\n", + "print(bfs(graph=graph, start=4))" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "code", + "execution_count": 5, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['A', 'B', 'S', 'C', 'G', 'D', 'E', 'F', 'H']\n" + ] + } + ], + "source": [ + "graph = {'A': ['B', 'S'],\n", + " 'B': ['A'],\n", + " 'S': ['A', 'C', 'G'],\n", + " 'C': ['S', 'D', 'E', 'F'],\n", + " 'D': ['C'],\n", + " 'E': ['C'],\n", + " 'F': ['C', 'G'],\n", + " 'G': ['S', 'F', 'H'],\n", + " 'H': ['G']\n", + " }\n", + "\n", + "print(bfs(graph, 'A'))" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "markdown", + "source": [ + "Graph below: https://www.youtube.com/watch?v=iaBEKo5sM7w" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "code", + "execution_count": 6, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['A', 'B', 'S', 'C', 'G', 'D', 'E', 'F', 'H']\n" + ] + } + ], + "source": [ + "graph = {'A': ['B', 'S'],\n", + " 'B': ['A'],\n", + " 'S': ['A', 'C', 'G'],\n", + " 'C': ['S', 'D', 'E', 'F'],\n", + " 'D': ['C'],\n", + " 'E': ['C', 'H'],\n", + " 'F': ['C', 'G'],\n", + " 'G': ['S', 'F', 'H'],\n", + " 'H': ['G', 'E']\n", + " }\n", + "\n", + "print(bfs(graph=graph, start='A'))" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "markdown", + "source": [], + "metadata": { + "collapsed": false + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 2.py b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 2.py new file mode 100644 index 00000000..2ffc060e --- /dev/null +++ b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 2.py @@ -0,0 +1,33 @@ + + +# Adjacency list +Graph = {"Amin": ["Wasim", "Nick", "Mike"], + "Wasim": ["Imran", "Amin"], + "Nick": "Amin", + "Mike": "Amin", + "Imran": ["Wasim", "Faras"], + "Faras": "Imran" + } + +print(Graph["Amin"]) + +def bfs(graph, start): + visited = [] # This contains all the vertices that have been visited. Initially, it will be empty. + queue = graph[start] # This contains all the vertices that we have want to visit in next iterations. + + # Check if there exists even a single element in the queue. + while queue: + # Pop the first node from the queue and chose that node as the current node of this iteration. + node = queue.pop(0) + if node not in visited: + visited.append(node) + neighbours = graph[node] # Use neighbors to represent the node's directly connected nodes. + + # Now, add the node's neighbours one by one to the queue. + for neighbour in neighbours: + queue.append(neighbour) + + return visited + + +bfs(graph=Graph, start="Amin") diff --git a/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 3.py b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 3.py new file mode 100644 index 00000000..26a4e107 --- /dev/null +++ b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 3.py @@ -0,0 +1,33 @@ + + +# Adjacency list +Graph = {"Amin": {"Wasim", "Nick", "Mike"}, + "Wasim": {"Imran", "Amin"}, + "Nick": "Amin", + "Mike": "Amin", + "Imran": {"Wasim", "Faras"}, + "Faras": "Imran" + } + +print(Graph["Amin"]) + +def bfs(graph, start): + visited = [] # This contains all the vertices that have been visited. Initially, it will be empty. + queue = [start] # This contains all the vertices that we have want to visit in next iterations. + + # Check if there exists even a single element in the queue. + while queue: + # Pop the first node from the queue and chose that node as the current node of this iteration. + node = queue.pop(0) + if node not in visited: + visited.append(node) + neighbours = graph[node] # Use neighbors to represent the node's directly connected nodes. + + # Now, add the node's neighbours one by one to the queue. + for neighbour in neighbours: + queue.append(neighbour) + + return visited + + +bfs(graph=Graph, start="Amin") diff --git a/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 4.py b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 4.py new file mode 100644 index 00000000..ea9cda0f --- /dev/null +++ b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 4.py @@ -0,0 +1,33 @@ + + +# Adjacency list +Graph = {'Amin': {'Wasim', 'Nick', 'Mike'}, + 'Wasim': {'Imran', 'Amin'}, + 'Nick': 'Amin', + 'Mike': 'Amin', + 'Imran': {'Wasim', 'Faras'}, + 'Faras': 'Imran' + } + +print(Graph["Amin"]) + +def bfs(graph, start): + visited = [] # This contains all the vertices that have been visited. Initially, it will be empty. + queue = [start] # This contains all the vertices that we have want to visit in next iterations. + + # Check if there exists even a single element in the queue. + while queue: + # Pop the first node from the queue and chose that node as the current node of this iteration. + node = queue.pop(0) + if node not in visited: + visited.append(node) + neighbours = graph[node] # Use neighbors to represent the node's directly connected nodes. + + # Now, add the node's neighbours one by one to the queue. + for neighbour in neighbours: + queue.append(neighbour) + + return visited + + +bfs(graph=Graph, start="Amin") diff --git a/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 5.py b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 5.py new file mode 100644 index 00000000..c76a2aa3 --- /dev/null +++ b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 5.py @@ -0,0 +1,33 @@ + + +# Adjacency list +Graph = {'Amin': {'Wasim', 'Nick', 'Mike'}, + 'Wasim': {'Imran', 'Amin'}, + 'Nick': 'Amin', + 'Mike': 'Amin', + 'Imran': {'Wasim', 'Faras'}, + 'Faras': 'Imran' + } + +print(Graph["Amin"]) + +def bfs(graph, start): + visited = [] # This contains all the vertices that have been visited. Initially, it will be empty. + queue = [start] # This contains all the vertices that we have want to visit in next iterations. + + # Check if there exists even a single element in the queue. + while queue: + # Pop the first node from the queue and chose that node as the current node of this iteration. + node = queue.pop(0) + if node not in visited: + visited.append(node) + neighbours = graph[node] # Use neighbors to represent the node's directly connected nodes. + + # Now, add the node's neighbours one by one to the queue. + for neighbour in neighbours: + queue.append(neighbour) + + return visited + + +bfs(graph=Graph, start='Amin') diff --git a/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 6.py b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 6.py new file mode 100644 index 00000000..0c616e9c --- /dev/null +++ b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 6.py @@ -0,0 +1,33 @@ + + +# Adjacency list +Graph = {"Amin": ("Wasim", "Nick", "Mike"), + "Wasim": ("Imran", "Amin"), + "Nick": "Amin", + "Mike": "Amin", + "Imran": ("Wasim", "Faras"), + "Faras": "Imran" + } + +print(Graph["Amin"]) + +def bfs(graph, start): + visited = [] # This contains all the vertices that have been visited. Initially, it will be empty. + queue = graph[start] # This contains all the vertices that we have want to visit in next iterations. + + # Check if there exists even a single element in the queue. + while queue: + # Pop the first node from the queue and chose that node as the current node of this iteration. + node = queue.pop(0) + if node not in visited: + visited.append(node) + neighbours = graph[node] # Use neighbors to represent the node's directly connected nodes. + + # Now, add the node's neighbours one by one to the queue. + for neighbour in neighbours: + queue.append(neighbour) + + return visited + + +bfs(graph=Graph, start="Amin") diff --git a/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 7.py b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 7.py new file mode 100644 index 00000000..bef1849d --- /dev/null +++ b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 7.py @@ -0,0 +1,36 @@ + + +# Adjacency list +Graph = {"Amin": ["Wasim", "Nick", "Mike"], + "Wasim": ["Imran", "Amin"], + "Nick": "Amin", + "Mike": "Amin", + "Imran": ["Wasim", "Faras"], + "Faras": "Imran" + } + +print(Graph["Amin"]) + +def bfs(graph, start): + visited = [] # This contains all the vertices that have been visited. Initially, it will be empty. + visited.append(start) + + queue = graph[start] # This contains all the vertices that we have want to visit in next iterations. + + # Check if there exists even a single element in the queue. + while queue: + # Pop the first node from the queue and chose that node as the current node of this iteration. + node = queue.pop(0) + if node not in visited: + visited.append(node) + neighbours = graph[node] # Use neighbors to represent the node's directly connected nodes. + + # Now, add the node's neighbours one by one to the queue. + for neighbour in neighbours: + if neighbour not in visited: # To prevent graph[start] from being added again. + queue.append(neighbour) + + return visited + + +bfs(graph=Graph, start="Amin") diff --git a/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 8.py b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 8.py new file mode 100644 index 00000000..88c8bf2e --- /dev/null +++ b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 8.py @@ -0,0 +1,36 @@ + + +# Adjacency list +Graph = {"Amin": ["Wasim", "Nick", "Mike"], + "Wasim": ["Imran", "Amin"], + "Nick": ["Amin"], + "Mike": ["Amin"], + "Imran": ["Wasim", "Faras"], + "Faras": ["Imran"] + } + +print(Graph["Amin"]) + +def bfs(graph, start): + visited = [] # This contains all the vertices that have been visited. Initially, it will be empty. + visited.append(start) + + queue = graph[start] # This contains all the vertices that we have want to visit in next iterations. + + # Check if there exists even a single element in the queue. + while queue: + # Pop the first node from the queue and chose that node as the current node of this iteration. + node = queue.pop(0) + if node not in visited: + visited.append(node) + neighbours = graph[node] # Use neighbors to represent the node's directly connected nodes. + + # Now, add the node's neighbours one by one to the queue. + for neighbour in neighbours: + if neighbour not in visited: # To prevent graph[start] from being added again. + queue.append(neighbour) + + return visited + + +bfs(graph=Graph, start="Amin") diff --git a/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 9.py b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 9.py new file mode 100644 index 00000000..8edb7fb1 --- /dev/null +++ b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search 9.py @@ -0,0 +1,36 @@ + + +# Adjacency list +Graph = {"Amin": ["Wasim", "Nick", "Mike"], + "Wasim": ["Imran", "Amin"], + "Nick": ["Amin"], + "Mike": ["Amin"], + "Imran": ["Wasim", "Faras"], + "Faras": ["Imran"] + } + +print(Graph["Amin"]) + +def bfs(graph, start): + visited = [] # This contains all the vertices that have been visited. Initially, it will be empty. + visited.append(start) + + queue = graph[start] # This contains all the vertices that we have want to visit in next iterations. + + # Check if there exists even a single element in the queue. + while queue: + # Pop the first node from the queue and chose that node as the current node of this iteration. + node = queue.pop(0) + if node not in visited: + visited.append(node) + neighbours = graph[node] # Use neighbors to represent the node's directly connected nodes. + + # Now, add the node's neighbours one by one to the queue. + for neighbour in neighbours: + if neighbour not in visited: # To prevent graph[start] from being added again. + queue.append(neighbour) + + return visited + + +print(bfs(graph=Graph, start="Amin")) diff --git a/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search.ipynb b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search.ipynb new file mode 100644 index 00000000..53512cf1 --- /dev/null +++ b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search.ipynb @@ -0,0 +1,145 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [ + { + "ename": "AttributeError", + "evalue": "'tuple' object has no attribute 'pop'", + "output_type": "error", + "traceback": [ + "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[1;31mAttributeError\u001B[0m Traceback (most recent call last)", + "Cell \u001B[1;32mIn[1], line 28\u001B[0m\n\u001B[0;32m 23\u001B[0m queue\u001B[38;5;241m.\u001B[39mappend(neighbour)\n\u001B[0;32m 25\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m visited\n\u001B[1;32m---> 28\u001B[0m \u001B[43mbfs\u001B[49m\u001B[43m(\u001B[49m\u001B[43mgraph\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mGraph\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mstart\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[38;5;124;43mAmin\u001B[39;49m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[43m)\u001B[49m\n", + "Cell \u001B[1;32mIn[1], line 16\u001B[0m, in \u001B[0;36mbfs\u001B[1;34m(graph, start)\u001B[0m\n\u001B[0;32m 13\u001B[0m \u001B[38;5;66;03m# Check if there exists even a single element in the queue.\u001B[39;00m\n\u001B[0;32m 14\u001B[0m \u001B[38;5;28;01mwhile\u001B[39;00m queue:\n\u001B[0;32m 15\u001B[0m \u001B[38;5;66;03m# Pop the first node from the queue and chose that node as the current node of this iteration.\u001B[39;00m\n\u001B[1;32m---> 16\u001B[0m node \u001B[38;5;241m=\u001B[39m \u001B[43mqueue\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mpop\u001B[49m(\u001B[38;5;241m0\u001B[39m)\n\u001B[0;32m 17\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m node \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;129;01min\u001B[39;00m visited:\n\u001B[0;32m 18\u001B[0m visited\u001B[38;5;241m.\u001B[39mappend(node)\n", + "\u001B[1;31mAttributeError\u001B[0m: 'tuple' object has no attribute 'pop'" + ] + } + ], + "source": [ + "Graph = {\"Amin\": (\"Wasim\", \"Nick\", \"Mike\"),\n", + " \"Wasim\": (\"Imran\", \"Amin\"),\n", + " \"Nick\": \"Amin\",\n", + " \"Mike\": \"Amin\",\n", + " \"Imran\": (\"Wasim\", \"Faras\"),\n", + " \"Faras\": \"Imran\"\n", + " }\n", + "\n", + "def bfs(graph, start):\n", + " visited = [] # This contains all the vertices that have been visited. Initially, it will be empty.\n", + " queue = graph[start] # This contains all the vertices that we have want to visit in next iterations.\n", + "\n", + " # Check if there exists even a single element in the queue.\n", + " while queue:\n", + " # Pop the first node from the queue and chose that node as the current node of this iteration.\n", + " node = queue.pop(0)\n", + " if node not in visited:\n", + " visited.append(node)\n", + " neighbours = graph[node] # Use neighbors to represent the node's directly connected nodes.\n", + "\n", + " # Now, add the node's neighbours one by one to the queue.\n", + " for neighbour in neighbours:\n", + " queue.append(neighbour)\n", + "\n", + " return visited\n", + "\n", + "\n", + "bfs(graph=Graph, start=\"Amin\")" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Wasim', 'Nick', 'Mike']\n" + ] + }, + { + "ename": "MemoryError", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[1;31mMemoryError\u001B[0m Traceback (most recent call last)", + "Cell \u001B[1;32mIn[2], line 31\u001B[0m\n\u001B[0;32m 26\u001B[0m queue\u001B[38;5;241m.\u001B[39mappend(neighbour)\n\u001B[0;32m 28\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m visited\n\u001B[1;32m---> 31\u001B[0m \u001B[43mbfs\u001B[49m\u001B[43m(\u001B[49m\u001B[43mgraph\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mGraph\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mstart\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[38;5;124;43mAmin\u001B[39;49m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[43m)\u001B[49m\n", + "Cell \u001B[1;32mIn[2], line 26\u001B[0m, in \u001B[0;36mbfs\u001B[1;34m(graph, start)\u001B[0m\n\u001B[0;32m 24\u001B[0m \u001B[38;5;66;03m# Now, add the node's neighbours one by one to the queue.\u001B[39;00m\n\u001B[0;32m 25\u001B[0m \u001B[38;5;28;01mfor\u001B[39;00m neighbour \u001B[38;5;129;01min\u001B[39;00m neighbours:\n\u001B[1;32m---> 26\u001B[0m \u001B[43mqueue\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mappend\u001B[49m\u001B[43m(\u001B[49m\u001B[43mneighbour\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 28\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m visited\n", + "\u001B[1;31mMemoryError\u001B[0m: " + ] + } + ], + "source": [ + "\n", + "# Adjacency list\n", + "Graph = {\"Amin\": [\"Wasim\", \"Nick\", \"Mike\"],\n", + " \"Wasim\": [\"Imran\", \"Amin\"],\n", + " \"Nick\": \"Amin\",\n", + " \"Mike\": \"Amin\",\n", + " \"Imran\": [\"Wasim\", \"Faras\"],\n", + " \"Faras\": \"Imran\"\n", + " }\n", + "\n", + "print(Graph[\"Amin\"])\n", + "\n", + "def bfs(graph, start):\n", + " visited = [] # This contains all the vertices that have been visited. Initially, it will be empty.\n", + " queue = graph[start] # This contains all the vertices that we have want to visit in next iterations.\n", + "\n", + " # Check if there exists even a single element in the queue.\n", + " while queue:\n", + " # Pop the first node from the queue and chose that node as the current node of this iteration.\n", + " node = queue.pop(0)\n", + " if node not in visited:\n", + " visited.append(node)\n", + " neighbours = graph[node] # Use neighbors to represent the node's directly connected nodes.\n", + "\n", + " # Now, add the node's neighbours one by one to the queue.\n", + " for neighbour in neighbours:\n", + " queue.append(neighbour)\n", + "\n", + " return visited\n", + "\n", + "\n", + "bfs(graph=Graph, start=\"Amin\")\n" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "markdown", + "source": [], + "metadata": { + "collapsed": false + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search.py b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search.py new file mode 100644 index 00000000..89149a20 --- /dev/null +++ b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Breadth-first search.py @@ -0,0 +1,31 @@ + + +# Adjacency list +Graph = {"Amin": ["Wasim", "Nick", "Mike"], + "Wasim": ["Imran", "Amin"], + "Nick": "Amin", + "Mike": "Amin", + "Imran": ["Wasim", "Faras"], + "Faras": "Imran" + } + +def bfs(graph, start): + visited = [] # This contains all the vertices that have been visited. Initially, it will be empty. + queue = [start] # This contains all the vertices that we have want to visit in next iterations. + + # Check if there exists even a single element in the queue. + while queue: + # Pop the first node from the queue and chose that node as the current node of this iteration. + node = queue.pop(0) + if node not in visited: + visited.append(node) + neighbours = graph[node] # Use neighbors to represent the node's directly connected nodes. + + # Now, add the node's neighbours one by one to the queue. + for neighbour in neighbours: + queue.append(neighbour) + + return visited + + +bfs(graph=Graph, start="Amin") diff --git a/40 Algorithms Every Programmer Should Know/Graph Algorithms/Calculating centrality metrics.py b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Calculating centrality metrics.py new file mode 100644 index 00000000..60c064d6 --- /dev/null +++ b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Calculating centrality metrics.py @@ -0,0 +1,14 @@ +import networkx as nx +import matplotlib.pyplot as plt + +vertices = range(1, 10) + +edges = [(7, 2), (2, 3), (7, 4), (4, 5), (7, 3), (7, 5), (1, 6), (1, 7), (2, 8), (2, 9)] + +graph = nx.Graph() +graph.add_nodes_from(vertices) +graph.add_edges_from(edges) + +nx.draw(graph, with_labels=True, node_color='y', node_size=800) + +plt.show() diff --git a/40 Algorithms Every Programmer Should Know/Graph Algorithms/Depth-first search 2.py b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Depth-first search 2.py new file mode 100644 index 00000000..df7b36fe --- /dev/null +++ b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Depth-first search 2.py @@ -0,0 +1,24 @@ +def dfs(graph, start, visited=None): + if visited is None: + visited = [] + + visited.append(start) + print(start) + + for next in graph[start] - visited: + dfs(graph=graph, start=next, visited=visited) + + return visited + + +# Adjacency list +graph = {"Amin": ['Wasim', 'Nick', "Mike"], + "Wasim": ['Amin', 'Imran'], + "Nick": ['Amin'], + "Mike": ['Amin'], + 'Imran': ['Wasim', 'Faras'], + 'Faras': ['Imran'] + } + + +print(dfs(graph=graph, start='Amin', visited=None)) diff --git a/40 Algorithms Every Programmer Should Know/Graph Algorithms/Depth-first search 3.py b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Depth-first search 3.py new file mode 100644 index 00000000..04de175b --- /dev/null +++ b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Depth-first search 3.py @@ -0,0 +1,37 @@ +# Acclimatizing breadth-first search to depth-first search +# by replacing queue with stack +def dfs(graph, start): + visited = [] # This contains all the vertices that have been visited. Initially, it will be empty. + visited.append(start) + + stack = graph[start] # This contains all the vertices that we have & want to visit in next iterations. + + # Check if there exists even a single element in the stack. + while stack: + # Pop the top node in the stack and chose that node as the current node of this iteration. + node = stack.pop() + if node not in visited: + visited.append(node) + neighbours = graph[node] # Use neighbors to represent the node's directly connected nodes. + + # Now, add the node's neighbours one by one to the stack. + for neighbour in neighbours: + if neighbour not in visited: # To prevent graph[start] from being added again. + stack.append(neighbour) + + return visited + + +# Adjacency list +graph = {"Amin": ['Wasim', 'Nick', "Mike"], + "Wasim": ['Amin', 'Imran'], + "Nick": ['Amin'], + "Mike": ['Amin'], + 'Imran': ['Wasim', 'Faras'], + 'Faras': ['Imran'] + } + + +print(graph['Amin']) + +print(dfs(graph=graph, start='Amin')) diff --git a/40 Algorithms Every Programmer Should Know/Graph Algorithms/Depth-first search.ipynb b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Depth-first search.ipynb new file mode 100644 index 00000000..0638b8cc --- /dev/null +++ b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Depth-first search.ipynb @@ -0,0 +1,162 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "source": [ + "# Let's have the program do an aptitude test by feeding it some more test cases.\n", + "Let's make an aptitude test for the program by feeding it some more test cases." + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[4, 8, 10, 5, 2, 3, 1]\n" + ] + } + ], + "source": [ + "def dfs(graph, start):\n", + " visited = [] # This contains all the vertices that have been visited. Initially, it will be empty.\n", + " visited.append(start)\n", + "\n", + " stack = graph[start] # This contains all the vertices that we have & want to visit in next iterations.\n", + "\n", + " # Check if there exists even a single element in the stack.\n", + " while stack:\n", + " # Pop the top node in the stack and chose that node as the current node of this iteration.\n", + " node = stack.pop()\n", + " if node not in visited:\n", + " visited.append(node)\n", + " neighbours = graph[node] # Use neighbors to represent the node's directly connected nodes.\n", + "\n", + " # Now, add the node's neighbours one by one to the stack.\n", + " for neighbour in neighbours:\n", + " if neighbour not in visited: # To prevent graph[start] from being added again.\n", + " stack.append(neighbour)\n", + "\n", + " return visited\n", + "\n", + "\n", + "# Adjacency list\n", + "graph = {4: [2, 8],\n", + " 2: [4, 1, 3],\n", + " 8: [4, 5, 10],\n", + " 1: [2], # [] is added in order to align the format with other elements in this dict.\n", + " 3: [2],\n", + " 5: [8],\n", + " 10: [8]\n", + " }\n", + "\n", + "print(dfs(graph=graph, start=4))" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['A', 'S', 'G', 'H', 'F', 'C', 'E', 'D', 'B']\n" + ] + } + ], + "source": [ + "graph = {'A': ['B', 'S'],\n", + " 'B': ['A'],\n", + " 'S': ['A', 'C', 'G'],\n", + " 'C': ['S', 'D', 'E', 'F'],\n", + " 'D': ['C'],\n", + " 'E': ['C'],\n", + " 'F': ['C', 'G'],\n", + " 'G': ['S', 'F', 'H'],\n", + " 'H': ['G']\n", + " }\n", + "\n", + "print(dfs(graph=graph, start='A'))" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "markdown", + "source": [ + "Graph below: https://www.youtube.com/watch?v=iaBEKo5sM7w" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "code", + "execution_count": 3, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['A', 'S', 'G', 'H', 'E', 'C', 'F', 'D', 'B']\n" + ] + } + ], + "source": [ + "graph = {'A': ['B', 'S'],\n", + " 'B': ['A'],\n", + " 'S': ['A', 'C', 'G'],\n", + " 'C': ['S', 'D', 'E', 'F'],\n", + " 'D': ['C'],\n", + " 'E': ['C', 'H'],\n", + " 'F': ['C', 'G'],\n", + " 'G': ['S', 'F', 'H'],\n", + " 'H': ['G', 'E']\n", + " }\n", + "\n", + "print(dfs(graph=graph, start='A'))" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "markdown", + "source": [], + "metadata": { + "collapsed": false + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/40 Algorithms Every Programmer Should Know/Graph Algorithms/Depth-first search.py b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Depth-first search.py new file mode 100644 index 00000000..f647c2d4 --- /dev/null +++ b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Depth-first search.py @@ -0,0 +1,24 @@ +def dfs(graph, start, visited=None): + if visited is None: + visited = set() + + visited.add(start) + print(start) + + for next in graph[start] - visited: + dfs(graph=graph, start=next, visited=visited) + + return visited + + +# Adjacency list +graph = {"Amin": ['Wasim', 'Nick', "Mike"], + "Wasim": ['Amin', 'Imran'], + "Nick": ['Amin'], + "Mike": ['Amin'], + 'Imran': ['Wasim', 'Faras'], + 'Faras': ['Imran'] + } + + +print(dfs(graph=graph, start='Amin', visited=None)) diff --git a/40 Algorithms Every Programmer Should Know/Graph Algorithms/Representations of graphs.py b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Representations of graphs.py new file mode 100644 index 00000000..8179b263 --- /dev/null +++ b/40 Algorithms Every Programmer Should Know/Graph Algorithms/Representations of graphs.py @@ -0,0 +1,24 @@ +import networkx as nx + +graph = nx.Graph() + +# Add a single vertex +graph.add_node("Mike") + +# Add a bunch of vertices using a list +graph.add_nodes_from(["Amine", "Wassim", "Nick"]) + +# Add an edge between the existing vertices. +graph.add_edge("Mike", "Amine") + +# Print the edges and vertices. +print(graph.edges) +print(graph.nodes) + +# If we are adding an edge, this also leads to adding the associated vertices, +# if they do not already exist +graph.add_edge("Amine", "Imran") + +print(graph.nodes) +print(graph.edges) + diff --git a/40 Algorithms Every Programmer Should Know/Graph Algorithms/__init__.py b/40 Algorithms Every Programmer Should Know/Graph Algorithms/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/40 Algorithms Every Programmer Should Know/__init__.py b/40 Algorithms Every Programmer Should Know/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/A Beginner's Guide to Python 3/35 ADTs, Queues & Stacks/35.4.1.py b/A Beginner's Guide to Python 3/35 ADTs, Queues & Stacks/35.4.1.py new file mode 100644 index 00000000..105240ad --- /dev/null +++ b/A Beginner's Guide to Python 3/35 ADTs, Queues & Stacks/35.4.1.py @@ -0,0 +1,18 @@ +queue = [] # Create an empty queue. +queue.append('task1') + +print("Initial queue: ", queue) + +queue.append('task2') +queue.append('task3') +print("queue after additions: ", queue) + +element1 = queue.pop(0) +print("element retrieved from queue: ", element1) + +print("queue after the pop: ", queue) + +element2 = queue.pop() +print("element2 retrieved from queue: ", element2) + +print("queue after the pop: ", queue) diff --git a/A Beginner's Guide to Python 3/35 ADTs, Queues & Stacks/35.5.1.py b/A Beginner's Guide to Python 3/35 ADTs, Queues & Stacks/35.5.1.py new file mode 100644 index 00000000..0a6f7bd7 --- /dev/null +++ b/A Beginner's Guide to Python 3/35 ADTs, Queues & Stacks/35.5.1.py @@ -0,0 +1,13 @@ +stack = [] # create an empty stack + +stack.append('task1') +stack.append('task2') +stack.append('task3') + +print('stack: ', stack) + +top_element = stack.pop() + +print("Top element: ", top_element) + +print('stack: ', stack) diff --git a/A Beginner's Guide to Python 3/35 ADTs, Queues & Stacks/__init__.py b/A Beginner's Guide to Python 3/35 ADTs, Queues & Stacks/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/A Beginner's Guide to Python 3/__init__.py b/A Beginner's Guide to Python 3/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Algorithms for Dummies/CH 6 - Structuring Data/Binary Search Tree 1.py b/Algorithms for Dummies/CH 6 - Structuring Data/Binary Search Tree 1.py new file mode 100644 index 00000000..fbf9019b --- /dev/null +++ b/Algorithms for Dummies/CH 6 - Structuring Data/Binary Search Tree 1.py @@ -0,0 +1,39 @@ +class binaryTree: + def __init__(self, data, left, right): + self.data = data + self.left = left + self.right = right + + def __str__(self): + """The method for printing the content of the node's data, + so that you can see what data the node stores.""" + return str(self.data) + + @staticmethod + def traverse(tree): + if tree.left != None: + traverse(tree.left) + if tree.right is not None: + traverse(tree.right) + + print(tree.data) + + +tree = binaryTree("Root", None, None) +BranchA = binaryTree("Branch A", None, None) +BranchB = binaryTree("Branch B", None, None) +tree.left = BranchA +tree.right = BranchB + +LeafC = binaryTree("Leaf C", None, None) +LeafD = binaryTree("Leaf D", None, None) +LeafE = binaryTree("Leaf E", None, None) +LeafF = binaryTree("Leaf F", None, None) + +BranchA.left = LeafC +BranchA.right = LeafD +BranchB.left = LeafE +BranchB.right = LeafF + + +binaryTree.traverse(tree=tree) diff --git a/Algorithms for Dummies/CH 6 - Structuring Data/Binary Search Tree 2.py b/Algorithms for Dummies/CH 6 - Structuring Data/Binary Search Tree 2.py new file mode 100644 index 00000000..a1da0a16 --- /dev/null +++ b/Algorithms for Dummies/CH 6 - Structuring Data/Binary Search Tree 2.py @@ -0,0 +1,22 @@ +class binaryTree: + + # Constructor + def __init__(self, nodeData, left=None, right=None): + self.nodeData = nodeData + self.left = left + self.right = right + + def __str__(self): + return str(self.nodeData) + + +root_node = binaryTree("Root") +branch_A = binaryTree(nodeData="Branch A", left=leaf_C, right=leaf_D) +leaf_C = binaryTree(nodeData="Leaf C", left=None, right=None) +leaf_D = binaryTree(nodeData="Leaf D", left=None, right=None) +branch_B = binaryTree(nodeData="Branch B", left=Leaf_E, right=Leaf_F) +leaf_E = binaryTree(nodeData="Leaf E", left=None, right=None) +leaf_F = binaryTree(nodeData="Leaf F", left=None, right=None) + + + diff --git a/Algorithms for Dummies/CH 6 - Structuring Data/Binary Search Tree 3.py b/Algorithms for Dummies/CH 6 - Structuring Data/Binary Search Tree 3.py new file mode 100644 index 00000000..3e0803b1 --- /dev/null +++ b/Algorithms for Dummies/CH 6 - Structuring Data/Binary Search Tree 3.py @@ -0,0 +1,28 @@ +class binaryTree: + + # Constructor + def __init__(self, nodeData, left=None, right=None): + self.nodeData = nodeData + self.left = left + self.right = right + + def __str__(self): + return str(self.nodeData) + + +root_node = binaryTree("Root") + +# Define leaf_C and leaf_D before branch_A +leaf_C = binaryTree(nodeData="Leaf C", left=None, right=None) +leaf_D = binaryTree(nodeData="Leaf D", left=None, right=None) + +branch_A = binaryTree(nodeData="Branch A", left=leaf_C, right=leaf_D) + +leaf_E = binaryTree(nodeData="Leaf E", left=None, right=None) +leaf_F = binaryTree(nodeData="Leaf F", left=None, right=None) + +branch_B = binaryTree(nodeData="Branch B", left=leaf_E, right=leaf_F) + + + + diff --git a/Algorithms for Dummies/CH 6 - Structuring Data/Binary Search Tree 4.py b/Algorithms for Dummies/CH 6 - Structuring Data/Binary Search Tree 4.py new file mode 100644 index 00000000..b2d6bd5c --- /dev/null +++ b/Algorithms for Dummies/CH 6 - Structuring Data/Binary Search Tree 4.py @@ -0,0 +1,36 @@ +class binaryTree: + + # Constructor + def __init__(self, nodeData, left=None, right=None): + self.nodeData = nodeData + self.left = left + self.right = right + + def __str__(self): + return str(self.nodeData) + + +# root_node = binaryTree("Root", left=branch_A, right=branch_B) + +leaf_C = binaryTree(nodeData="Leaf C", left=None, right=None) +leaf_D = binaryTree(nodeData="Leaf D", left=None, right=None) + +branch_A = binaryTree(nodeData="Branch A", left=leaf_C, right=leaf_D) + +leaf_E = binaryTree(nodeData="Leaf E", left=None, right=None) +leaf_F = binaryTree(nodeData="Leaf F", left=None, right=None) + +branch_B = binaryTree(nodeData="Branch B", left=leaf_E, right=leaf_F) + +root_node = binaryTree("Root", left=branch_A, right=branch_B) + +def traverse(tree): + if tree.left is not None: + traverse(tree.left) + if tree.right is not None: + traverse(tree.right) + + print(tree.nodeData) + + +traverse(root_node) diff --git a/Algorithms for Dummies/CH 6 - Structuring Data/Binary Search Tree.py b/Algorithms for Dummies/CH 6 - Structuring Data/Binary Search Tree.py new file mode 100644 index 00000000..48cb7f1b --- /dev/null +++ b/Algorithms for Dummies/CH 6 - Structuring Data/Binary Search Tree.py @@ -0,0 +1,39 @@ +class binaryTree: + def __init__(self, data, left, right): + self.data = data + self.left = left + self.right = right + + def __str__(self): + """The method for printing the content of the node's data, + so that you can see what data the node stores.""" + return str(self.data) + + @staticmethod + def traverse(tree): + if tree.left != None: + binaryTree.traverse(tree.left) + if tree.right is not None: + binaryTree.traverse(tree.right) + + print(tree.data) + + +tree = binaryTree("Root", None, None) +BranchA = binaryTree("Branch A", None, None) +BranchB = binaryTree("Branch B", None, None) +tree.left = BranchA +tree.right = BranchB + +LeafC = binaryTree("Leaf C", None, None) +LeafD = binaryTree("Leaf D", None, None) +LeafE = binaryTree("Leaf E", None, None) +LeafF = binaryTree("Leaf F", None, None) + +BranchA.left = LeafC +BranchA.right = LeafD +BranchB.left = LeafE +BranchB.right = LeafF + + +binaryTree.traverse(tree=tree) diff --git a/Algorithms for Dummies/CH 6 - Structuring Data/__init__.py b/Algorithms for Dummies/CH 6 - Structuring Data/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Algorithms for Dummies/__init__.py b/Algorithms for Dummies/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Chapter5 - Some More Python Essentials/Analytically.py b/Chapter5 - Some More Python Essentials/Analytically.py new file mode 100644 index 00000000..0d67891d --- /dev/null +++ b/Chapter5 - Some More Python Essentials/Analytically.py @@ -0,0 +1,13 @@ +import sympy as sym + +x = sym.symbols('x') + +f_expr = 5*x**3 + 2*x**2 - 1 # Symbolic expression for f(x) + +dfdx_expr = sym.diff(f_expr, x) # Compute f'(x) symbolically + +# turn symbolic expressions into functions +f = sym.lambdify([x], f_expr) # f = lambda x: 5*x**3 + 2*x**2 - 1 +dfdx = sym.lambdify([x], dfdx_expr) # dfdx = lambda x: 15*x**2 4*x + +print(f(1), dfdx(1)) # Call and print, x = 1 diff --git a/Chapter5 - Some More Python Essentials/Analytically2.py b/Chapter5 - Some More Python Essentials/Analytically2.py new file mode 100644 index 00000000..9c53f8ac --- /dev/null +++ b/Chapter5 - Some More Python Essentials/Analytically2.py @@ -0,0 +1,16 @@ +import sympy as sym + +x = sym.symbols('x') + +f_expr = 5*x**3 + 2*x**2 - 1 # Symbolic expression for f(x) + +dfdx_expr = sym.diff(f_expr, x) # Compute f'(x) symbolically + +print(f_expr) +print(dfdx_expr) + +# turn symbolic expressions into functions for numerical calculations. +f = sym.lambdify([x], f_expr) # f = lambda x: 5*x**3 + 2*x**2 - 1 +dfdx = sym.lambdify([x], dfdx_expr) # dfdx = lambda x: 15*x**2 4*x + +print(f(1), dfdx(1)) # Call and print, x = 1 diff --git a/Chapter5 - Some More Python Essentials/Exception Handling Refined Version.py b/Chapter5 - Some More Python Essentials/Exception Handling Refined Version.py new file mode 100644 index 00000000..71a13a6b --- /dev/null +++ b/Chapter5 - Some More Python Essentials/Exception Handling Refined Version.py @@ -0,0 +1,50 @@ +import numpy as np + +def ask_user(a, b): + """Get answer from user: a*b = ?""" + + question = "{:d} * {:d} = ".format(a, b) + answer = int(input(question)) + return answer + + +def points(a, b, answer_given): + """Check answer. Correct answer gives 1 point, else zero""" + true_answer = a * b + + if answer_given == true_answer: + print("Correct!") + return 1 + else: + print("Sorry! Correct answer was: {:d}".format(true_answer)) + return 0 + + +print("\n*** Welcome to the times tables test! ***\n (To stop: ctrl-c)") + +N = 10 +NN = N*N +score = 0 + +index = list(range(0, NN, 1)) + +np.random.shuffle(index) + +for i in range(0, NN, 1): + a = index[i] // N + 1 + b = index[i] % N + 1 + + try: + user_answer = ask_user(a, b) + except KeyboardInterrupt: + print("\n Ok, you want to stop!") + break + except ValueError: + print("You must give a valid number!") + continue # Jump to next loop iteration + + score = score + points(a, b, user_answer) + print("Your score is now: {:d}".format(score)) + +print("\nFinished! \nYour final score:{:d} (max: {:d})".format(score, N*N)) + diff --git a/Chapter5 - Some More Python Essentials/Exception Handling.py b/Chapter5 - Some More Python Essentials/Exception Handling.py new file mode 100644 index 00000000..5c66704d --- /dev/null +++ b/Chapter5 - Some More Python Essentials/Exception Handling.py @@ -0,0 +1,46 @@ +import numpy as np + +def ask_user(a, b): + """get answer from user: a*b = ?""" + question = "{:d} * {:d} = ".format(a, b) + answer = int(input(question)) + + return answer + + +def points(a, b, answer_given): + """Check answer. Correct: 1 point, else 0""" + true_answer = a*b + + if answer_given == true_answer: + print("Correct!") + return 1 + else: + print("Sorry! Correct answer was: {:d}".format(true_answer)) + return 0 + + +print("\n*** Welcome to the times tables test! ***\n (To stop: ctrl-c)") + + +N = 10 +NN = N*N +score = 0 +index = list(range(0, NN, 1)) +np.random.shuffle(index) + +for i in range(0, NN, 1): + a = index[i] // N + 1 + b = index[i] % N + 1 + + try: + user_answer = ask_user(a, b) + except: + print("You must give a valid number!") + continue # Jump to the next loop iteration + + score = score + points(a, b, user_answer) + print("Your score is now: {:d}".format(score)) + + +print("\nFinished! \nYour final score: {:d} (max: {:d})".format(score, N*N)) diff --git a/Chapter5 - Some More Python Essentials/Symbolic Computations.py b/Chapter5 - Some More Python Essentials/Symbolic Computations.py new file mode 100644 index 00000000..14ea5e5b --- /dev/null +++ b/Chapter5 - Some More Python Essentials/Symbolic Computations.py @@ -0,0 +1,11 @@ +import sympy as sym + +x = 2 +y = 3 +z = x * y + +print(z) + +x, y = sym.symbols('x y') # define x and y as a mathematical symbols. +z = x * y +print(z) diff --git a/Chapter5 - Some More Python Essentials/__init__.py b/Chapter5 - Some More Python Essentials/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Chapter5 - Some More Python Essentials/example_symbolic.py b/Chapter5 - Some More Python Essentials/example_symbolic.py new file mode 100644 index 00000000..685ed880 --- /dev/null +++ b/Chapter5 - Some More Python Essentials/example_symbolic.py @@ -0,0 +1,14 @@ +import sympy as sym + +x = 2 +y = 3 +z = x * y + +x, y = sym.symbols('x y') + +print(2 * x + 3*x - y) # Algebraic computation +print(sym.diff(x**2, x)) # Differentiate x**2 wrt. x +print(sym.integrate(sym.cos(x), x)) # Integrates cos(x) wrt. x +print(sym.simplify((x ** 2 + x ** 3) / x ** 2)) # Simplifies expression +print(sym.limit(sym.sin(x) / x, x, 0)) # lim of sin(x)/x as x -> 0 +print(sym.solve(5 * x - 15, x)) # Solve 5 * x = 15 diff --git a/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/Maximum_clique.py b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/Maximum_clique.py new file mode 100644 index 00000000..f7cd00a0 --- /dev/null +++ b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/Maximum_clique.py @@ -0,0 +1,19 @@ +import networkx as nx +import matplotlib.pyplot as plt +import random +import numpy as np + +# random.seed(1) +# np.random.seed(2) + +# Generate a 5-clique +G = nx.complete_graph(n=5, create_using=nx.Graph()) + +nx.relabel_nodes(G=G, mapping=dict(enumerate(("Alpha", "Bravo", "Charlie", "Delta", "Echo"))), copy=False) + +# Attach a pigtail to it +G.add_edges_from([("Echo", "Foxtrot"), ("Foxtrot", "Golf"), ("Foxtrot", "Hotel"), ("Golf", "Hotel")]) + +nx.draw_networkx(G=G, arrows=True, with_labels=True) + +plt.show() diff --git a/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/Modularity.py b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/Modularity.py new file mode 100644 index 00000000..223caf02 --- /dev/null +++ b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/Modularity.py @@ -0,0 +1,118 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate +import community + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="PO1", layer=3) +circuit.add_node(14, label="PO2", layer=3) + + +circuit.add_edge(9, 13) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +part = community.best_partition(graph=circuit) + +print(part) diff --git a/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/Separate_Cores, Shells, Coronas, & Crusts.py b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/Separate_Cores, Shells, Coronas, & Crusts.py new file mode 100644 index 00000000..f8a69fd5 --- /dev/null +++ b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/Separate_Cores, Shells, Coronas, & Crusts.py @@ -0,0 +1,27 @@ +import networkx as nx +import matplotlib.pyplot as plt +import random +import numpy as np + +random.seed(8) +np.random.seed(19) + +G = nx.Graph((("Alpha", "Brazo"), ("Brazo", "Charlie"), ("Charlie", "Delta"), ("Charlie", "Echo"), + ("Charlie", "Foxtrot"), ("Delta", "Echo"), ("Delta", "Foxtrot"), ("Echo", "Foxtrot"), + ("Echo", "Golf"), ("Echo", "Hotel"), ("Foxtrot", "Golf"), ("Foxtrot", "Hotel"), + ("Delta", "Hotel"), ("Golf", "Hotel"), ("Delta", "India"), ("Charlie", "India"), + ("India", "Juliet"), ("Golf", "Kilo"), ("Alpha", "Kilo"), ("Bravo", "Lima"))) + +nx.draw_networkx(G=G, arrows=True, with_labels=True) + +plt.show() + +print(nx.k_core(G=G).nodes()) +print(nx.k_crust(G=G).nodes()) +print(nx.k_shell(G=G).nodes()) +print(nx.k_corona(G=G, k=3).nodes()) + +print(nx.k_core(G=G, k=2).nodes()) +print(nx.k_crust(G=G, k=2).nodes()) +print(nx.k_shell(G=G, k=2).nodes()) +print(nx.k_corona(G=G, k=2).nodes()) diff --git a/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/__init__.py b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/make-figure6.py b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/make-figure6.py new file mode 100644 index 00000000..1081cc4c --- /dev/null +++ b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/make-figure6.py @@ -0,0 +1,18 @@ +import networkx as nx +import matplotlib.pyplot as plt +import random +random.seed(3) +import numpy as np +np.random.seed(3) + +F = nx.DiGraph() +F.add_node("C") + +F.add_edges_from([("B", "b0"), ("b0", "b1"), ("b1", "B")]) +F.add_edges_from([("A", "a0"), ("a0", "a1"), ("a1", "a2"), ("a1", "a3"), ("a3", "A")]) + +nx.draw_networkx(G=F, arrows=True, with_labels=True) + +plt.show() + +print(list(nx.strongly_connected_components(G=F))) diff --git a/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/make-figures.py b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/make-figures.py new file mode 100644 index 00000000..778df30f --- /dev/null +++ b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/make-figures.py @@ -0,0 +1,13 @@ +import networkx as nx +import matplotlib.pyplot as plt + +F = nx.DiGraph() +F.add_node("C") + +F.add_edges_from([("B", "b0"), ("b0", "b1"), ("b1", "B")]) +F.add_edges_from([("A", "a0"), ("a0", "a1"), ("a1", "a2"), ("a1", "a3"), ("a3", "A")]) + +nx.draw_networkx(G=F, arrows=True, with_labels=True) + +plt.show() + diff --git a/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/make-figures2.py b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/make-figures2.py new file mode 100644 index 00000000..82ba8955 --- /dev/null +++ b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/make-figures2.py @@ -0,0 +1,17 @@ +import networkx as nx +import matplotlib.pyplot as plt +import random +random.seed(246) +import numpy as np +np.random.seed(4812) + +F = nx.DiGraph() +F.add_node("C") + +F.add_edges_from([("B", "b0"), ("b0", "b1"), ("b1", "B")]) +F.add_edges_from([("A", "a0"), ("a0", "a1"), ("a1", "a2"), ("a1", "a3"), ("a3", "A")]) + +nx.draw_networkx(G=F, arrows=True, with_labels=True) + +plt.show() + diff --git a/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/make-figures3.py b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/make-figures3.py new file mode 100644 index 00000000..5c25dc4c --- /dev/null +++ b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/make-figures3.py @@ -0,0 +1,18 @@ +import networkx as nx +import matplotlib.pyplot as plt +import random +random.seed(246) +import numpy as np +np.random.seed(4812) + +F = nx.DiGraph() +F.add_node("C") + +F.add_edges_from([("B", "b0"), ("b0", "b1"), ("b1", "B")]) +F.add_edges_from([("A", "a0"), ("a0", "a1"), ("a1", "a2"), ("a1", "a3"), ("a3", "A")]) + +nx.draw_networkx(G=F, arrows=True, with_labels=True) + +plt.show() + +print(list(nx.strongly_connected_components(G=F))) diff --git a/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/make-figures4.py b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/make-figures4.py new file mode 100644 index 00000000..c6b1ce3a --- /dev/null +++ b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/make-figures4.py @@ -0,0 +1,18 @@ +import networkx as nx +import matplotlib.pyplot as plt +import random +random.seed(10) +import numpy as np +np.random.seed(10) + +F = nx.DiGraph() +F.add_node("C") + +F.add_edges_from([("B", "b0"), ("b0", "b1"), ("b1", "B")]) +F.add_edges_from([("A", "a0"), ("a0", "a1"), ("a1", "a2"), ("a1", "a3"), ("a3", "A")]) + +nx.draw_networkx(G=F, arrows=True, with_labels=True) + +plt.show() + +print(list(nx.strongly_connected_components(G=F))) diff --git a/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/make-figures5.py b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/make-figures5.py new file mode 100644 index 00000000..2ceb8214 --- /dev/null +++ b/Complex Network Analysis in Python/Chapter 11 - Unearthing the Network Structure/make-figures5.py @@ -0,0 +1,18 @@ +import networkx as nx +import matplotlib.pyplot as plt +import random +random.seed(2) +import numpy as np +np.random.seed(2) + +F = nx.DiGraph() +F.add_node("C") + +F.add_edges_from([("B", "b0"), ("b0", "b1"), ("b1", "B")]) +F.add_edges_from([("A", "a0"), ("a0", "a1"), ("a1", "a2"), ("a1", "a3"), ("a3", "A")]) + +nx.draw_networkx(G=F, arrows=True, with_labels=True) + +plt.show() + +print(list(nx.strongly_connected_components(G=F))) diff --git a/Complex Network Analysis in Python/__init__.py b/Complex Network Analysis in Python/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Deep_learning_class_2021/Project1/mnist_train.csv b/Deep_learning_class_2021/Project1/mnist_train.csv index 744c258d..e8d0c5bd 100644 --- a/Deep_learning_class_2021/Project1/mnist_train.csv +++ b/Deep_learning_class_2021/Project1/mnist_train.csv @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:06e64b0bf65de89c522348319ce5f63f43fb1cb40e1ce3c2ff43c1d3b8a0e14c -size 109640201 +oid sha256:0d9d3e5f45ca7abebb7c84234aceda7ae88b90f077294e4d6befa2e276f37ae6 +size 91386439 diff --git a/Digital Signal Processing/NUK/Case2_FIR_bandpass_filter.ipynb b/Digital Signal Processing/NUK/Case2_FIR_bandpass_filter.ipynb new file mode 100644 index 00000000..700000b0 --- /dev/null +++ b/Digital Signal Processing/NUK/Case2_FIR_bandpass_filter.ipynb @@ -0,0 +1,201 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "from math import pi\n", + "\n", + "N = 40;\n", + "ws1 = 0.3*pi;\n", + "wp1 = 0.4*pi;\n", + "wp2 = 0.65*pi;\n", + "ws2 = 0.75 * pi;\n", + "Ns = 200;" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "NH = N / 2;\n", + "deltaw = pi/ Ns;\n", + "Ns_p = round((wp2 - wp1)/deltaw);\n", + "Ns_s1 = round(ws1/deltaw);\n", + "Ns_s2 = round((pi - ws2) / deltaw);\n", + "NV = []\n", + "\n", + "for i in range(NH):\n", + " NV.append(i)\n", + "\n", + "\n", + "NV = np.array(NV)\n", + "NV = NV.transpose()\n" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "from math import cos\n", + "\n", + "P = np.zeros(NH, 1);\n", + "Qp = np.zeros(NH, NH);\n", + "\n", + "for iw in range(Ns_p):\n", + " w = wp1 + iw*deltaw;\n", + " P = P - 2*cos(w*(NV-0.5));\n", + " Qp = Qp + cos(w * (NV-0.5)) * np.array((cos(w * (NV-0.5)))).transpose()\n", + "\n", + "\n", + "P = (wp2 - wp1) * P / (Ns_p + 1);\n", + "Qp = (wp2 - wp1) * Qp / (Ns_p + 1);" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "Qs = np.zeros(NH, NH)\n", + "\n", + "for iw in range(Ns_s1):\n", + " w = iw*deltaw;\n", + " Qs1 = Qs1 + cos(w*(NV-0.5)) * np.array((cos(w*(NV-0.5)))).transpose()\n", + "\n", + "\n", + "Qs1 = ws1 * Qs1 / (Ns_s1 + 1);\n" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "Qs2 = np.zeros(NH, NH);\n", + "\n", + "for iw in range(Ns_s2):\n", + " w = ws2 + iw*deltaw;\n", + " Qs2 = Qs2 + cos(w*(NV-0.5)) * np.array((cos(w*(NV-0.5)))).transpose()\n", + "\n", + "\n", + "Qs2 = (pi - ws2) * Qs2 / (Ns_s2 + 1);" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "Q = Qp + Qs1 + Qs2;\n", + "A = -0.5 * np.invert(Q) * P" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "h = np.zeros(N, 1)\n", + "h[1:NH] = 0.5 * np.flipud(A)\n", + "h[NH+1:N] = 0.5 * A" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "\n", + "figure, (ax1, ax2, ax3, ax4) = plt.subplots(2, 2)\n", + "\n", + "ax1.stem([0:N-1], h)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "plt.stem([0:N-1], h)\n" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/Digital Signal Processing/NUK/Case2_FIR_bandpass_filter.py b/Digital Signal Processing/NUK/Case2_FIR_bandpass_filter.py new file mode 100644 index 00000000..d2ab6113 --- /dev/null +++ b/Digital Signal Processing/NUK/Case2_FIR_bandpass_filter.py @@ -0,0 +1,73 @@ +from math import pi, cos +import numpy as np +import matplotlib.pyplot as plt + +N = 40; +ws1 = 0.3*pi; +wp1 = 0.4*pi; +wp2 = 0.65*pi; +ws2 = 0.75 * pi; +Ns = 200; + +NH = N / 2; +deltaw = pi/ Ns; +Ns_p = round((wp2 - wp1)/deltaw); +Ns_s1 = round(ws1/deltaw); +Ns_s2 = round((pi - ws2) / deltaw); +NV = [] + +for i in range(NH): + NV.append(i) + + +NV = np.array(NV) +NV = NV.transpose() + +P = np.zeros(NH, 1); +Qp = np.zeros(NH, NH); + +for iw in range(Ns_p): + w = wp1 + iw*deltaw; + P = P - 2*cos(w*(NV-0.5)); + Qp = Qp + cos(w * (NV-0.5)) * np.array((cos(w * (NV-0.5)))).transpose() + + +P = (wp2 - wp1) * P / (Ns_p + 1); +Qp = (wp2 - wp1) * Qp / (Ns_p + 1); + +Qs = np.zeros(NH, NH) + +for iw in range(Ns_s1): + w = iw*deltaw; + Qs1 = Qs1 + cos(w*(NV-0.5)) * np.array((cos(w*(NV-0.5)))).transpose() + + +Qs1 = ws1 * Qs1 / (Ns_s1 + 1); + +Qs2 = np.zeros(NH, NH); + +for iw in range(Ns_s2): + w = ws2 + iw*deltaw; + Qs2 = Qs2 + cos(w*(NV-0.5)) * np.array((cos(w*(NV-0.5)))).transpose() + + +Qs2 = (pi - ws2) * Qs2 / (Ns_s2 + 1); + +Q = Qp + Qs1 + Qs2; +A = -0.5 * np.invert(Q) * P + +h = np.zeros(N, 1) +h[1:NH] = 0.5 * np.flipud(A) +h[NH+1:N] = 0.5 * A + +# figure, (ax1, ax2, ax3, ax4) = plt.subplots(2, 2) + +# ax1.stem([0:N-1], h) + +# plt.stem([0:N-1], h) + +plt.stem(range(N), h) + +plt.xlabel('n') +plt.ylabel('Impulse response') +plt.title('Case 2 bandpass filter ') diff --git a/Digital Signal Processing/NUK/Case2_FIR_bandpass_filter2.py b/Digital Signal Processing/NUK/Case2_FIR_bandpass_filter2.py new file mode 100644 index 00000000..361131e0 --- /dev/null +++ b/Digital Signal Processing/NUK/Case2_FIR_bandpass_filter2.py @@ -0,0 +1,70 @@ +from math import pi, cos +import numpy as np +import matplotlib.pyplot as plt + +N = 40; +ws1 = 0.3 * pi; +wp1 = 0.4 * pi; +wp2 = 0.65 * pi; +ws2 = 0.75 * pi; +Ns = 200; + +NH = N / 2; +NH = int(NH) +deltaw = pi / Ns; +Ns_p = round((wp2 - wp1) / deltaw); +Ns_s1 = round(ws1 / deltaw); +Ns_s2 = round((pi - ws2) / deltaw); +NV = [] + +for i in range(NH): + NV.append(i) + +NV = np.array(NV) +NV = NV.transpose() + +P = np.zeros(NH, 1); +Qp = np.zeros(NH, NH); + +for iw in range(Ns_p): + w = wp1 + iw * deltaw; + P = P - 2 * cos(w * (NV - 0.5)); + Qp = Qp + cos(w * (NV - 0.5)) * np.array((cos(w * (NV - 0.5)))).transpose() + +P = (wp2 - wp1) * P / (Ns_p + 1); +Qp = (wp2 - wp1) * Qp / (Ns_p + 1); + +Qs = np.zeros(NH, NH) + +for iw in range(Ns_s1): + w = iw * deltaw; + Qs1 = Qs1 + cos(w * (NV - 0.5)) * np.array((cos(w * (NV - 0.5)))).transpose() + +Qs1 = ws1 * Qs1 / (Ns_s1 + 1); + +Qs2 = np.zeros(NH, NH); + +for iw in range(Ns_s2): + w = ws2 + iw * deltaw; + Qs2 = Qs2 + cos(w * (NV - 0.5)) * np.array((cos(w * (NV - 0.5)))).transpose() + +Qs2 = (pi - ws2) * Qs2 / (Ns_s2 + 1); + +Q = Qp + Qs1 + Qs2; +A = -0.5 * np.invert(Q) * P + +h = np.zeros(N, 1) +h[1:NH] = 0.5 * np.flipud(A) +h[NH + 1:N] = 0.5 * A + +# figure, (ax1, ax2, ax3, ax4) = plt.subplots(2, 2) + +# ax1.stem([0:N-1], h) + +# plt.stem([0:N-1], h) + +plt.stem(range(N), h) + +plt.xlabel('n') +plt.ylabel('Impulse response') +plt.title('Case 2 bandpass filter ') diff --git a/Digital Signal Processing/NUK/DSP_final_No3.ipynb b/Digital Signal Processing/NUK/DSP_final_No3.ipynb new file mode 100644 index 00000000..48619d49 --- /dev/null +++ b/Digital Signal Processing/NUK/DSP_final_No3.ipynb @@ -0,0 +1,39 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true, + "pycharm": { + "name": "#%%\n" + } + }, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/Digital Signal Processing/NUK/__init__.py b/Digital Signal Processing/NUK/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Digital Signal Processing/Python for Signal Processing/Chapter5 - Finite Impulse Response Filters/Listing 5-6.ipynb b/Digital Signal Processing/Python for Signal Processing/Chapter5 - Finite Impulse Response Filters/Listing 5-6.ipynb new file mode 100644 index 00000000..2d018ead --- /dev/null +++ b/Digital Signal Processing/Python for Signal Processing/Chapter5 - Finite Impulse Response Filters/Listing 5-6.ipynb @@ -0,0 +1,212 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": true, + "pycharm": { + "name": "#%%\n" + } + }, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAu8AAAFHCAYAAAARJKJPAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAC78UlEQVR4nOyddXgURxvAf3NxT4igIbi7u5dSoVBqVGhpKdS9UKpQ91Kj3kKFGm2hfDWkWHF3DQ4BkhDifjffH5NAPHfJ3e0u7O957iGzN7Pz3g67+87MK0JKiYmJiYmJiYmJiYmJ/rFoLYCJiYmJiYmJiYmJiX2YyruJiYmJiYmJiYmJQTCVdxMTExMTExMTExODYCrvJiYmJiYmJiYmJgbBVN5NTExMTExMTExMDIKpvJuYmJiYmJiYmJgYBE+tBdAjERERskGDBlqLYWJiYmJiYmJicgGzcePGRCllpCNtTOW9DBo0aMCGDRu0FsPExMTExMTExOQCRghxxNE2ptmMiYmJiYmJiYmJiUEwlXcTExMTExMTExMTg2Aq7yYmJiYmJiYmJiYGwVTeTUxMTExMTExMTAyCqbybmJiYmJiYmJiYGARTeTcxMTExMTExMTExCKbybmJiYmJiYmJiYmIQDBHnXQjxFXAlEC+lbFPG9wJ4D7gcyATGSik3FXx3G/BMQdWXpJRfu0fq6jF38wnenL+XuOQs6oT6MfHS5ozsWFdrsUzcgDn2Fy/m2F+8mGN/8ZCTk0NSUhJpaWmkZeWQmpWP1SbxsAiC/Tzx9zaEamZSAd7e3kRERBASElJuncJ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AHYAvAeQBmABgpYiM8mTbiIh8kSilPN0GIiIymTO97gBKAExWSm3VtlsAvAbgdgArlFIXe6iJREQ+ick7ERE5rVHy/jul1Lyz7ksEcBxALYBIpVS90e0jIvJVHDZDRETt8cXZG5RSJwCcAhAMIM7wFhER+TAm70RE1B5HWthern0PMaohRET+gMk7ERG5TCll93QbiIj8CZN3IiIiIiKTYPJORERERGQSTN6JiIiIiEyCyTsRERERkUkweSciIiIiMgku0kREREREZBLseSciIiIiMgkm70REREREJsHknYiIiIjIJJi8ExERERGZBJN3IiIiIiKTYPJORERERGQSTN6JiIiIiEyCyTsRERERkUkweSciIiIiMgkm70REREREJvH/9/AraNtWFy8AAAAASUVORK5CYII=\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "from numpy import arange, cos, pi\n", + "from scipy import signal\n", + "import matplotlib.pyplot as plt\n", + "\n", + "Ns=30 # length of input sequence\n", + "n= arange(Ns) # sample index\n", + "x = cos(arange(Ns)*pi/2.)\n", + "y= signal.lfilter([1/2.,1/2.],1,x)\n", + "\n", + "fig,ax = plt.subplots(1,1)\n", + "fig.set_size_inches(12,5)\n", + "\n", + "ax.stem(n,x,label='input', basefmt='b-')\n", + "ax.plot(n,x,':')\n", + "ax.stem(n[1:],y[:-1],markerfmt='ro', linefmt='r-', label='output')\n", + "ax.plot(n[1:],y[:-1], 'r:')\n", + "ax.set_ylim(ymin=-1.1,ymax=1.1)\n", + "ax.set_xlabel(\"n\",fontsize=22)\n", + "ax.legend(loc=0,fontsize=18)\n", + "ax.set_xticks(n)\n", + "ax.set_xlim(xmin=-1.1,xmax=20)\n", + "ax.set_ylabel(\"Amplitude\",fontsize=22)\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAgcAAAHqCAYAAACQk+36AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGli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5nZm5m98cqPhH5mpIDEYmVewmNOfEXd69pgKkZwf1xUY1IRCqlsRVEJOrMbAyhwV+2Ar3dfXsN5ccCnwD7gWbuXhz9KEWklGoORCQWbgnu/15TYhDYGNxnEKptEJEYUnIgIlFlZj2B04OnD1WY18PMjjGziglA2WNTajTjE5GDKTkQkWg7AzBgnruvqDDvTuAjoHeF6V2C+yJgQ3TDE5GKlByISLSNDO5nVDLv2OB+UYXpw4P72WpvIBJ7Sg5EJNp6Bveryk40sxFAd6DA3XdWeM0Zwf3/ohybiFRCyYGIRFt6cF/xeHNNcF+uTYGZDQROAEqAJ6MbmohURsmBiERbaTuDE80sBcDMxgGXAy8DGWY2OpjeAniUUBuFR909Lw7xijR66udARKLKzE4A3gme5hI6vXAG8D5wM5ADrAc+AI4h1Bjxc+AEd98d63hFRDUHIhJl7v4u8D1gPnA4oQaKfwW+6e65wI2EOjsaD+wk1CfC8UoMROJHNQciIiJSjmoOREREpBwlByIiIlKOkgMREREpR8mBiIiIlKPkQERERMpRciAiIiLlKDkQERGRcpQciIiISDlKDkRERKQcJQciIiJSzv8HbSnBBwOkL70AAAAASUVORK5CYII=\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "# from scipy.fft._pocketfft import fft\n", + "# from numpy.dual import fft\n", + "from numpy import sinc, log10, fft\n", + "\n", + "wc = pi/4\n", + "M=20\n", + "N = 512 # DFT size\n", + "n = arange(-M,M)\n", + "win = signal.windows.hamming(len(n))\n", + "h = wc/pi * sinc(wc*(n)/pi)*win # see definition of np.sinc()\n", + "\n", + "w,Hh = signal.freqz(h,1,whole=True, worN=N) # get entire frequency domain\n", + "wx = fft.fftfreq(len(w)) # shift to center for plotting\n", + "\n", + "fig,axs = plt.subplots(3,1)\n", + "fig.set_size_inches((8,8))\n", + "plt.subplots_adjust(hspace=0.3)\n", + "\n", + "ax=axs[0]\n", + "ax.stem(n+M,h,basefmt='b-')\n", + "ax.set_xlabel(\"$n$\",fontsize=24)\n", + "ax.set_ylabel(\"$h_n$\",fontsize=24)\n", + "ax=axs[1]\n", + "ax.plot(w-pi,abs(fft.fftshift(Hh)))\n", + "ax.axis(xmax=pi/2,xmin=-pi/2)\n", + "ax.vlines([-wc,wc],0,1.2,color='g',lw=2., linestyle='--',)\n", + "\n", + "ax.hlines(1,-pi,pi,color='g',lw=2., linestyle='--',)\n", + "ax.set_xlabel(r\"$\\omega$\",fontsize=22)\n", + "ax.set_ylabel(r\"$|H(\\omega)| $\",fontsize=22)\n", + "\n", + "ax=axs[2]\n", + "ax.plot(w-pi,20*log10(abs(fft.fftshift(Hh))))\n", + "ax.axis(ymin=-80,xmax=pi/2,xmin=-pi/2)\n", + "ax.vlines([-wc,wc],10,-80,color='g', lw=2., linestyle='--',)\n", + "ax.hlines(0,-pi,pi,color='g', lw=2., linestyle='--',)\n", + "ax.set_xlabel(r\"$\\omega$\",fontsize=22)\n", + "ax.set_ylabel(r\"$20\\log_{10}|H(\\omega)| $\",fontsize=18)\n", + "\n", + "plt.show()\n" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 8, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAgcAAAHqCAYAAACQk+36AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAB3UUlEQVR4nO3deXxcdb3/8dcna5N0Sdt0TXe60QW6sSNC2REoilzB6wIXKS6g3qt4wXuvKP4UFL2KikpBRK4KKAIWRPZ9b9OydKUrdE3TfUuTJvn8/jhn0iSdSSbJbEnez8cjj5k562dO5pz5zHc75u6IiIiIRGSlOwARERHJLEoOREREpBElByIiItKIkgMRERFpRMmBiIiINKLkQERERBrJSXcAmaKkpMRHjBiR7jBERERSoqysbKu794s2T8lBaMSI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2BuwnaKNzt7ivTEK9Il6dxDkQkqcxsJvBs+LKMoHrhPOAF4NvAfKAceBE4maAx4lvATHffl+p4RUQlByKSZO7+HPA5YAkwiaCB4i+Ai929DLiOYLCjWcAegjERTlViIJI+KjkQERGRRlRyICIiIo0oORAREZFGlByIiIhII0oOREREpBElByIiItKIkgMRERFpRMmBiIiINKLkQERERBpRciAiIiKNKDkQERGRRv4/teddn/0M5Y8AAAAASUVORK5CYII=\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "from numpy import sinc, log10, fft\n", + "import matplotlib.pyplot as plt\n", + "\n", + "wc = pi/4\n", + "M = 30\n", + "N = 512 # DFT size\n", + "n = arange(-M,M)\n", + "win = signal.windows.hamming(len(n))\n", + "h = wc/pi * sinc(wc*(n)/pi)*win # see definition of np.sinc()\n", + "\n", + "w,Hh = signal.freqz(h,1,whole=True, worN=N) # get entire frequency domain\n", + "wx = fft.fftfreq(len(w)) # shift to center for plotting\n", + "\n", + "fig,axs = plt.subplots(3,1)\n", + "fig.set_size_inches((8,8))\n", + "plt.subplots_adjust(hspace=0.3)\n", + "\n", + "ax=axs[0]\n", + "ax.stem(n+M,h,basefmt='b-')\n", + "ax.set_xlabel(\"$n$\",fontsize=24)\n", + "ax.set_ylabel(\"$h_n$\",fontsize=24)\n", + "ax=axs[1]\n", + "ax.plot(w-pi,abs(fft.fftshift(Hh)))\n", + "ax.axis(xmax=pi/2,xmin=-pi/2)\n", + "ax.vlines([-wc,wc],0,1.2,color='g',lw=2., linestyle='--',)\n", + "\n", + "ax.hlines(1,-pi,pi,color='g',lw=2., linestyle='--',)\n", + "ax.set_xlabel(r\"$\\omega$\",fontsize=22)\n", + "ax.set_ylabel(r\"$|H(\\omega)| $\",fontsize=22)\n", + "\n", + "ax=axs[2]\n", + "ax.plot(w-pi,20*log10(abs(fft.fftshift(Hh))))\n", + "ax.axis(ymin=-80,xmax=pi/2,xmin=-pi/2)\n", + "ax.vlines([-wc,wc],10,-80,color='g', lw=2., linestyle='--',)\n", + "ax.hlines(0,-pi,pi,color='g', lw=2., linestyle='--',)\n", + "ax.set_xlabel(r\"$\\omega$\",fontsize=22)\n", + "ax.set_ylabel(r\"$20\\log_{10}|H(\\omega)| $\",fontsize=18)\n", + "\n", + "plt.show()" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/Digital Signal Processing/Python for Signal Processing/Chapter5 - Finite Impulse Response Filters/__init__.py b/Digital Signal Processing/Python for Signal Processing/Chapter5 - Finite Impulse Response Filters/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Digital Signal Processing/Python for Signal Processing/__init__.py b/Digital Signal Processing/Python for Signal Processing/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Digital Signal Processing/SciPy/FIR_filter.py b/Digital Signal Processing/SciPy/FIR_filter.py new file mode 100644 index 00000000..a45c7876 --- /dev/null +++ b/Digital Signal Processing/SciPy/FIR_filter.py @@ -0,0 +1,22 @@ +import numpy as np +import scipy.signal as signal +import matplotlib.pyplot as plt + +b1 = signal.firwin(40, 0.5) +b2 = signal.firwin(41, [0.3, 0.8]) +w1, h1 = signal.freqz(b1) +w2, h2 = signal.freqz(b2) + +plt.title('Digital filter frequency response') +plt.plot(w1, 20*np.log10(np.abs(h1)), 'b') +plt.plot(w2, 20*np.log10(np.abs(h2)), 'r') +plt.ylabel('Amplitude Response (dB)') +plt.xlabel('Frequency (rad/sample)') +plt.grid() +plt.show() + +# Source: https://scipy.github.io/devdocs/tutorial/signal.html#filter-transformations + +# Reference: https://stackoverflow.com/questions/37833940/frequency-response-scipy-signal + +# Reference2: https://www.google.com/search?q=python+z+transform diff --git a/Digital Signal Processing/SciPy/__init__.py b/Digital Signal Processing/SciPy/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/92002__jcveliz__violin-origional.wav b/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/92002__jcveliz__violin-origional.wav new file mode 100644 index 00000000..36a8470e Binary files /dev/null and b/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/92002__jcveliz__violin-origional.wav differ diff --git a/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/Signals.ipynb b/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/Signals.ipynb new file mode 100644 index 00000000..b0e8e5bc --- /dev/null +++ b/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/Signals.ipynb @@ -0,0 +1,127 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEYCAYAAAAJeGK1AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAABIrUlEQVR4nO29d3hc13nn/3lnBn0GvRcSLADYRUoUJVmSJduyLblIcslGTpxVEvvnzcZ+skl2s1F+fp64Jdl495fHXidxHK3jRF7bkRzHRbblqmIVi5RosRNEIVgAEB0EMOhlzu+PuQNCIPqUe+/M+3meeThz63t5cM97znu+5z1ijEFRFEVRnIbHbgMURVEUZSnUQSmKoiiORB2UoiiK4kjUQSmKoiiORB2UoiiK4kh8dhuwEYqLi01tba3dZi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iDooRVEUxZGog1IURVEciTooRVEUxZGog1IURVEciTooRVknIlK0ICNzt4h0Wt9HReSLcbrnH4rIf1xh/7tE5NPxuLei2IXKzBUlCkTkk8CoMeb/i+M9fMBrhLO7zy5zjFjH3G6MGY+XLYqSSLQHpSgxQkTujqyXJCKfFJHHROQFEbkkIu8Vkf9prUn0YyuNEyJyk4j8wkpi+hMRqVji0m8mnBpm1jrnDyS8TtZJEXkcwIRbms8B70rIwypKAlAHpSjxYxth53I/8DXgWWPMXmACeKflpP4WeL8x5ibgK8BfLnGd24GFyVofAQ4YY/YBv7dg+1Hgzpg/haLYhM9uAxQlifmRMWZGRE4Rzgn3Y2v7KcI5EhuAPcDPwhE6vIRTUy2mgvB6WBFOAl8Xke8STnkToReojJ35imIv6qAUJX5MARhjQiIyY64N+IYIv3sCnDHGrLZ09wThvGcR3kl48bp3Ax8Xkb1W+C/TOlZRkgIN8SmKfTQBJSJyG4SXFxGR3Usc1whst47xADXGmGeBPyW8xIHfOq6ecFJaRUkK1EEpik2Y8FLa7wc+KyInCGdsf8MSh/6IcI8JwmHAr1lhw2PAF8y1pb/fBPwwnjYrSiJRmbmiuAAR+Q7w340xLcvsLwO+YYx5S2ItU5T4oQ5KUVyAiDQAZcaY55fZfzMwY4w5nlDDFCWOqINSFEVRHImOQSmKoiiORB2UoiiK4kjUQSmKoiiORB2UoiiK4kjUQSmKoiiO5P8HOmVGYZ9CBFUAAAAASUVORK5CYII=\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "from thinkdsp import CosSignal, SinSignal, decorate\n", + "import matplotlib.pyplot as plt\n", + "\n", + "cosine_signal = CosSignal(freq=440, amp=1.0, offset=0)\n", + "\n", + "sine_signal = SinSignal(freq=880, amp=0.5, offset=0)\n", + "\n", + "cosine_signal.plot()\n", + "decorate(xlabel='Time (s)')\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "outputs": [ + { + "data": { + "text/plain": "
",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4uLK4G4K6fOMAHQKIY6ts555pOufSe5AetbePwDwaSLal+n+K8wsy5hucRcfY/nRDaCciI4B6akhiGjPCsudB9CQWcYEoEYI8RzSc+e4ATgyyzUhXXSTMd3iAMVYHoj0lNrvAfAlIjqNdLXta1ZY9NdIPzEB6W7A72W6DU8B+DeRnmMHAG4E8Hgu28yY0jjNnDGVIaKfA/iUEKJ3lZ97AfynEOLm/LaMsfziAMWYyhBRMwCvEOL5VX5+FYC4EOKNvDaMsTzjAMUYY0yVeAyKMcaYKnGAYowxpkocoBhjjKkSByjGGGOqxAGKMcaYKv3/9uO4QByWSy0AAAAASUVORK5CYII=\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "sine_signal.plot()\n", + "decorate(xlabel='Time (s)')\n", + "\n", + "plt.show()" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 3, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEYCAYAAAAJeGK1AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAA/XUlEQVR4nO3deXxb13kn/N8DgCRAAAS4EwQpLhIla7Ut0ZJlO46dxZETJ06zTO00i9O4Tptk0n46M53MpNO305lOt/edT9+mbfK6jj2Ok1qJ7cRxHceOk3pJbW2URHHRyh0ASZEECYAb9vP+AVyKlrkAxN1APN/Ph59Q5CVwbh7jPvee85xzSAgBxhhjTG8MWjeAMcYYWwknKMYYY7rECYoxxpgucYJijDGmS5ygGGOM6ZJJ6waspqqqSjQ3N2vdDMYYY1k6ffr0lBCiOtfX0W2Cam5uRkdHh9bNYIwxliUiGpbjdbiLjzHGmC5xgmKMMaZLnKAYY4zpEicoxhhjusQJijHGmC5xgmKMMaZLn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H9mRLvzZgecJk5Y1kioj8FMCeE+L8VfA8TgDNIrfAeX+UYSh9zuxBiQam2MKYVfoJiLAdEdJe0VxIR/SkRPUlEvyaiYSL6BBH9dXo/opfTSzmBiA4Q0RvpBUxfISLXCi/9PqSWg4mn/+brlNorq4uIjgKASN1dvg7gPlVOljGVcYJiTF5bkUouHwPwfQCvCSH2AlgE8JF0kvoWgE8JIQ4AeBzAn6/wOrcDWL5Q6zcA3CyE2Afgd5f9vAPAe2Q/C8Z0wKR1AxjbZH4uhIgRUTdS68G9nP55N1LrJe4AsAfAq6keOhiRWqbqei6k9sSSdAH4ARE9j9RSN5IJAPXyNZ8x/eAExZi8IgAghEgSUUxcG+RNIvV5IwC9Qoj1tuxeRGqtM8lHkNq07qMAvklEe9Pdf+b0sYxtOtzFx5i6LgGoJqLDQGqLESLavcJxFwBsSx9jANAohHgNwH9GalsDW/q47UgtSsvYpsMJijEVidT22Z8C8FdEdA6pVdtvW+HQnyP1xASkugG/n+42PAvg78S1Lb/vBvAzJdvMmFa4zJwxnSKinwD4IyHElVV+Xwvgn4UQ71e3ZYypgxMUYzpFRDsA1Aoh3lzl97cAiAkhOlVtGGMq4QTFGGNMl3gMijHGmC5xgmKMMaZLnKAYY4zpEicoxhhjusQJijHGmC79/+qc3kR3E5YgAAAAAElFTkSuQmCC\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "mix = sine_signal + cosine_signal\n", + "\n", + "mix.plot()\n", + "decorate(xlabel='Time (s)')\n", + "\n", + "plt.show()" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/Signals.py b/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/Signals.py new file mode 100644 index 00000000..c56033c1 --- /dev/null +++ b/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/Signals.py @@ -0,0 +1,16 @@ +from thinkdsp import CosSignal, SinSignal, decorate +import matplotlib.pyplot as plt + +cosine_signal = CosSignal(freq=440, amp=1.0, offset=0) + +sine_signal = SinSignal(freq=880, amp=0.5, offset=0) + +cosine_signal.plot() +decorate(xlabel='Time (s)') + +# figure, (axes1, axes2) = plt.subplots(nrows=2) + +# axes1.plot(cosine_signal) +# axes1.set_xlabel('Time (s)') + +plt.show() diff --git a/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/Spectral Decomposition.ipynb b/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/Spectral Decomposition.ipynb new file mode 100644 index 00000000..16ccfcbd --- /dev/null +++ b/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/Spectral Decomposition.ipynb @@ -0,0 +1,169 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [ + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[1;31mModuleNotFoundError\u001B[0m Traceback (most recent call last)", + "\u001B[1;32m~\\AppData\\Local\\JetBrains\\Toolbox\\apps\\IDEA-U\\ch-0\\213.6777.52.plugins\\python\\helpers\\pydev\\_pydevd_bundle\\pydevd_cython_wrapper.py\u001B[0m in \u001B[0;36m\u001B[1;34m\u001B[0m\n\u001B[0;32m 7\u001B[0m \u001B[1;32mtry\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m----> 8\u001B[1;33m \u001B[1;32mfrom\u001B[0m \u001B[0m_pydevd_bundle_ext\u001B[0m \u001B[1;32mimport\u001B[0m \u001B[0mpydevd_cython\u001B[0m \u001B[1;32mas\u001B[0m \u001B[0mmod\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m 9\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n", + "\u001B[1;31mModuleNotFoundError\u001B[0m: No module named '_pydevd_bundle_ext'", + "\nDuring handling of the above exception, another exception occurred:\n", + "\u001B[1;31mImportError\u001B[0m Traceback (most recent call last)", + "\u001B[1;32m~\\AppData\\Local\\JetBrains\\Toolbox\\apps\\IDEA-U\\ch-0\\213.6777.52.plugins\\python\\helpers\\pydev\\_pydevd_bundle\\pydevd_cython_wrapper.py\u001B[0m in \u001B[0;36m\u001B[1;34m\u001B[0m\n\u001B[0;32m 10\u001B[0m \u001B[1;32mexcept\u001B[0m \u001B[0mImportError\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m---> 11\u001B[1;33m \u001B[1;32mfrom\u001B[0m \u001B[0m_pydevd_bundle\u001B[0m \u001B[1;32mimport\u001B[0m \u001B[0mpydevd_cython\u001B[0m \u001B[1;32mas\u001B[0m \u001B[0mmod\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m 12\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n", + "\u001B[1;31mImportError\u001B[0m: cannot import name 'pydevd_cython' from '_pydevd_bundle' (C:\\Users\\ted10014\\AppData\\Local\\JetBrains\\Toolbox\\apps\\IDEA-U\\ch-0\\213.6777.52.plugins\\python\\helpers\\pydev\\_pydevd_bundle\\__init__.py)", + "\nDuring handling of the above exception, another exception occurred:\n", + "\u001B[1;31mKeyboardInterrupt\u001B[0m Traceback (most recent call last)", + "\u001B[1;32m~\\AppData\\Local\\Temp\\ipykernel_39080\\3607238440.py\u001B[0m in \u001B[0;36m\u001B[1;34m\u001B[0m\n\u001B[0;32m 7\u001B[0m \u001B[0mremove_imported_pydev_package\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 8\u001B[0m \u001B[1;32mimport\u001B[0m \u001B[0mpydev_jupyter_utils\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m----> 9\u001B[1;33m \u001B[0mpydev_jupyter_utils\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mattach_to_debugger\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;36m65124\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m", + "\u001B[1;32m~\\AppData\\Local\\JetBrains\\Toolbox\\apps\\IDEA-U\\ch-0\\213.6777.52.plugins\\python\\helpers-pro\\jupyter_debug\\pydev_jupyter_utils.py\u001B[0m in \u001B[0;36mattach_to_debugger\u001B[1;34m(debugger_port)\u001B[0m\n\u001B[0;32m 72\u001B[0m \u001B[0mipython_shell\u001B[0m \u001B[1;33m=\u001B[0m \u001B[0mget_ipython\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 73\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m---> 74\u001B[1;33m \u001B[1;32mimport\u001B[0m \u001B[0mpydevd\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m 75\u001B[0m \u001B[1;32mfrom\u001B[0m \u001B[0m_pydev_bundle\u001B[0m \u001B[1;32mimport\u001B[0m \u001B[0mpydev_localhost\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 76\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n", + "\u001B[1;32m~\\AppData\\Local\\JetBrains\\Toolbox\\apps\\IDEA-U\\ch-0\\213.6777.52.plugins\\python\\helpers\\pydev\\pydevd.py\u001B[0m in \u001B[0;36m\u001B[1;34m\u001B[0m\n\u001B[0;32m 53\u001B[0m \u001B[1;32mfrom\u001B[0m \u001B[0m_pydevd_bundle\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mpydevd_frame_utils\u001B[0m \u001B[1;32mimport\u001B[0m \u001B[0madd_exception_to_frame\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mremove_exception_from_frame\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 54\u001B[0m \u001B[1;32mfrom\u001B[0m \u001B[0m_pydevd_bundle\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mpydevd_kill_all_pydevd_threads\u001B[0m \u001B[1;32mimport\u001B[0m \u001B[0mkill_all_pydev_threads\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m---> 55\u001B[1;33m from _pydevd_bundle.pydevd_trace_dispatch import (\n\u001B[0m\u001B[0;32m 56\u001B[0m trace_dispatch as _trace_dispatch, global_cache_skips, global_cache_frame_skips, show_tracing_warning)\n\u001B[0;32m 57\u001B[0m from _pydevd_frame_eval.pydevd_frame_eval_main import (\n", + "\u001B[1;32m~\\AppData\\Local\\JetBrains\\Toolbox\\apps\\IDEA-U\\ch-0\\213.6777.52.plugins\\python\\helpers\\pydev\\_pydevd_bundle\\pydevd_trace_dispatch.py\u001B[0m in \u001B[0;36m\u001B[1;34m\u001B[0m\n\u001B[0;32m 53\u001B[0m \u001B[1;31m# Regular: use fallback if not found and give message to user\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 54\u001B[0m \u001B[1;32mtry\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m---> 55\u001B[1;33m \u001B[1;32mfrom\u001B[0m \u001B[0m_pydevd_bundle\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mpydevd_cython_wrapper\u001B[0m \u001B[1;32mimport\u001B[0m \u001B[0mtrace_dispatch\u001B[0m \u001B[1;32mas\u001B[0m \u001B[0m_trace_dispatch\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mglobal_cache_skips\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mglobal_cache_frame_skips\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mfix_top_level_trace_and_get_trace_func\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m 56\u001B[0m \u001B[1;32mdef\u001B[0m \u001B[0mtrace_dispatch\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mpy_db\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mframe\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mevent\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0marg\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 57\u001B[0m \u001B[1;32mif\u001B[0m \u001B[0m_trace_dispatch\u001B[0m \u001B[1;32mis\u001B[0m \u001B[1;32mNone\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n", + "\u001B[1;32m~\\AppData\\Local\\JetBrains\\Toolbox\\apps\\IDEA-U\\ch-0\\213.6777.52.plugins\\python\\helpers\\pydev\\_pydevd_bundle\\pydevd_cython_wrapper.py\u001B[0m in \u001B[0;36m\u001B[1;34m\u001B[0m\n\u001B[0;32m 33\u001B[0m \u001B[0mmod_name\u001B[0m \u001B[1;33m=\u001B[0m \u001B[1;34m'pydevd_cython_%s_%s%s_%s'\u001B[0m \u001B[1;33m%\u001B[0m \u001B[1;33m(\u001B[0m\u001B[0msys\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mplatform\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0msys\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mversion_info\u001B[0m\u001B[1;33m[\u001B[0m\u001B[1;36m0\u001B[0m\u001B[1;33m]\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0msys\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mversion_info\u001B[0m\u001B[1;33m[\u001B[0m\u001B[1;36m1\u001B[0m\u001B[1;33m]\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mplat\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 34\u001B[0m \u001B[0mcheck_name\u001B[0m \u001B[1;33m=\u001B[0m \u001B[1;34m'_pydevd_bundle.%s'\u001B[0m \u001B[1;33m%\u001B[0m \u001B[1;33m(\u001B[0m\u001B[0mmod_name\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m---> 35\u001B[1;33m \u001B[0mmod\u001B[0m \u001B[1;33m=\u001B[0m \u001B[0mgetattr\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0m__import__\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mcheck_name\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mmod_name\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m 36\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 37\u001B[0m \u001B[1;31m# Regardless of how it was found, make sure it's later available as the\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n", + "\u001B[1;32mc:\\program files (x86)\\microsoft visual studio\\shared\\python37_64\\lib\\importlib\\_bootstrap.py\u001B[0m in \u001B[0;36mparent\u001B[1;34m(self)\u001B[0m\n", + "\u001B[1;31mKeyboardInterrupt\u001B[0m: " + ] + } + ], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 1, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD4CAYAAADvsV2wAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAXtklEQVR4nO3deWyc933n8fd3bt6kSEqiSVmUZMWWj7ixGTtpnbbZOK2ToHZ2kwBJj7UXNYzdbdA/tn/URRYtkP7RC2ixiwZt3TRbpy3ipC6CKLVbN3EOI40vOrAlWb6owxYpShpS4jWc4Vy//YPTltGMxBnODGee5/m8AMLzHPwdesgPf/49v3nGnHOIiIj/hVrdABER2R4KfBGRgFDgi4gEhAJfRCQgFPgiIgERaXUDrmRoaMiNj4+3uhkiIp7y0ksvzTnnhisda9vAHx8fZ3JystXNEBHxFDN7+0rHNKUjIhIQCnwRkYBQ4IuIBIQCX0QkIBT4IiIBocAXEQkIBb6ISEC07Tr8evzwxBw7umIYRiIa4todnZhZ1d/vnGN5Lc/8Snb9dSbPqbkUu3oThAwW0zm64hFG+zuIhI2OaJjB7nhNbcwXisynspxfyhAJhVjLFziZTLGzN05HNEw2XwTgwM5uouEQXfEw8Ui46vKz+SLZQpFLqSxvz6/SnYiQLxSZWUjTHY+woytGyIxcoch1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BatLrQAAAABJRU5ErkJggg==\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "import thinkdsp\n", + "import matplotlib.pyplot as plt\n", + "\n", + "cos_signal = thinkdsp.CosSignal(freq=440, amp=1.0, offset=0)\n", + "sin_sigal = thinkdsp.SinSignal(freq=880, amp=0.5, offset=0)\n", + "\n", + "mix = sin_sigal + cos_signal\n", + "\n", + "wave = mix.make_wave(duration=0.5, start=0, framerate=11025)\n", + "\n", + "wave.plot()\n", + "\n", + "plt.show()" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 2, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEGCAYAAABy53LJAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAABDUklEQVR4nO29eXRkV3Xv/9lVmqXSPKvVre7W0K1Wt7sbuT0bT2A7YJs5NuRh8iB+kJDhsUhsHu8HPDIsSPJCfsmPJDhgMBhsiLGxARtjjPHcbfc8amr1IKk1j6VZVXV+f9S9clmWWkPdqrq36nzWqqWqO9WWju7Z9+z9PfuIUgqNRqPRaFaKK9YGaDQajcZZaMeh0Wg0mlWhHYdGo9FoVoV2HBqNRqNZFdpxaDQajWZVJMXagLVQWFioqqqqYm2GRqPROIoDBw4MKKWKwr2OIx1HVVUV+/fvj7UZGo1G4yhE5JwV19GhKo1Go9GsCu04NBqNRrMqtOPQaDQazarQjkOj0Wg0q0I7Do1Go9GsCksch4g8ICJ9InJ8if0iIv8iIm0iclREdofsu1tEWo3X3VbYo9FoNJrIYdWI43vALRfZfytQY7zuAf4dQETygS8DlwF7gC+LSJ5FNmk0Go0mAljiOJRSLwJDFznkDuD7KsheIFdEyoCbgWeVUkNKqWHg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rNqnB6jkOj0Wg0UUY7Do1Go9GsCu04NBqNRrMqtOPQaDQazarQjkOj0Wg0q0I7Dk1CIyIFIVVBe0Sky3g/LiL/FqHv/AsR+fhF9r9XRL4aie/WaKxAy3E1GgMR+QowrpT6xwh+RxJwkGBlYN8Sx4hxzFVKqclI2aLRrBU94tBoFkFErjPXrRCRr4jIgyLykoicE5EPiMjfG2tF/MoonYKIvENEXjCK8j0jImWLXPoGgmUdfMY5fybBNUmOisgjACr4NPc74L1R+WU1mlWiHYdGszI2E+z0bwceAp5XSm0HpoD3GM7jX4EPKaXeATwA/O0i17kKCC02eB+wSym1A/h0yPb9wDWW/xYajQUkxdoAjcYhPK2UmhORYwRrKf3K2H6MYI2wOqABeDYYacJNsATMQsoIrj1ichT4oYj8jGB5CpM+oNw68zUa69COQ6NZGTMASqmAiMypN5ODAYL3kQAnlFLLLRM6RbCWkMl7CC78cxvwRRHZboSx0oxjNRrboUNVGo01NANF5vrSIpIsItsWOe4UUG0c4wIqlVLPA/cSLH+dZRxXS7CIokZjO7Tj0GgsQAWX8fwQ8HUROUKw2u+Vixz6NMERBgTDWQ8Z4a9DwL+oN5cZvR74ZSRt1mjWipbjajRRRkQeB/5KKdW6xP4S4EdKqRuja5lGszK049BoooyI1AElSqkXl9h/KTCnlDocVcM0mhWiHYdGo9FoVoXOcWg0Go1mVWjHodFoNJpVoR2HRqPRaFaFdhwajUajWRXacWg0Go1mVfz/ajqFrRaKOnQAAAAASUVORK5CYII=\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "cos_signal.plot()\n", + "\n", + "plt.xlabel(xlabel='Time (s)')\n", + "\n", + "plt.show()" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 3, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEGCAYAAAB/+QKOAAAAOXRFWHRTb2Z0d2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\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "period = mix.period\n", + "segment = wave.segment(start=0, duration=period*3)\n", + "\n", + "segment.plot()\n", + "\n", + "plt.xlabel(xlabel='Time (s)')\n", + "\n", + "plt.show()" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/Spectral Decomposition.py b/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/Spectral Decomposition.py new file mode 100644 index 00000000..7ea2ce52 --- /dev/null +++ b/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/Spectral Decomposition.py @@ -0,0 +1,13 @@ +import thinkdsp +import matplotlib.pyplot as plt + +cos_signal = thinkdsp.CosSignal(freq=440, amp=1.0, offset=0) +sin_sigal = thinkdsp.SinSignal(freq=880, amp=0.5, offset=0) + +mix = sin_sigal + cos_signal + +wave = mix.make_wave(duration=0.5, start=0, framerate=11025) + +wave.plot() + +plt.show() diff --git a/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/__init__.py b/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/low_pass_filter.ipynb b/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/low_pass_filter.ipynb new file mode 100644 index 00000000..273585e2 --- /dev/null +++ b/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/low_pass_filter.ipynb @@ -0,0 +1,211 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": true, + "pycharm": { + "name": "#%%\n" + } + }, + "outputs": [], + "source": [ + "from thinkdsp import read_wave, play_wave\n", + "import matplotlib.pyplot as plt\n", + "\n", + "wave = read_wave('92002__jcveliz__violin-origional.wav')\n", + "\n", + "play_wave(wave, player='Groove Music')" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD4CAYAAADvsV2wAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAh0UlEQVR4nO3deXhV1dn+8e+ThCSQhDFhhoR5UkCJgAOiAgo4oNU619raWutr9a19tVSqtWpbqq1Vq7Wl1p9DW61aB1rAAVREESWMMgoyhTGQECAJIcNZvz8SMEASkpxhn+H+XJdXz7Cz17Nz6J191l57LXPOISIi0S/O6wJERCQ0FPgiIjFCgS8iEiMU+CIiMUKBLyISIxK8LqAu6enpLisry+syREQiyqJFi/Y45zJqey9sAz8rK4ucnByvyxARiShmtrmu99SlIyISIxT4IiIxQoEvIhIjFPgiIjFCgS8iEiMU+CIiMUKBLyISIxT4IhI2fD5HbkEJH6zJ87qUqKTAFxHPFR2qoNLnuOCxjxj18Ad857mFlFX4ePTdtRwsqzyy3f7ScrYVHvSw0shm4boASnZ2ttOdtiLRbfnWQi558hMAeqansGFPcYN+7suHJvD64q1cmd2NuDgLZokRx8wWOeeya3svbKdWEJHos2LbPj7fWMDs1buY/1X+Ue81NOwB7nptGW8t3c7v3/uSCwZ14MrsbnRslczBskoy26UEuuyooTN8EQmq/KJD3PfWSgZ0SuN3734Z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BjeRB4zsy+AIyqrlC/pn/W1AoiIjEiqrt0RETkawp8EZEYocAXEYkRCnwRkRihwBcRiREKfBGRGKHAFxGJEf8f9inKY0BiS78AAAAASUVORK5CYII=\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "from thinkdsp import read_wave, play_wave\n", + "\n", + "wave = read_wave('92002__jcveliz__violin-origional.wav')\n", + "\n", + "segment = wave.segment(start=1.2, duration=0.6)\n", + "\n", + "segment.plot()" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 29, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEGCAYAAABmXi5tAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAjwUlEQVR4nO3deXxU1f3/8dcnCUkgCXvYlyA7KKBEcMMNVFAUW/26ttbW1lq/Vr+1Xy2Vaq3afqm21lqtLbX+itZq1brQAi6gIoqoYZVVkC3skBAgBMgy5/fHDBggCUlm7txZ3s/Hw4czc2/u+VwG3rlz5txzzDmHiIgkvhS/CxARkehQ4IuIJAkFvohIklDgi4gkCQW+iEiSSPO7gNq0bdvW5eXl+V2GiEhcmTdv3k7nXG5N22I28PPy8igoKPC7DBGRuGJm62vbpi4dEZEkocAXEUkSCnwRkSShwBcRSRIKfBGRJKHAFxFJEgp8EZEkocAXkZgRCDgKi8t4b8V2v0tJSAp8EfFd6cFKqgKOix77gBEPv8e3//YZ5ZUBHn17JfvLqw7vt+dABZtK9vtYaXyzWF0AJT8/3+lOW5HEtnhjCZc98REAJ7TNYs3OffX6uS8eGsOr8zdyVX5XUlLMyxLjjpnNc87l17QtZqdWEJHEs2TTbj5dW8yM5duY82XREdvqG/YAd72yiDcWbua373zBRQP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cc4tN7M3gcVAAHjaOVfn0Fo/1PPv19eAt51z+3wpsp7qcS4PAn8zs88BI9gVGtb0z5paQUQkSSR0l46IiHxFgS8ikiQU+CIiSUKBLyKSJBT4IiJJQoEvScHM2lSbRXGrmW0KPS41sz961Ob/1DVFgZmNNbMHvGhbpCYalilJx8zuB0qdc7/xsI00glMvnOKcq3HCq9BNW/OBM51zZV7VInKIrvAlqYXmgP9P6PH9ZjbZzGab2Xoz+7qZPWzB9RTeNLMmof2Gmtms0CRjb5lZxxoOfT4w/1DYm9ntZrbMgmsavAgQuknrfWBsVE5Wkp4CX+RIPQmG9WXA34H3nHMnEbyT9pJQ6P+B4Dz+Q4FngF/WcJwzgXnVno8HTnbODQJuqfZ6ATAi4mchUoO4nlpBxAPTnXMVodvZU4E3Q69/DuQRnM/kRIIzFxLaZ0sNx+nIkXPRLAaeN7PXCc6qech2oFPkyhepnQJf5EgHAULTN1dUmxsnQPDfiwFLnXOnH+c4+4HMas8vIbjC0aXABDM7KdTdkxnaV8Rz6tIRaZiVQK6ZnQ5gZk1qWfhkOdArtE8K0NU59x7wE6AFwRWMILjwSMxNUiaJSYEv0gDOuXKCs2T+2swWEVyg4owadp1O8Ioegt0+fw91Ey0AHnfOlYS2nUdwBTMRz2lYpohHzOw14G7n3KpatrcH/uGcGxndyiRZKfBFPGJmfYH2oRXKatp+KlDhnFsY1cIkaSnwRUSShPrwRUSShAJfRCRJKPBFRJKEAl9EJEko8EVEksT/B1CLYo0HHyAyAAAAAElFTkSuQmCC\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plt.xlabel('Time (s)')\n", + "segment.plot()" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 30, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEGCAYAAACJnEVTAAAAOXRFWHRTb2Z0d2FyZQBNYXRwb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Icq874sabykcVH8fN/RfIqiN8j/lbbx9Yi4WtIUiuaebX3Mb+ZeNi0vkm6lCONv12h9ZwGPA79b7ZJSSZ8H9kbED/q5js8DeyLi7n5X1LLh5h2zISLpBorfX/1KH/cQ3En3cwXHaxdHftTb7Kh8pG9mlhEf6ZuZZcShb2aWEYe+mVlGHPpmZhlx6JuZZeT/A+zGkrwaNZCsAAAAAElFTkSuQmCC\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "spectrum = segment.make_spectrum()\n", + "plt.xlabel('Frequency (Hz)')\n", + "spectrum.plot()" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "markdown", + "source": [ + "The frequency components above 10 kHz are small. We can see the lower frequencies more clearly by providing an upper bound:" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "code", + "execution_count": 31, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD4CAYAAAAAczaOAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAcRklEQVR4nO3deZRc5X3m8e+vqhftUmtBCEnQAusQCzsGWQFh4xl5iNnsGUjG8YFJjMzYR5MEZ+yMMxNIhuAxJ2NmkngyHGMMCbKxjy0WGxsNVoIVxRyMsYVaIIQWFDWgFS0tqdVqqdVLVf3mj3qrVS261bV1bff5nFOnbr11b9331u1+7nvfu5S5OyIiEg2xSldARETKR6EvIhIhCn0RkQhR6IuIRIhCX0QkQhoqXYFzmTlzpre2tla6GiIiNWXjxo1H3H3WcO9Vdei3trbS1tZW6WqIiNQUM9s90nvq3hERiRCFvohIhCj0RUQiRKEvIhIhCn0RkQhR6IuIRIhCX0QkQhT6WV7f18Vre49XuhoiImOmqi/OKrd/+/UXAdh1/8crX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vi3Fsz+wRw2N03VrouZdZAugvgIXe/AjhFerd/UJ2t5xbgZtIbuwuAicANFa1UhZR7vdZj6Nfdj6+bWSPpwP+euz8dig+Z2Zzw/hzgcCgfaflr5Xv5MPDvzGwX8DjpLp7/C0wzs8wvvWXXfXC5wvtTgaPUzvJm7AP2ufv68PoHpDcC9bqefxN429073H0AeJr0uq/39ZxRqvW6PwyfXT6iegz9uvrx9XAk/lFgu7t/Leut1UDmCP5y0n39mfLbw1kAS4GusBv5HHCdmbWEVtZ1oayquPvd7j7P3VtJr7t/dvffBX4GfDKMdvbyZr6HT4bxPZTfGs76WAAsJH3Aqyq5+0Fgr5ldGoquBbZRp+uZdLfOUjObEP7GM8tb1+s5S0nWa3jvhJktDd/j7VmfNbxKH+AYo4MmN5E+y+VN4M8rXZ8il+Ua0rt+m4FN4XET6f7MdcBO4J+A6WF8Ax4My/46sCTrs/4j0B4ed1R62XJY9mWcOXvnYtL/zO3AU0BzKB8XXreH9y/Omv7Pw/ewg1HOaKiGB3A50BbW9Y9Jn6VRt+sZ+B/AG8AW4Lukz8Cpu/UMrCJ93GKA9B7dZ0u5XoEl4Tt8E/g6Z50McPZDt2EQEYmQeuzeERGRESj0RUQiRKEvIhIhCn0RkQhR6IuIRIhCX0QkQhT6IiIR8v8BrVDM0SzVs5QAAAAASUVORK5CYII=\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "spectrum.plot(high=10000)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "markdown", + "source": [ + "Spectrum provides low_pass, which applies a low pass filter; that is, it attenuates all frequency components above a cutoff frequency." + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "code", + "execution_count": 32, + "outputs": [], + "source": [ + "spectrum.low_pass(3000)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 33, + "outputs": [ + { + "data": { + "text/pl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ICkpcBPc+V3kXXbPJ1O1LYDV55g2x2SPgX8laQWshb3xcBbEfGUpL3A3/Sz7kuSJkuaFBH7BtjNz5KNzvjjtI+vR8TlkmaSdfdsH2B9M4+yaeUi6ctkYfyNGm3vNOBR4Nf6u6RU0g3Avoi4a5jbuAHYGxF3D7uiVhru3jEbIZKuIfs94y8NcA/B7Rx/rmCodgP3VLC+lYhb+mZmJeKWvplZiTj0zcxKxKFvZlYiDn0zsxJx6JuZlcj/B4U73J+W7qnLAAAAAElFTkSuQmCC\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plt.xlabel('Frequency (Hz)')\n", + "spectrum.plot(high=10000)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/stop_band.ipynb b/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/stop_band.ipynb new file mode 100644 index 00000000..08c5595a --- /dev/null +++ b/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/stop_band.ipynb @@ -0,0 +1,176 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 42, + "metadata": { + "collapsed": true, + "pycharm": { + "name": "#%%\n" + } + }, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD4CAYAAADvsV2wAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAA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F+QPM2sBjKfqxCJSPQkMALYDXwB3OOd8/uwwJhYxN7NzqQr8sOz3bijn3BvAG2Z2NvAgMNbjkpriMeCnzjlf1YlLRFtM1bwlRWY2EXgT6ONtSU2WAAwDxgDNgU/NbIFz7ktvy2qyi4FPnHOR/A3tAmApcB7QC3jPzOY55/Y3dYdRf4ZvZoOBZ4BJzrl8r+sJhOqvgj3NLN3rWpogG3jZzDYBVwB/MrNLPa2oiZxz+51zRdWPZwLNIvQzAdgKvOOcK3bO7QE+AsJ2kEMDXE0Yd+c00Heo6mZzzrn1wEagvz87jOrAN7PuwOvAtyL4TAUAM+td3ZeHmZ0KJAER9wfMOdfDOZflnMsCXgNudc696W1VTWNmHWt8JsOp+v9TxH0m1d4CzjKzhOrukBHAao9rahIzawWMpuqYItkWqr5xYWYdgH7ABn92GNFdOmb2ElUjJdLNbCvwC6AZgHPuz8B9QDuqziIBKlyYzqbXgGO5HLjBzMqBg8BVNS7iho0GHEfEaMCxXAH80MwqqPpMrg7HzwROfCzOudVm9jawHPABzzjn6h1a64UG/vu6DHjXOVfsSZEN1IBjeRB4zsy+AIyqrlC/pn/W1AoiIjEiqrt0RETkawp8EZEYocAXEYkRCnwRkRihwBcRiREKfBGRGKHAFxGJEf8f9inKY0BiS78AAAAASUVORK5CYII=\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "from thinkdsp import read_wave, play_wave\n", + "import matplotlib.pyplot as plt\n", + "\n", + "wave = read_wave('92002__jcveliz__violin-origional.wav')\n", + "\n", + "segment = wave.segment(start=1.2, duration=0.6)\n", + "\n", + "segment.plot()" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEGCAYAAABmXi5tAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK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LnXOnH+c4+4HMas8vIbjC0aXABDM7KdTdkxnaV8Rz6tIRaZiVQK6ZnQ5gZk1qWfhkOdArtE8K0NU59x7wE6AFwRWMILjwSMxNUiaJSYEv0gDOuXKCs2T+2swWEVyg4owadp1O8Ioegt0+fw91Ey0AHnfOlYS2nUdwBTMRz2lYpohHzOw14G7n3KpatrcH/uGcGxndyiRZKfBFPGJmfYH2oRXKatp+KlDhnFsY1cIkaSnwRUSShPrwRUSShAJfRCRJKPBFRJKEAl9EJEko8EVEksT/B1CLYo0HHyAyAAAAAElFTkSuQmCC\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plt.xlabel('Time (s)')\n", + "segment.plot()" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 44, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEGCAYAAACJnEVTAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAZdElEQVR4nO3de5RV5Z3m8e9ThSJBRBCCiBg0jatDuqMSomaS6WVPHLykO5q1EmN6dUvSztCTpVmdzCQZ0lmzNJ3JJDNJmxkT27Qd6ejE9pbLhBlJI6F1jI4XCoIoUaEiICCXwpJrIUVV/eaP/R44daoOBXU5h6r3+axV6+zz7tu7d53znH3evfd7FBGYmVkeGupdATMzqx2HvplZRhz6ZmYZceibmWXEoW9mlpFR9a7A0UyaNClmzJhR72qYmQ0rK1as2BkRk3sbd0KH/owZM2hqaqp3NczMhhVJG6uNc/OOmVlGHPpmZhlx6JuZZcShb2aWEYe+mVlGHPpmZhlx6JuZZSS70P+nF7exc9/BelfDzKwusgr9fQc7+Hc/WsENdz9X76qYmdVFVqHf2Vn8YMzmN9vqXBMzs/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TgAMXt/p8CPifpfOCUXsK9dPdmuU9I+mDZ898BiIhFpC5FJD0E/N9U3iWpGbjgGLbNMufQt+GiW/NOatPfGEUf51D0fTIX+HV6firFh8A44GcR0ZbmO5Z+mOYC75FU6ldmfFpWO/BcRGxOy1oFzAB2A1sjYjlApF4bJT0M/CdJX6S4Zf+HvaxrKtBSUfZgRNxctq2Pl4+U9CWK/XFHWfEO4Cwc+tYHh74NZ/vLhgV8IyL+rnwCSZ87yvwdHGniPKViWZ+NiG4dzkm6DDhYVtTJUd5DEdEmaSnFD3FcB7y3l8kOVKz7qCRdDnyc4lexyp2SlmV2VG7Tt5FiCfDnKvpJR9I0SW8HngCulTQmtZ//cdk8GzgSxB+rWNZnVHTBi6TzVfRgWs0rwFRJ70vTjytrX/8BcDuwPIpfWKr0Eqn5pi+S3kHR+dfHI6Iy4M+nZzORWQ8+0rcRISIelfQu4Ol0bnUf8KcRsVLSgxS9kO6g6Cq45NvAQyp+beyRsvIfUDTbrEwnals4yk/eRUS7pE8A35U0huKI+3JgX0SskLQH+Icq874sabykcVH8fN/RfIqiN8j/lbbx9Yi4WtIUiuaebX3Mb+ZeNi0vkm6lCONv12h9ZwGPA79b7ZJSSZ8H9kbED/q5js8DeyLi7n5X1LLh5h2zISLpBorfX/1KH/cQ3En3cwXHaxdHftTb7Kh8pG9mlhEf6ZuZZcShb2aWEYe+mVlGHPpmZhlx6JuZZeT/A+zGkrwaNZCsAAAAAElFTkSuQmCC\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "spectrum = segment.make_spectrum()\n", + "plt.xlabel('Frequency (Hz)')\n", + "spectrum.plot()" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 45, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEGCAYAAACJnEVTAAAAOXRFWHRTb2Z0d2FyZQBNYXRwb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Du7j8Y5TK+ABxx99tGXVGJDXXviIwRM7uK6PeMvzrCPQQ30/9cQb4OA3cUML/EiFr6IiIxopa+iEiMKPRFRGJEoS8iEiMKfRGRGFHoi4jEyP8H4RLWVguWbVgAAAAASUVORK5CYII=\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plt.xlabel('Frequency (Hz)')\n", + "spectrum.plot(high=10000)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 46, + "outputs": [], + "source": [ + "spectrum.band_stop(low_cutoff=2000, high_cutoff=4000, factor=0)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 47, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEGCAYAAACJnEVTAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAcZ0lEQVR4nO3de5hcdZ3n8fenL+l0SMidGJJgg0RWvHAxIKzMLK4OIO4M7DxecGckOs5m1lFX3XFmQB8fHN1Z2R1nZpeVQRiJoo9y8UoWmcEs6iIokARCCLehISEXciX3dJJOV333j/OrTqXpTl+quitV5/N6nnrq1O+cU+d3+lR/zqnfOedXigjMzCwfmmpdATMzGzsOfTOzHHHom5nliEPfzCxHHPpmZjnSUusKHMuMGTOio6Oj1tUwM6srK1as2B4RM/sbd1yHfkdHB8uXL691NczM6oqklwYa5+YdM7McceibmeWIQ9/MLEcc+mZmOeLQNzPLEYe+mVmOOPTNzHLEoV/myQ27eWL9rlpXw8xs1BzXN2eNtd/92oMArL3+PTWuiZnZ6PCRvplZjgwa+pLmSfqFpKclPSXpU6l8mqSlkp5Pz1NTuSTdIKlT0ipJ55a918I0/f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VZP+m7gU0RsQwgUi+okr4PfEHSn5PdQv+tfpY1m6xL5XJ3RsQnytb1l+UjJf0F2d/jxrLirWS9VTr07Zgc+lbP9pcNC/hKRNxcPoGkTx9j/h6ONHGO7/Nen4yIozoqk3QxcKisqMAx/ociokvSUrIuhN8PvLWfyQ70WfYxSXoX8D6yX2MqNz69l9kxuU3fGsV9wB8p+90BJM2RdBLwAHClpPbUfv67ZfOs5UgQv7fPe31MWZfWSHq9sh80GchzwGxJ56XpJ5W1r38DuAFYFhE7+5n3GVLzzWAkvZasM673RUTfgH89r24mMnsVH+lbQ4iIn0l6A/CbdG51H/CHEfGYpDvJfkd1K1nX2yVfBe6StAj4aVn5N8iabR5LJ2q3AVceY9ndkj4A/G9J7WRH3O8C9kXECkl7gG8OMO+zkiZLmhQRewdZzQ+T9c74k7SOL0fE5ZJmkTX3bB5kfjP3smn5IumLZGH81TFa3snAL4F/NdAlpZI+A+yNiG+McBmfAfZExK0jrqjlhpt3zEaJpKvJfs/484PcQ3ATR58rGK5dwG0VzG854iN9M7Mc8ZG+mVmOOPTNzHLEoW9mliMOfTOzHHHom5nlyP8HQM1gHsyuEuAAAAAASUVORK5CYII=\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plt.xlabel('Frequency (Hz)')\n", + "spectrum.plot(high=10000)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/thinkdsp.py b/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/thinkdsp.py new file mode 100644 index 00000000..f26785b0 --- /dev/null +++ b/Digital Signal Processing/Think DSP/Chapter1 - Sounds and Signals/thinkdsp.py @@ -0,0 +1,1759 @@ +"""This file contains code used in "Think DSP", +by Allen B. Downey, available from greenteapress.com +Copyright 2013 Allen B. Downey +License: MIT License (https://opensource.org/licenses/MIT) +""" + +import copy +import math + +import numpy as np +import random +import scipy +import scipy.stats +import scipy.fftpack +import subprocess +import warnings + +from wave import open as open_wave +from scipy.io import wavfile + +import matplotlib.pyplot as plt + +try: + from IPython.display import Audio +except: + warnings.warn( + "Can't import Audio from IPython.display; " "Wave.make_audio() will not work." + ) + +PI2 = math.pi * 2 + + +def random_seed(x): + """Initialize the random and np.random generators. + x: int seed + """ + random.seed(x) + np.random.seed(x) + + +class UnimplementedMethodException(Exception): + """Exception if someone calls a method that should be overridden.""" + + +class WavFileWriter: + """Writes wav files.""" + + def __init__(self, filename="sound.wav", framerate=11025): + """Opens the file and sets parameters. + filename: string + framerate: samples per second + """ + self.filename = filename + self.framerate = framerate + self.nchannels = 1 + self.sampwidth = 2 + self.bits = self.sampwidth * 8 + self.bound = 2 ** (self.bits - 1) - 1 + + self.fmt = "h" + self.dtype = np.int16 + + self.fp = open_wave(self.filename, "w") + self.fp.setnchannels(self.nchannels) + self.fp.setsampwidth(self.sampwidth) + self.fp.setframerate(self.framerate) + + def write(self, wave): + """Writes a wave. + wave: Wave + """ + zs = wave.quantize(self.bound, self.dtype) + self.fp.writeframes(zs.tostring()) + + def close(self, duration=0): + """Closes the file. + duration: how many seconds of silence to append + """ + if duration: + self.write(rest(duration)) + + self.fp.close() + + +def read_wave(filename="sound.wav"): + """Reads a wave file. + filename: string + returns: Wave + """ + fp = open_wave(filename, "r") + + nchannels = fp.getnchannels() + nframes = fp.getnframes() + sampwidth = fp.getsampwidth() + framerate = fp.getframerate() + + z_str = fp.readframes(nframes) + + fp.close() + + dtype_map = {1: np.int8, 2: np.int16, 3: "special", 4: np.int32} + if sampwidth not in dtype_map: + raise ValueError("sampwidth %d unknown" % sampwidth) + + if sampwidth == 3: + xs = np.fromstring(z_str, dtype=np.int8).astype(np.int32) + ys = (xs[2::3] * 256 + xs[1::3]) * 256 + xs[0::3] + else: + ys = np.fromstring(z_str, dtype=dtype_map[sampwidth]) + + # if it's in stereo, just pull out the first channel + if nchannels == 2: + ys = ys[::2] + + # ts = np.arange(len(ys)) / framerate + wave = Wave(ys, framerate=framerate) + wave.normalize() + return wave + + +def read_wave_with_scipy(filename): + """Reads a wave file. + filename: string + returns: Wave + """ + # TODO: Check back later and see if this works on 24-bit data, + # and runs without throwing warnings. + framerate, ys = wavfile.read(filename) + + # if it's in stereo, just pull out the first channel + if ys.ndim == 2: + ys = ys[:, 0] + + # ts = np.arange(len(ys)) / framerate + wave = Wave(ys, framerate=framerate) + wave.normalize() + return wave + + +def play_wave(filename="sound.wav", player="aplay"): + """Plays a wave file. + filename: string + player: string name of executable that plays wav files + """ + cmd = "%s %s" % (player, filename) + popen = subprocess.Popen(cmd, shell=True) + popen.communicate() + + +def find_index(x, xs): + """Find the index corresponding to a given value in an array.""" + n = len(xs) + start = xs[0] + end = xs[-1] + i = round((n - 1) * (x - start) / (end - start)) + return int(i) + + +class _SpectrumParent: + """Contains code common to Spectrum and DCT. + """ + + def __init__(self, hs, fs, framerate, full=False): + """Initializes a spectrum. + hs: array of amplitudes (real or complex) + fs: array of frequencies + framerate: frames per second + full: boolean to indicate full or real FFT + """ + self.hs = np.asanyarray(hs) + self.fs = np.asanyarray(fs) + self.framerate = framerate + self.full = full + + @property + def max_freq(self): + """Returns the Nyquist frequency for this spectrum.""" + return self.framerate / 2 + + @property + def amps(self): + """Returns a sequence of amplitudes (read-only property).""" + return np.absolute(self.hs) + + @property + def power(self): + """Returns a sequence of powers (read-only property).""" + return self.amps ** 2 + + def copy(self): + """Makes a copy. + Returns: new Spectrum + """ + return copy.deepcopy(self) + + def max_diff(self, other): + """Computes the maximum absolute difference between spectra. + other: Spectrum + returns: float + """ + assert self.framerate == other.framerate + assert len(self) == len(other) + + hs = self.hs - other.hs + return np.max(np.abs(hs)) + + def ratio(self, denom, thresh=1, val=0): + """The ratio of two spectrums. + denom: Spectrum + thresh: values smaller than this are replaced + val: with this value + returns: new Wave + """ + ratio_spectrum = self.copy() + ratio_spectrum.hs /= denom.hs + ratio_spectrum.hs[denom.amps < thresh] = val + return ratio_spectrum + + def invert(self): + """Inverts this spectrum/filter. + returns: new Wave + """ + inverse = self.copy() + inverse.hs = 1 / inverse.hs + return inverse + + @property + def freq_res(self): + return self.framerate / 2 / (len(self.fs) - 1) + + def render_full(self, high=None): + """Extracts amps and fs from a full spectrum. + high: cutoff frequency + returns: fs, amps + """ + hs = np.fft.fftshift(self.hs) + amps = np.abs(hs) + fs = np.fft.fftshift(self.fs) + i = 0 if high is None else find_index(-high, fs) + j = None if high is None else find_index(high, fs) + 1 + return fs[i:j], amps[i:j] + + def plot(self, high=None, **options): + """Plots amplitude vs frequency. + Note: if this is a full spectrum, it ignores low and high + high: frequency to cut off at + """ + if self.full: + fs, amps = self.render_full(high) + plt.plot(fs, amps, **options) + else: + i = None if high is None else find_index(high, self.fs) + plt.plot(self.fs[:i], self.amps[:i], **options) + + def plot_power(self, high=None, **options): + """Plots power vs frequency. + high: frequency to cut off at + """ + if self.full: + fs, amps = self.render_full(high) + plt.plot(fs, amps ** 2, **options) + else: + i = None if high is None else find_index(high, self.fs) + plt.plot(self.fs[:i], self.power[:i], **options) + + def estimate_slope(self): + """Runs linear regression on log power vs log frequency. + returns: slope, inter, r2, p, stderr + """ + x = np.log(self.fs[1:]) + y = np.log(self.power[1:]) + t = scipy.stats.linregress(x, y) + return t + + def peaks(self): + """Finds the highest peaks and their frequencies. + returns: sorted list of (amplitude, frequency) pairs + """ + t = list(zip(self.amps, self.fs)) + t.sort(reverse=True) + return t + + +class Spectrum(_SpectrumParent): + """Represents the spectrum of a signal.""" + + def __len__(self): + """Length of the spectrum.""" + return len(self.hs) + + def __add__(self, other): + """Adds two spectrums elementwise. + other: Spectrum + returns: new Spectrum + """ + if other == 0: + return self.copy() + + assert all(self.fs == other.fs) + hs = self.hs + other.hs + return Spectrum(hs, self.fs, self.framerate, self.full) + + __radd__ = __add__ + + def __mul__(self, other): + """Multiplies two spectrums elementwise. + other: Spectrum + returns: new Spectrum + """ + assert all(self.fs == other.fs) + hs = self.hs * other.hs + return Spectrum(hs, self.fs, self.framerate, self.full) + + def convolve(self, other): + """Convolves two Spectrums. + other: Spectrum + returns: Spectrum + """ + assert all(self.fs == other.fs) + if self.full: + hs1 = np.fft.fftshift(self.hs) + hs2 = np.fft.fftshift(other.hs) + hs = np.convolve(hs1, hs2, mode="same") + hs = np.fft.ifftshift(hs) + else: + # not sure this branch would mean very much + hs = np.convolve(self.hs, other.hs, mode="same") + + return Spectrum(hs, self.fs, self.framerate, self.full) + + @property + def real(self): + """Returns the real part of the hs (read-only property).""" + return np.real(self.hs) + + @property + def imag(self): + """Returns the imaginary part of the hs (read-only property).""" + return np.imag(self.hs) + + @property + def angles(self): + """Returns a sequence of angles (read-only property).""" + return np.angle(self.hs) + + def scale(self, factor): + """Multiplies all elements by the given factor. + factor: what to multiply the magnitude by (could be complex) + """ + self.hs *= factor + + def low_pass(self, cutoff, factor=0): + """Attenuate frequencies above the cutoff. + cutoff: frequency in Hz + factor: what to multiply the magnitude by + """ + self.hs[abs(self.fs) > cutoff] *= factor + + def high_pass(self, cutoff, factor=0): + """Attenuate frequencies below the cutoff. + cutoff: frequency in Hz + factor: what to multiply the magnitude by + """ + self.hs[abs(self.fs) < cutoff] *= factor + + def band_stop(self, low_cutoff, high_cutoff, factor=0): + """Attenuate frequencies between the cutoffs. + low_cutoff: frequency in Hz + high_cutoff: frequency in Hz + factor: what to multiply the magnitude by + """ + # TODO: test this function + fs = abs(self.fs) + indices = (low_cutoff < fs) & (fs < high_cutoff) + self.hs[indices] *= factor + + def pink_filter(self, beta=1): + """Apply a filter that would make white noise pink. + beta: exponent of the pink noise + """ + denom = self.fs ** (beta / 2.0) + denom[0] = 1 + self.hs /= denom + + def differentiate(self): + """Apply the differentiation filter. + returns: new Spectrum + """ + new = self.copy() + new.hs *= PI2 * 1j * new.fs + return new + + def integrate(self): + """Apply the integration filter. + returns: new Spectrum + """ + new = self.copy() + zero = (new.fs == 0) + new.hs[~zero] /= PI2 * 1j * new.fs[~zero] + new.hs[zero] = np.inf + return new + + def make_integrated_spectrum(self): + """Makes an integrated spectrum. + """ + cs = np.cumsum(self.power) + cs /= cs[-1] + return IntegratedSpectrum(cs, self.fs) + + def make_wave(self): + """Transforms to the time domain. + returns: Wave + """ + if self.full: + ys = np.fft.ifft(self.hs) + else: + ys = np.fft.irfft(self.hs) + + # NOTE: whatever the start time was, we lose it when + # we transform back; we could fix that by saving start + # time in the Spectrum + # ts = self.start + np.arange(len(ys)) / self.framerate + return Wave(ys, framerate=self.framerate) + + +class IntegratedSpectrum: + """Represents the integral of a spectrum.""" + + def __init__(self, cs, fs): + """Initializes an integrated spectrum: + cs: sequence of cumulative amplitudes + fs: sequence of frequencies + """ + self.cs = np.asanyarray(cs) + self.fs = np.asanyarray(fs) + + def plot_power(self, low=0, high=None, expo=False, **options): + """Plots the integrated spectrum. + low: int index to start at + high: int index to end at + """ + cs = self.cs[low:high] + fs = self.fs[low:high] + + if expo: + cs = np.exp(cs) + + plt.plot(fs, cs, **options) + + def estimate_slope(self, low=1, high=-12000): + """Runs linear regression on log cumulative power vs log frequency. + returns: slope, inter, r2, p, stderr + """ + # print self.fs[low:high] + # print self.cs[low:high] + x = np.log(self.fs[low:high]) + y = np.log(self.cs[low:high]) + t = scipy.stats.linregress(x, y) + return t + + +class Dct(_SpectrumParent): + """Represents the spectrum of a signal using discrete cosine transform.""" + + @property + def amps(self): + """Returns a sequence of amplitudes (read-only property). + Note: for DCTs, amps are positive or negative real. + """ + return self.hs + + def __add__(self, other): + """Adds two DCTs elementwise. + other: DCT + returns: new DCT + """ + if other == 0: + return self + + assert self.framerate == other.framerate + hs = self.hs + other.hs + return Dct(hs, self.fs, self.framerate) + + __radd__ = __add__ + + def make_wave(self): + """Transforms to the time domain. + returns: Wave + """ + N = len(self.hs) + ys = scipy.fftpack.idct(self.hs, type=2) / 2 / N + # NOTE: whatever the start time was, we lose it when + # we transform back + # ts = self.start + np.arange(len(ys)) / self.framerate + return Wave(ys, framerate=self.framerate) + + +class Spectrogram: + """Represents the spectrum of a signal.""" + + def __init__(self, spec_map, seg_length): + """Initialize the spectrogram. + spec_map: map from float time to Spectrum + seg_length: number of samples in each segment + """ + self.spec_map = spec_map + self.seg_length = seg_length + + def any_spectrum(self): + """Returns an arbitrary spectrum from the spectrogram.""" + index = next(iter(self.spec_map)) + return self.spec_map[index] + + @property + def time_res(self): + """Time resolution in seconds.""" + spectrum = self.any_spectrum() + return float(self.seg_length) / spectrum.framerate + + @property + def freq_res(self): + """Frequency resolution in Hz.""" + return self.any_spectrum().freq_res + + def times(self): + """Sorted sequence of times. + returns: sequence of float times in seconds + """ + ts = sorted(iter(self.spec_map)) + return ts + + def frequencies(self): + """Sequence of frequencies. + returns: sequence of float freqencies in Hz. + """ + fs = self.any_spectrum().fs + return fs + + def plot(self, high=None, **options): + """Make a pseudocolor plot. + high: highest frequency component to plot + """ + fs = self.frequencies() + i = None if high is None else find_index(high, fs) + fs = fs[:i] + ts = self.times() + + # make the array + size = len(fs), len(ts) + array = np.zeros(size, dtype=np.float) + + # copy amplitude from each spectrum into a column of the array + for j, t in enumerate(ts): + spectrum = self.spec_map[t] + array[:, j] = spectrum.amps[:i] + + underride(options, cmap='inferno_r', shading='auto') + plt.pcolormesh(ts, fs, array, **options) + + def get_data(self, high=None, **options): + """Returns spectogram as 2D numpy array + high: highest frequency component to return + """ + fs = self.frequencies() + i = None if high is None else find_index(high, fs) + fs = fs[:i] + ts = self.times() + + # make the array + size = len(fs), len(ts) + array = np.zeros(size, dtype=np.float) + + # copy amplitude from each spectrum into a column of the array + for j, t in enumerate(ts): + spectrum = self.spec_map[t] + array[:, j] = spectrum.amps[:i] + + return array + + def make_wave(self): + """Inverts the spectrogram and returns a Wave. + returns: Wave + """ + res = [] + for t, spectrum in sorted(self.spec_map.items()): + wave = spectrum.make_wave() + n = len(wave) + + window = 1 / np.hamming(n) + wave.window(window) + + i = wave.find_index(t) + start = i - n // 2 + end = start + n + res.append((start, end, wave)) + + starts, ends, waves = zip(*res) + low = min(starts) + high = max(ends) + + ys = np.zeros(high - low, np.float) + for start, end, wave in res: + ys[start:end] = wave.ys + + # ts = np.arange(len(ys)) / self.framerate + return Wave(ys, framerate=wave.framerate) + + +class Wave: + """Represents a discrete-time waveform. + """ + + def __init__(self, ys, ts=None, framerate=None): + """Initializes the wave. + ys: wave array + ts: array of times + framerate: samples per second + """ + self.ys = np.asanyarray(ys) + self.framerate = framerate if framerate is not None else 11025 + + if ts is None: + self.ts = np.arange(len(ys)) / self.framerate + else: + self.ts = np.asanyarray(ts) + + def copy(self): + """Makes a copy. + Returns: new Wave + """ + return copy.deepcopy(self) + + def __len__(self): + return len(self.ys) + + @property + def start(self): + return self.ts[0] + + @property + def end(self): + return self.ts[-1] + + @property + def duration(self): + """Duration (property). + returns: float duration in seconds + """ + return len(self.ys) / self.framerate + + def __add__(self, other): + """Adds two waves elementwise. + other: Wave + returns: new Wave + """ + if other == 0: + return self + + assert self.framerate == other.framerate + + # make an array of times that covers both waves + start = min(self.start, other.start) + end = max(self.end, other.end) + n = int(round((end - start) * self.framerate)) + 1 + ys = np.zeros(n) + ts = start + np.arange(n) / self.framerate + + def add_ys(wave): + i = find_index(wave.start, ts) + + # make sure the arrays line up reasonably well + diff = ts[i] - wave.start + dt = 1 / wave.framerate + if (diff / dt) > 0.1: + warnings.warn( + "Can't add these waveforms; their " "time arrays don't line up." + ) + + j = i + len(wave) + ys[i:j] += wave.ys + + add_ys(self) + add_ys(other) + + return Wave(ys, ts, self.framerate) + + __radd__ = __add__ + + def __or__(self, other): + """Concatenates two waves. + other: Wave + returns: new Wave + """ + if self.framerate != other.framerate: + raise ValueError("Wave.__or__: framerates do not agree") + + ys = np.concatenate((self.ys, other.ys)) + # ts = np.arange(len(ys)) / self.framerate + return Wave(ys, framerate=self.framerate) + + def __mul__(self, other): + """Multiplies two waves elementwise. + Note: this operation ignores the timestamps; the result + has the timestamps of self. + other: Wave + returns: new Wave + """ + # the spectrums have to have the same framerate and duration + assert self.framerate == other.framerate + assert len(self) == len(other) + + ys = self.ys * other.ys + return Wave(ys, self.ts, self.framerate) + + def max_diff(self, other): + """Computes the maximum absolute difference between waves. + other: Wave + returns: float + """ + assert self.framerate == other.framerate + assert len(self) == len(other) + + ys = self.ys - other.ys + return np.max(np.abs(ys)) + + def convolve(self, other): + """Convolves two waves. + Note: this operation ignores the timestamps; the result + has the timestamps of self. + other: Wave or NumPy array + returns: Wave + """ + if isinstance(other, Wave): + assert self.framerate == other.framerate + window = other.ys + else: + window = other + + ys = np.convolve(self.ys, window, mode="full") + # ts = np.arange(len(ys)) / self.framerate + return Wave(ys, framerate=self.framerate) + + def diff(self): + """Computes the difference between successive elements. + returns: new Wave + """ + ys = np.diff(self.ys) + ts = self.ts[1:].copy() + return Wave(ys, ts, self.framerate) + + def cumsum(self): + """Computes the cumulative sum of the elements. + returns: new Wave + """ + ys = np.cumsum(self.ys) + ts = self.ts.copy() + return Wave(ys, ts, self.framerate) + + def quantize(self, bound, dtype): + """Maps the waveform to quanta. + bound: maximum amplitude + dtype: numpy data type or string + returns: quantized signal + """ + return quantize(self.ys, bound, dtype) + + def apodize(self, denom=20, duration=0.1): + """Tapers the amplitude at the beginning and end of the signal. + Tapers either the given duration of time or the given + fraction of the total duration, whichever is less. + denom: float fraction of the segment to taper + duration: float duration of the taper in seconds + """ + self.ys = apodize(self.ys, self.framerate, denom, duration) + + def hamming(self): + """Apply a Hamming window to the wave. + """ + self.ys *= np.hamming(len(self.ys)) + + def window(self, window): + """Apply a window to the wave. + window: sequence of multipliers, same length as self.ys + """ + self.ys *= window + + def scale(self, factor): + """Multplies the wave by a factor. + factor: scale factor + """ + self.ys *= factor + + def shift(self, shift): + """Shifts the wave left or right in time. + shift: float time shift + """ + # TODO: track down other uses of this function and check them + self.ts += shift + + def roll(self, roll): + """Rolls this wave by the given number of locations. + """ + self.ys = np.roll(self.ys, roll) + + def truncate(self, n): + """Trims this wave to the given length. + n: integer index + """ + self.ys = truncate(self.ys, n) + self.ts = truncate(self.ts, n) + + def zero_pad(self, n): + """Trims this wave to the given length. + n: integer index + """ + self.ys = zero_pad(self.ys, n) + self.ts = self.start + np.arange(n) / self.framerate + + def normalize(self, amp=1.0): + """Normalizes the signal to the given amplitude. + amp: float amplitude + """ + self.ys = normalize(self.ys, amp=amp) + + def unbias(self): + """Unbiases the signal. + """ + self.ys = unbias(self.ys) + + def find_index(self, t): + """Find the index corresponding to a given time.""" + n = len(self) + start = self.start + end = self.end + i = round((n - 1) * (t - start) / (end - start)) + return int(i) + + def segment(self, start=None, duration=None): + """Extracts a segment. + start: float start time in seconds + duration: float duration in seconds + returns: Wave + """ + if start is None: + start = self.ts[0] + i = 0 + else: + i = self.find_index(start) + + j = None if duration is None else self.find_index(start + duration) + return self.slice(i, j) + + def slice(self, i, j): + """Makes a slice from a Wave. + i: first slice index + j: second slice index + """ + ys = self.ys[i:j].copy() + ts = self.ts[i:j].copy() + return Wave(ys, ts, self.framerate) + + def make_spectrum(self, full=False): + """Computes the spectrum using FFT. + full: boolean, whethere to compute a full FFT + (as opposed to a real FFT) + returns: Spectrum + """ + n = len(self.ys) + d = 1 / self.framerate + + if full: + hs = np.fft.fft(self.ys) + fs = np.fft.fftfreq(n, d) + else: + hs = np.fft.rfft(self.ys) + fs = np.fft.rfftfreq(n, d) + + return Spectrum(hs, fs, self.framerate, full) + + def make_dct(self): + """Computes the DCT of this wave. + """ + N = len(self.ys) + hs = scipy.fftpack.dct(self.ys, type=2) + fs = (0.5 + np.arange(N)) / 2 + return Dct(hs, fs, self.framerate) + + def make_spectrogram(self, seg_length, win_flag=True): + """Computes the spectrogram of the wave. + seg_length: number of samples in each segment + win_flag: boolean, whether to apply hamming window to each segment + returns: Spectrogram + """ + if win_flag: + window = np.hamming(seg_length) + i, j = 0, seg_length + step = int(seg_length // 2) + + # map from time to Spectrum + spec_map = {} + + while j < len(self.ys): + segment = self.slice(i, j) + if win_flag: + segment.window(window) + + # the nominal time for this segment is the midpoint + t = (segment.start + segment.end) / 2 + spec_map[t] = segment.make_spectrum() + + i += step + j += step + + return Spectrogram(spec_map, seg_length) + + def get_xfactor(self, options): + try: + xfactor = options["xfactor"] + options.pop("xfactor") + except KeyError: + xfactor = 1 + return xfactor + + def plot(self, **options): + """Plots the wave. + If the ys are complex, plots the real part. + """ + xfactor = self.get_xfactor(options) + plt.plot(self.ts * xfactor, np.real(self.ys), **options) + + def plot_vlines(self, **options): + """Plots the wave with vertical lines for samples. + """ + xfactor = self.get_xfactor(options) + plt.vlines(self.ts * xfactor, 0, self.ys, **options) + + def corr(self, other): + """Correlation coefficient two waves. + other: Wave + returns: float coefficient of correlation + """ + corr = np.corrcoef(self.ys, other.ys)[0, 1] + return corr + + def cov_mat(self, other): + """Covariance matrix of two waves. + other: Wave + returns: 2x2 covariance matrix + """ + return np.cov(self.ys, other.ys) + + def cov(self, other): + """Covariance of two unbiased waves. + other: Wave + returns: float + """ + total = sum(self.ys * other.ys) / len(self.ys) + return total + + def cos_cov(self, k): + """Covariance with a cosine signal. + freq: freq of the cosine signal in Hz + returns: float covariance + """ + n = len(self.ys) + factor = math.pi * k / n + ys = [math.cos(factor * (i + 0.5)) for i in range(n)] + total = 2 * sum(self.ys * ys) + return total + + def cos_transform(self): + """Discrete cosine transform. + returns: list of frequency, cov pairs + """ + n = len(self.ys) + res = [] + for k in range(n): + cov = self.cos_cov(k) + res.append((k, cov)) + + return res + + def write(self, filename="sound.wav"): + """Write a wave file. + filename: string + """ + print("Writing", filename) + wfile = WavFileWriter(filename, self.framerate) + wfile.write(self) + wfile.close() + + def play(self, filename="sound.wav"): + """Plays a wave file. + filename: string + """ + self.write(filename) + play_wave(filename) + + def make_audio(self): + """Makes an IPython Audio object. + """ + audio = Audio(data=self.ys.real, rate=self.framerate) + return audio + + +def unbias(ys): + """Shifts a wave array so it has mean 0. + ys: wave array + returns: wave array + """ + return ys - ys.mean() + + +def normalize(ys, amp=1.0): + """Normalizes a wave array so the maximum amplitude is +amp or -amp. + ys: wave array + amp: max amplitude (pos or neg) in result + returns: wave array + """ + high, low = abs(max(ys)), abs(min(ys)) + return amp * ys / max(high, low) + + +def shift_right(ys, shift): + """Shifts a wave array to the right and zero pads. + ys: wave array + shift: integer shift + returns: wave array + """ + res = np.zeros(len(ys) + shift) + res[shift:] = ys + return res + + +def shift_left(ys, shift): + """Shifts a wave array to the left. + ys: wave array + shift: integer shift + returns: wave array + """ + return ys[shift:] + + +def truncate(ys, n): + """Trims a wave array to the given length. + ys: wave array + n: integer length + returns: wave array + """ + return ys[:n] + + +def quantize(ys, bound, dtype): + """Maps the waveform to quanta. + ys: wave array + bound: maximum amplitude + dtype: numpy data type of the result + returns: quantized signal + """ + if max(ys) > 1 or min(ys) < -1: + warnings.warn("Warning: normalizing before quantizing.") + ys = normalize(ys) + + zs = (ys * bound).astype(dtype) + return zs + + +def apodize(ys, framerate, denom=20, duration=0.1): + """Tapers the amplitude at the beginning and end of the signal. + Tapers either the given duration of time or the given + fraction of the total duration, whichever is less. + ys: wave array + framerate: int frames per second + denom: float fraction of the segment to taper + duration: float duration of the taper in seconds + returns: wave array + """ + # a fixed fraction of the segment + n = len(ys) + k1 = n // denom + + # a fixed duration of time + k2 = int(duration * framerate) + + k = min(k1, k2) + + w1 = np.linspace(0, 1, k) + w2 = np.ones(n - 2 * k) + w3 = np.linspace(1, 0, k) + + window = np.concatenate((w1, w2, w3)) + return ys * window + + +class Signal: + """Represents a time-varying signal.""" + + def __add__(self, other): + """Adds two signals. + other: Signal + returns: Signal + """ + if other == 0: + return self + return SumSignal(self, other) + + __radd__ = __add__ + + @property + def period(self): + """Period of the signal in seconds (property). + Since this is used primarily for purposes of plotting, + the default behavior is to return a value, 0.1 seconds, + that is reasonable for many signals. + returns: float seconds + """ + return 0.1 + + def plot(self, framerate=11025): + """Plots the signal. + The default behavior is to plot three periods. + framerate: samples per second + """ + duration = self.period * 3 + wave = self.make_wave(duration, start=0, framerate=framerate) + wave.plot() + + def make_wave(self, duration=1, start=0, framerate=11025): + """Makes a Wave object. + duration: float seconds + start: float seconds + framerate: int frames per second + returns: Wave + """ + n = round(duration * framerate) + ts = start + np.arange(n) / framerate + ys = self.evaluate(ts) + return Wave(ys, ts, framerate=framerate) + + +def infer_framerate(ts): + """Given ts, find the framerate. + Assumes that the ts are equally spaced. + ts: sequence of times in seconds + returns: frames per second + """ + # TODO: confirm that this is never used and remove it + dt = ts[1] - ts[0] + framerate = 1.0 / dt + return framerate + + +class SumSignal(Signal): + """Represents the sum of signals.""" + + def __init__(self, *args): + """Initializes the sum. + args: tuple of signals + """ + self.signals = args + + @property + def period(self): + """Period of the signal in seconds. + Note: this is not correct; it's mostly a placekeeper. + But it is correct for a harmonic sequence where all + component frequencies are multiples of the fundamental. + returns: float seconds + """ + return max(sig.period for sig in self.signals) + + def evaluate(self, ts): + """Evaluates the signal at the given times. + ts: float array of times + returns: float wave array + """ + ts = np.asarray(ts) + return sum(sig.evaluate(ts) for sig in self.signals) + + +class Sinusoid(Signal): + """Represents a sinusoidal signal.""" + + def __init__(self, freq=440, amp=1.0, offset=0, func=np.sin): + """Initializes a sinusoidal signal. + freq: float frequency in Hz + amp: float amplitude, 1.0 is nominal max + offset: float phase offset in radians + func: function that maps phase to amplitude + """ + self.freq = freq + self.amp = amp + self.offset = offset + self.func = func + + @property + def period(self): + """Period of the signal in seconds. + returns: float seconds + """ + return 1.0 / self.freq + + def evaluate(self, ts): + """Evaluates the signal at the given times. + ts: float array of times + returns: float wave array + """ + ts = np.asarray(ts) + phases = PI2 * self.freq * ts + self.offset + ys = self.amp * self.func(phases) + return ys + + +def CosSignal(freq=440, amp=1.0, offset=0): + """Makes a cosine Sinusoid. + freq: float frequency in Hz + amp: float amplitude, 1.0 is nominal max + offset: float phase offset in radians + returns: Sinusoid object + """ + return Sinusoid(freq, amp, offset, func=np.cos) + + +def SinSignal(freq=440, amp=1.0, offset=0): + """Makes a sine Sinusoid. + freq: float frequency in Hz + amp: float amplitude, 1.0 is nominal max + offset: float phase offset in radians + returns: Sinusoid object + """ + return Sinusoid(freq, amp, offset, func=np.sin) + + +def Sinc(freq=440, amp=1.0, offset=0): + """Makes a Sinc function. + freq: float frequency in Hz + amp: float amplitude, 1.0 is nominal max + offset: float phase offset in radians + returns: Sinusoid object + """ + return Sinusoid(freq, amp, offset, func=np.sinc) + + +class ComplexSinusoid(Sinusoid): + """Represents a complex exponential signal.""" + + def evaluate(self, ts): + """Evaluates the signal at the given times. + ts: float array of times + returns: float wave array + """ + ts = np.asarray(ts) + phases = PI2 * self.freq * ts + self.offset + ys = self.amp * np.exp(1j * phases) + return ys + + +class SquareSignal(Sinusoid): + """Represents a square signal.""" + + def evaluate(self, ts): + """Evaluates the signal at the given times. + ts: float array of times + returns: float wave array + """ + ts = np.asarray(ts) + cycles = self.freq * ts + self.offset / PI2 + frac, _ = np.modf(cycles) + ys = self.amp * np.sign(unbias(frac)) + return ys + + +class SawtoothSignal(Sinusoid): + """Represents a sawtooth signal.""" + + def evaluate(self, ts): + """Evaluates the signal at the given times. + ts: float array of times + returns: float wave array + """ + ts = np.asarray(ts) + cycles = self.freq * ts + self.offset / PI2 + frac, _ = np.modf(cycles) + ys = normalize(unbias(frac), self.amp) + return ys + + +class ParabolicSignal(Sinusoid): + """Represents a parabolic signal.""" + + def evaluate(self, ts): + """Evaluates the signal at the given times. + ts: float array of times + returns: float wave array + """ + ts = np.asarray(ts) + cycles = self.freq * ts + self.offset / PI2 + frac, _ = np.modf(cycles) + ys = (frac - 0.5) ** 2 + ys = normalize(unbias(ys), self.amp) + return ys + + +class CubicSignal(ParabolicSignal): + """Represents a cubic signal.""" + + def evaluate(self, ts): + """Evaluates the signal at the given times. + ts: float array of times + returns: float wave array + """ + ys = ParabolicSignal.evaluate(self, ts) + ys = np.cumsum(ys) + ys = normalize(unbias(ys), self.amp) + return ys + + +class GlottalSignal(Sinusoid): + """Represents a periodic signal that resembles a glottal signal.""" + + def evaluate(self, ts): + """Evaluates the signal at the given times. + ts: float array of times + returns: float wave array + """ + ts = np.asarray(ts) + cycles = self.freq * ts + self.offset / PI2 + frac, _ = np.modf(cycles) + ys = frac ** 2 * (1 - frac) + ys = normalize(unbias(ys), self.amp) + return ys + + +class TriangleSignal(Sinusoid): + """Represents a triangle signal.""" + + def evaluate(self, ts): + """Evaluates the signal at the given times. + ts: float array of times + returns: float wave array + """ + ts = np.asarray(ts) + cycles = self.freq * ts + self.offset / PI2 + frac, _ = np.modf(cycles) + ys = np.abs(frac - 0.5) + ys = normalize(unbias(ys), self.amp) + return ys + +from scipy.integrate import cumtrapz + +class Chirp(Signal): + """Represents a signal with variable frequency.""" + + def __init__(self, start=440, end=880, amp=1.0): + """Initializes a linear chirp. + start: float frequency in Hz + end: float frequency in Hz + amp: float amplitude, 1.0 is nominal max + """ + self.start = start + self.end = end + self.amp = amp + + @property + def period(self): + """Period of the signal in seconds. + returns: float seconds + """ + return ValueError("Non-periodic signal.") + + def evaluate(self, ts): + """Evaluates the signal at the given times. + Note: This version is a little more complicated than the one + in the book because it handles the case where the ts are + not equally spaced. + ts: float array of times + returns: float wave array + """ + def interpolate(ts, f0, f1): + t0, t1 = ts[0], ts[-1] + return f0 + (f1 - f0) * (ts - t0) / (t1 - t0) + + # compute the frequencies + ts = np.asarray(ts) + freqs = interpolate(ts, self.start, self.end) + + # compute the time intervals + dts = np.diff(ts, append=ts[-1]) + + # compute the changes in phase + dphis = PI2 * freqs * dts + dphis = np.roll(dphis, 1) + + # compute phase + phases = np.cumsum(dphis) + + # compute the amplitudes + ys = self.amp * np.cos(phases) + return ys + + +class ExpoChirp(Chirp): + """Represents a signal with varying frequency.""" + + def evaluate(self, ts): + """Evaluates the signal at the given times. + ts: float array of times + returns: float wave array + """ + f0, f1 = np.log10(self.start), np.log10(self.end) + freqs = np.logspace(f0, f1, len(ts)) + dts = np.diff(ts, prepend=0) + dphis = PI2 * freqs * dts + phases = np.cumsum(dphis) + ys = self.amp * np.cos(phases) + return ys + + +class SilentSignal(Signal): + """Represents silence.""" + + def evaluate(self, ts): + """Evaluates the signal at the given times. + ts: float array of times + returns: float wave array + """ + return np.zeros(len(ts)) + + +class Impulses(Signal): + """Represents silence.""" + + def __init__(self, locations, amps=1): + self.locations = np.asanyarray(locations) + self.amps = amps + + def evaluate(self, ts): + """Evaluates the signal at the given times. + ts: float array of times + returns: float wave array + """ + ys = np.zeros(len(ts)) + indices = np.searchsorted(ts, self.locations) + ys[indices] = self.amps + return ys + + +class Noise(Signal): + """Represents a noise signal (abstract parent class).""" + + def __init__(self, amp=1.0): + """Initializes a white noise signal. + amp: float amplitude, 1.0 is nominal max + """ + self.amp = amp + + @property + def period(self): + """Period of the signal in seconds. + returns: float seconds + """ + return ValueError("Non-periodic signal.") + + +class UncorrelatedUniformNoise(Noise): + """Represents uncorrelated uniform noise.""" + + def evaluate(self, ts): + """Evaluates the signal at the given times. + ts: float array of times + returns: float wave array + """ + ys = np.random.uniform(-self.amp, self.amp, len(ts)) + return ys + + +class UncorrelatedGaussianNoise(Noise): + """Represents uncorrelated gaussian noise.""" + + def evaluate(self, ts): + """Evaluates the signal at the given times. + ts: float array of times + returns: float wave array + """ + ys = np.random.normal(0, self.amp, len(ts)) + return ys + + +class BrownianNoise(Noise): + """Represents Brownian noise, aka red noise.""" + + def evaluate(self, ts): + """Evaluates the signal at the given times. + Computes Brownian noise by taking the cumulative sum of + a uniform random series. + ts: float array of times + returns: float wave array + """ + dys = np.random.uniform(-1, 1, len(ts)) + # ys = scipy.integrate.cumtrapz(dys, ts) + ys = np.cumsum(dys) + ys = normalize(unbias(ys), self.amp) + return ys + + +class PinkNoise(Noise): + """Represents Brownian noise, aka red noise.""" + + def __init__(self, amp=1.0, beta=1.0): + """Initializes a pink noise signal. + amp: float amplitude, 1.0 is nominal max + """ + self.amp = amp + self.beta = beta + + def make_wave(self, duration=1, start=0, framerate=11025): + """Makes a Wave object. + duration: float seconds + start: float seconds + framerate: int frames per second + returns: Wave + """ + signal = UncorrelatedUniformNoise() + wave = signal.make_wave(duration, start, framerate) + spectrum = wave.make_spectrum() + + spectrum.pink_filter(beta=self.beta) + + wave2 = spectrum.make_wave() + wave2.unbias() + wave2.normalize(self.amp) + return wave2 + + +def rest(duration): + """Makes a rest of the given duration. + duration: float seconds + returns: Wave + """ + signal = SilentSignal() + wave = signal.make_wave(duration) + return wave + + +def make_note(midi_num, duration, sig_cons=CosSignal, framerate=11025): + """Make a MIDI note with the given duration. + midi_num: int MIDI note number + duration: float seconds + sig_cons: Signal constructor function + framerate: int frames per second + returns: Wave + """ + freq = midi_to_freq(midi_num) + signal = sig_cons(freq) + wave = signal.make_wave(duration, framerate=framerate) + wave.apodize() + return wave + + +def make_chord(midi_nums, duration, sig_cons=CosSignal, framerate=11025): + """Make a chord with the given duration. + midi_nums: sequence of int MIDI note numbers + duration: float seconds + sig_cons: Signal constructor function + framerate: int frames per second + returns: Wave + """ + freqs = [midi_to_freq(num) for num in midi_nums] + signal = sum(sig_cons(freq) for freq in freqs) + wave = signal.make_wave(duration, framerate=framerate) + wave.apodize() + return wave + + +def midi_to_freq(midi_num): + """Converts MIDI note number to frequency. + midi_num: int MIDI note number + returns: float frequency in Hz + """ + x = (midi_num - 69) / 12.0 + freq = 440.0 * 2 ** x + return freq + + +def sin_wave(freq, duration=1, offset=0): + """Makes a sine wave with the given parameters. + freq: float cycles per second + duration: float seconds + offset: float radians + returns: Wave + """ + signal = SinSignal(freq, offset=offset) + wave = signal.make_wave(duration) + return wave + + +def cos_wave(freq, duration=1, offset=0): + """Makes a cosine wave with the given parameters. + freq: float cycles per second + duration: float seconds + offset: float radians + returns: Wave + """ + signal = CosSignal(freq, offset=offset) + wave = signal.make_wave(duration) + return wave + + +def mag(a): + """Computes the magnitude of a numpy array. + a: numpy array + returns: float + """ + return np.sqrt(np.dot(a, a)) + + +def zero_pad(array, n): + """Extends an array with zeros. + array: numpy array + n: length of result + returns: new NumPy array + """ + res = np.zeros(n) + res[: len(array)] = array + return res + + +def decorate(**options): + """Decorate the current axes. + Call decorate with keyword arguments like + decorate(title='Title', + xlabel='x', + ylabel='y') + The keyword arguments can be any of the axis properties + https://matplotlib.org/api/axes_api.html + In addition, you can use `legend=False` to suppress the legend. + And you can use `loc` to indicate the location of the legend + (the default value is 'best') + """ + loc = options.pop("loc", "best") + if options.pop("legend", True): + legend(loc=loc) + + plt.gca().set(**options) + plt.tight_layout() + + +def legend(**options): + """Draws a legend only if there is at least one labeled item. + options are passed to plt.legend() + https://matplotlib.org/api/_as_gen/matplotlib.plt.legend.html + """ + underride(options, loc="best", frameon=False) + + ax = plt.gca() + handles, labels = ax.get_legend_handles_labels() + if handles: + ax.legend(handles, labels, **options) + + +def remove_from_legend(bad_labels): + """Removes some labels from the legend. + bad_labels: sequence of strings + """ + ax = plt.gca() + handles, labels = ax.get_legend_handles_labels() + handle_list, label_list = [], [] + for handle, label in zip(handles, labels): + if label not in bad_labels: + handle_list.append(handle) + label_list.append(label) + ax.legend(handle_list, label_list) + + +def underride(d, **options): + """Add key-value pairs to d only if key is not in d. + If d is None, create a new dictionary. + d: dictionary + options: keyword args to add to d + """ + if d is None: + d = {} + + for key, val in options.items(): + d.setdefault(key, val) + + return d + + + + +def main(): + + cos_basis = cos_wave(440) + sin_basis = sin_wave(440) + + wave = cos_wave(440, offset=math.pi / 2) + cos_cov = cos_basis.cov(wave) + sin_cov = sin_basis.cov(wave) + print(cos_cov, sin_cov, mag((cos_cov, sin_cov))) + return + + wfile = WavFileWriter() + for sig_cons in [ + SinSignal, + TriangleSignal, + SawtoothSignal, + GlottalSignal, + ParabolicSignal, + SquareSignal, + ]: + print(sig_cons) + sig = sig_cons(440) + wave = sig.make_wave(1) + wave.apodize() + wfile.write(wave) + wfile.close() + return + + signal = GlottalSignal(440) + signal.plot() + plt.show() + return + + wfile = WavFileWriter() + for m in range(60, 0, -1): + wfile.write(make_note(m, 0.25)) + wfile.close() + return + + wave1 = make_note(69, 1) + wave2 = make_chord([69, 72, 76], 1) + wave = wave1 | wave2 + + wfile = WavFileWriter() + wfile.write(wave) + wfile.close() + return + + sig1 = CosSignal(freq=440) + sig2 = CosSignal(freq=523.25) + sig3 = CosSignal(freq=660) + sig4 = CosSignal(freq=880) + sig5 = CosSignal(freq=987) + sig = sig1 + sig2 + sig3 + sig4 + + # wave = Wave(sig, duration=0.02) + # wave.plot() + + wave = sig.make_wave(duration=1) + # wave.normalize() + + wfile = WavFileWriter(wave) + wfile.write() + wfile.close() + + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/Digital Signal Processing/Think DSP/Chapter7 - Discrete Fourier Transform/Complex Exponentials.py b/Digital Signal Processing/Think DSP/Chapter7 - Discrete Fourier Transform/Complex Exponentials.py new file mode 100644 index 00000000..2159cdd1 --- /dev/null +++ b/Digital Signal Processing/Think DSP/Chapter7 - Discrete Fourier Transform/Complex Exponentials.py @@ -0,0 +1,12 @@ +import numpy as np + +phi = 1.5; + +z = np.exp(1j * phi) + +print(z) + +print(z.real) +print(z.imag) + +print(np.absolute(z)) diff --git a/Digital Signal Processing/Think DSP/Chapter7 - Discrete Fourier Transform/__init__.py b/Digital Signal Processing/Think DSP/Chapter7 - Discrete Fourier Transform/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Digital Signal Processing/Think DSP/__init__.py b/Digital Signal Processing/Think DSP/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Digital Signal Processing/__init__.py b/Digital Signal Processing/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Grokking Algorithms/CH3-Recursion/__init__.py b/Grokking Algorithms/CH3-Recursion/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Grokking Algorithms/CH3-Recursion/call stack.py b/Grokking Algorithms/CH3-Recursion/call stack.py new file mode 100644 index 00000000..345c85b9 --- /dev/null +++ b/Grokking Algorithms/CH3-Recursion/call stack.py @@ -0,0 +1,20 @@ +def greet(name): + print("hello, " + name + "!") + + greet2(name) + print("getting ready to say bye...") + + bye() + + +def greet2(name): + print("how are you, " + name + "?") + + +def bye(): + print("ok, bye!") + + +# Suppose you call greet("maggie") +# First, your computer allocates a box of memory for that function call. +greet("maggie") diff --git a/Grokking Algorithms/CH5-Hash Tables/Domain Name System.py b/Grokking Algorithms/CH5-Hash Tables/Domain Name System.py new file mode 100644 index 00000000..b7626727 --- /dev/null +++ b/Grokking Algorithms/CH5-Hash Tables/Domain Name System.py @@ -0,0 +1,8 @@ +ip = dict() + +ip["google.com"] = 74.125 +ip["facebook.com"] = 173.252 + +print(ip) + +print(ip["facebook.com"]) diff --git a/Grokking Algorithms/CH5-Hash Tables/Using hash tables for lookups.py b/Grokking Algorithms/CH5-Hash Tables/Using hash tables for lookups.py new file mode 100644 index 00000000..18242dbe --- /dev/null +++ b/Grokking Algorithms/CH5-Hash Tables/Using hash tables for lookups.py @@ -0,0 +1,8 @@ +phone_book = {} # Same as phone_book = dict() + +phone_book["jenny"] = 8675309 +phone_book["emergency"] = 911 + +print(phone_book["jenny"]) + + diff --git a/Grokking Algorithms/CH5-Hash Tables/__init__.py b/Grokking Algorithms/CH5-Hash Tables/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Grokking Algorithms/CH5-Hash Tables/grocery clerk.py b/Grokking Algorithms/CH5-Hash Tables/grocery clerk.py new file mode 100644 index 00000000..a7179029 --- /dev/null +++ b/Grokking Algorithms/CH5-Hash Tables/grocery clerk.py @@ -0,0 +1,13 @@ +# book is a new hash table +book = dict() + +# Let's add some prices to book + +book["apple"] = 0.67 # An apple costs 67 cents. +book["milk"] = 1.49 # Milk costs 1.49 +book["avocado"] = 1.49 + +print(book) + +# Now, let's ask for the price of an avocado +print(book["avocado"]) diff --git a/Grokking Algorithms/__init__.py b/Grokking Algorithms/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Hands on Machine Learning2/Chapter17 - Autoencoders & GANs/Performing PCA with an Undercomplete Linear Autoencoder.py b/Hands on Machine Learning2/Chapter17 - Autoencoders & GANs/Performing PCA with an Undercomplete Linear Autoencoder.py new file mode 100644 index 00000000..c37506c7 --- /dev/null +++ b/Hands on Machine Learning2/Chapter17 - Autoencoders & GANs/Performing PCA with an Undercomplete Linear Autoencoder.py @@ -0,0 +1,6 @@ +import keras +import tensorflow as tf + +encoder = tf.keras.Sequential([keras.Layer.Dense(2, input_shape=[3])]) + + diff --git a/Hands on Machine Learning2/Chapter17 - Autoencoders & GANs/__init__.py b/Hands on Machine Learning2/Chapter17 - Autoencoders & GANs/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole.ipynb b/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole.ipynb new file mode 100644 index 00000000..9cf9336f --- /dev/null +++ b/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole.ipynb @@ -0,0 +1,94 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[-0.03841699 -0.04977718 -0.0340114 0.00516261]\n" + ] + } + ], + "source": [ + "import gym\n", + "\n", + "environment = gym.make(\"CartPole-v1\")\n", + "\n", + "observation = environment.reset()\n", + "\n", + "print(observation)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "outputs": [ + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[1;31mKeyboardInterrupt\u001B[0m Traceback (most recent call last)", + "\u001B[1;32m~\\AppData\\Local\\Temp/ipykernel_26492/21817557.py\u001B[0m in \u001B[0;36m\u001B[1;34m\u001B[0m\n\u001B[1;32m----> 1\u001B[1;33m \u001B[0menvironment\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mrender\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m", + "\u001B[1;32mc:\\program files (x86)\\microsoft visual studio\\shared\\python37_64\\lib\\site-packages\\gym\\core.py\u001B[0m in \u001B[0;36mrender\u001B[1;34m(self, mode, **kwargs)\u001B[0m\n\u001B[0;32m 293\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 294\u001B[0m \u001B[1;32mdef\u001B[0m \u001B[0mrender\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mself\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mmode\u001B[0m\u001B[1;33m=\u001B[0m\u001B[1;34m\"human\"\u001B[0m\u001B[1;33m,\u001B[0m \u001B[1;33m**\u001B[0m\u001B[0mkwargs\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m--> 295\u001B[1;33m \u001B[1;32mreturn\u001B[0m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0menv\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mrender\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mmode\u001B[0m\u001B[1;33m,\u001B[0m \u001B[1;33m**\u001B[0m\u001B[0mkwargs\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m 296\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 297\u001B[0m \u001B[1;32mdef\u001B[0m \u001B[0mclose\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mself\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n", + "\u001B[1;32mc:\\program files (x86)\\microsoft visual studio\\shared\\python37_64\\lib\\site-packages\\gym\\envs\\classic_control\\cartpole.py\u001B[0m in \u001B[0;36mrender\u001B[1;34m(self, mode)\u001B[0m\n\u001B[0;32m 227\u001B[0m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mpoletrans\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mset_rotation\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;33m-\u001B[0m\u001B[0mx\u001B[0m\u001B[1;33m[\u001B[0m\u001B[1;36m2\u001B[0m\u001B[1;33m]\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 228\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m--> 229\u001B[1;33m \u001B[1;32mreturn\u001B[0m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mviewer\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mrender\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mreturn_rgb_array\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0mmode\u001B[0m \u001B[1;33m==\u001B[0m \u001B[1;34m\"rgb_array\"\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m 230\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 231\u001B[0m \u001B[1;32mdef\u001B[0m \u001B[0mclose\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mself\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n", + "\u001B[1;32mc:\\program files (x86)\\microsoft visual studio\\shared\\python37_64\\lib\\site-packages\\gym\\envs\\classic_control\\rendering.py\u001B[0m in \u001B[0;36mrender\u001B[1;34m(self, return_rgb_array)\u001B[0m\n\u001B[0;32m 123\u001B[0m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mwindow\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mclear\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 124\u001B[0m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mwindow\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mswitch_to\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m--> 125\u001B[1;33m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mwindow\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mdispatch_events\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m 126\u001B[0m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mtransform\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0menable\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 127\u001B[0m \u001B[1;32mfor\u001B[0m \u001B[0mgeom\u001B[0m \u001B[1;32min\u001B[0m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mgeoms\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n", + "\u001B[1;32mc:\\program files (x86)\\microsoft visual studio\\shared\\python37_64\\lib\\site-packages\\pyglet\\window\\win32\\__init__.py\u001B[0m in \u001B[0;36mdispatch_events\u001B[1;34m(self)\u001B[0m\n\u001B[0;32m 718\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 719\u001B[0m \u001B[0mmsg\u001B[0m \u001B[1;33m=\u001B[0m \u001B[0mMSG\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m--> 720\u001B[1;33m \u001B[1;32mwhile\u001B[0m \u001B[0m_user32\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mPeekMessageW\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mbyref\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mmsg\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m,\u001B[0m \u001B[1;36m0\u001B[0m\u001B[1;33m,\u001B[0m \u001B[1;36m0\u001B[0m\u001B[1;33m,\u001B[0m \u001B[1;36m0\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mPM_REMOVE\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m 721\u001B[0m \u001B[0m_user32\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mTranslateMessage\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mbyref\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mmsg\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 722\u001B[0m \u001B[0m_user32\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mDispatchMessageW\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mbyref\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mmsg\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n", + "\u001B[1;31mKeyboardInterrupt\u001B[0m: " + ] + } + ], + "source": [ + "environment.render()" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "environment.close()" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole.py b/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole.py new file mode 100644 index 00000000..edd83123 --- /dev/null +++ b/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole.py @@ -0,0 +1,11 @@ +import gym + +environment = gym.make("CartPole-v1") + +observation = environment.reset() + +print(observation) + +environment.render() + +environment.close() diff --git a/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole2.py b/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole2.py new file mode 100644 index 00000000..cf203681 --- /dev/null +++ b/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole2.py @@ -0,0 +1,11 @@ +import gym + +environment = gym.make("CartPole-v1") + +observation = environment.reset() + +print(observation) + +environment.render() + +print(environment.action_space) diff --git a/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole_example.ipynb b/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole_example.ipynb new file mode 100644 index 00000000..50e86361 --- /dev/null +++ b/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole_example.ipynb @@ -0,0 +1,252 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[-0.01258566 -0.00156614 0.04207708 -0.00180545]\n" + ] + }, + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[1;31mKeyboardInterrupt\u001B[0m Traceback (most recent call last)", + "\u001B[1;32m_ctypes/callbacks.c\u001B[0m in \u001B[0;36m'calling callback function'\u001B[1;34m()\u001B[0m\n", + "\u001B[1;32mc:\\program files (x86)\\microsoft visual studio\\shared\\python37_64\\lib\\site-packages\\pyglet\\window\\win32\\__init__.py\u001B[0m in \u001B[0;36mf\u001B[1;34m(hwnd, msg, wParam, lParam)\u001B[0m\n\u001B[0;32m 735\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 736\u001B[0m \u001B[1;32mdef\u001B[0m \u001B[0m_get_window_proc\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mself\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mevent_handlers\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m--> 737\u001B[1;33m \u001B[1;32mdef\u001B[0m \u001B[0mf\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mhwnd\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mmsg\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mwParam\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mlParam\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m 738\u001B[0m \u001B[0mevent_handler\u001B[0m \u001B[1;33m=\u001B[0m \u001B[0mevent_handlers\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mget\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mmsg\u001B[0m\u001B[1;33m,\u001B[0m \u001B[1;32mNone\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 739\u001B[0m \u001B[0mresult\u001B[0m \u001B[1;33m=\u001B[0m \u001B[1;32mNone\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n", + "\u001B[1;31mKeyboardInterrupt\u001B[0m: " + ] + }, + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[1;31mKeyboardInterrupt\u001B[0m Traceback (most recent call last)", + "\u001B[1;32m~\\AppData\\Local\\Temp/ipykernel_19780/442299231.py\u001B[0m in \u001B[0;36m\u001B[1;34m\u001B[0m\n\u001B[0;32m 12\u001B[0m \u001B[0mprint\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mobservation\u001B[0m\u001B[1;33m)\u001B[0m \u001B[1;31m# cart's horizontal position, its velocity, the angle of the pole (0 = vertical), and the angular velocity.\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 13\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m---> 14\u001B[1;33m \u001B[0mimage\u001B[0m \u001B[1;33m=\u001B[0m \u001B[0menvironment\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mrender\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mmode\u001B[0m\u001B[1;33m=\u001B[0m\u001B[1;34m\"rgb_array\"\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m 15\u001B[0m \u001B[0mprint\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mimage\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mshape\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 16\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n", + "\u001B[1;32mc:\\program files (x86)\\microsoft visual studio\\shared\\python37_64\\lib\\site-packages\\gym\\core.py\u001B[0m in \u001B[0;36mrender\u001B[1;34m(self, mode, **kwargs)\u001B[0m\n\u001B[0;32m 293\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 294\u001B[0m \u001B[1;32mdef\u001B[0m \u001B[0mrender\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mself\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mmode\u001B[0m\u001B[1;33m=\u001B[0m\u001B[1;34m\"human\"\u001B[0m\u001B[1;33m,\u001B[0m \u001B[1;33m**\u001B[0m\u001B[0mkwargs\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m--> 295\u001B[1;33m \u001B[1;32mreturn\u001B[0m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0menv\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mrender\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mmode\u001B[0m\u001B[1;33m,\u001B[0m \u001B[1;33m**\u001B[0m\u001B[0mkwargs\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m 296\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 297\u001B[0m \u001B[1;32mdef\u001B[0m \u001B[0mclose\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mself\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n", + "\u001B[1;32mc:\\program files (x86)\\microsoft visual studio\\shared\\python37_64\\lib\\site-packages\\gym\\envs\\classic_control\\cartpole.py\u001B[0m in \u001B[0;36mrender\u001B[1;34m(self, mode)\u001B[0m\n\u001B[0;32m 227\u001B[0m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mpoletrans\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mset_rotation\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;33m-\u001B[0m\u001B[0mx\u001B[0m\u001B[1;33m[\u001B[0m\u001B[1;36m2\u001B[0m\u001B[1;33m]\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 228\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m--> 229\u001B[1;33m \u001B[1;32mreturn\u001B[0m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mviewer\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mrender\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mreturn_rgb_array\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0mmode\u001B[0m \u001B[1;33m==\u001B[0m \u001B[1;34m\"rgb_array\"\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m 230\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 231\u001B[0m \u001B[1;32mdef\u001B[0m \u001B[0mclose\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mself\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n", + "\u001B[1;32mc:\\program files (x86)\\microsoft visual studio\\shared\\python37_64\\lib\\site-packages\\gym\\envs\\classic_control\\rendering.py\u001B[0m in \u001B[0;36mrender\u001B[1;34m(self, return_rgb_array)\u001B[0m\n\u001B[0;32m 123\u001B[0m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mwindow\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mclear\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 124\u001B[0m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mwindow\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mswitch_to\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m--> 125\u001B[1;33m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mwindow\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mdispatch_events\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m 126\u001B[0m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mtransform\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0menable\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 127\u001B[0m \u001B[1;32mfor\u001B[0m \u001B[0mgeom\u001B[0m \u001B[1;32min\u001B[0m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mgeoms\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n", + "\u001B[1;32mc:\\program files (x86)\\microsoft visual studio\\shared\\python37_64\\lib\\site-packages\\pyglet\\window\\win32\\__init__.py\u001B[0m in \u001B[0;36mdispatch_events\u001B[1;34m(self)\u001B[0m\n\u001B[0;32m 718\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 719\u001B[0m \u001B[0mmsg\u001B[0m \u001B[1;33m=\u001B[0m \u001B[0mMSG\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m--> 720\u001B[1;33m \u001B[1;32mwhile\u001B[0m \u001B[0m_user32\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mPeekMessageW\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mbyref\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mmsg\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m,\u001B[0m \u001B[1;36m0\u001B[0m\u001B[1;33m,\u001B[0m \u001B[1;36m0\u001B[0m\u001B[1;33m,\u001B[0m \u001B[1;36m0\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mPM_REMOVE\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m 721\u001B[0m \u001B[0m_user32\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mTranslateMessage\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mbyref\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mmsg\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m 722\u001B[0m \u001B[0m_user32\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mDispatchMessageW\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mbyref\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mmsg\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n", + "\u001B[1;31mKeyboardInterrupt\u001B[0m: " + ] + } + ], + "source": [ + "import gym\n", + "import matplotlib.animation\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "\n", + "environment = gym.make('CartPole-v1')\n", + "\n", + "environment.seed(42)\n", + "\n", + "observation = environment.reset()\n", + "\n", + "print(observation) # cart's horizontal position, its velocity, the angle of the pole (0 = vertical), and the angular velocity.\n", + "\n", + "image = environment.render(mode=\"rgb_array\")\n", + "print(image.shape)\n", + "\n", + "def plot_environment(environment, figsize=(5, 4)):\n", + " plt.figure(figsize=figsize)\n", + " image = environment.render(mode=\"rgb_array\")\n", + " plt.imshow(image)\n", + " plt.axis(\"off\")\n", + "\n", + " return image\n", + "\n", + "\n", + "plot_environment(environment)\n", + "\n", + "plt.show()\n", + "\n", + "print(environment.action_space)\n", + "\n", + "print(observation[2])\n", + "\n", + "action = 1 # accelerate right\n", + "observation, reward, done, info = environment.step(action)\n", + "\n", + "print(observation, '\\n', reward, '\\n', done, '\\n', info)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "plot_environment(environment)\n", + "plt.show()" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "def basic_policy(observation):\n", + " angle = observation[2]\n", + "\n", + " return 0 if angle < 0 else 1\n", + "\n", + "\n", + "totals = []\n", + "\n", + "for episode in range(500):\n", + " episode_rewards = 0\n", + " observation = environment.reset()\n", + "\n", + " for step in range(200):\n", + " action = basic_policy(observation)\n", + " observation, reward, done, info = environment.step(action)\n", + " episode_rewards += reward\n", + "\n", + " if done:\n", + " break\n", + "\n", + " totals.append(episode_rewards)\n", + "\n", + "\n", + "print(np.mean(totals), np.std(totals), np.min(totals), np.max(totals))" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "# Let's visualize one episode:\n", + "environment.seed(42)\n", + "\n", + "frames = []\n", + "\n", + "observation = environment.reset()\n", + "\n", + "for step in range(200):\n", + " image = environment.render(mode='rgb_array')\n", + " frames.append(image)\n", + " action = basic_policy(observation)\n", + "\n", + " observation, reward, done, info = environment.step(action)\n", + "\n", + " if done:\n", + " break" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "markdown", + "source": [ + "Now show the animation:" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "def update_scene(num, frames, patch):\n", + " patch.set_data(frames[num])\n", + " return patch\n", + "\n", + "\n", + "def plot_animation(frames, repeat=False, interval=40):\n", + " figure = plt.figure()\n", + " patch = plt.imshow(X=frames[0])\n", + " plt.axis('off')\n", + " animation = matplotlib.animation.FuncAnimation(fig=figure, func=update_scene, frames=len(frames), fargs=(frames, patch), interval=interval, repeat=repeat)\n", + "\n", + " plt.close()\n", + " return animation" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "plot_animation(frames=frames)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "animation = plot_animation(frames=frames)\n", + "animation.to_jshtml(fps=30, embed_frames=True, default_mode=None)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole_example.py b/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole_example.py new file mode 100644 index 00000000..8083f9ac --- /dev/null +++ b/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole_example.py @@ -0,0 +1,103 @@ +import gym +import matplotlib.pyplot as plt +import numpy as np +import matplotlib.animation as anime + +environment = gym.make('CartPole-v1') + +environment.seed(42) + +observation = environment.reset() + +print(observation) # cart's horizontal position, its velocity, the angle of the pole (0 = vertical), and the angular velocity. + +image = environment.render(mode="rgb_array") +print(image.shape) + +def plot_environment(environment, figsize=(5, 4)): + plt.figure(figsize=figsize) + image = environment.render(mode="rgb_array") + plt.imshow(image) + plt.axis("off") + + return image + + +plot_environment(environment) + +plt.show() + +print(environment.action_space) + +print(observation[2]) + +action = 1 # accelerate right +observation, reward, done, info = environment.step(action) + +print(observation, '\n', reward, '\n', done, '\n', info) + +def basic_policy(observation): + angle = observation[2] + + return 0 if angle < 0 else 1 + + +totals = [] + +for episode in range(500): + episode_rewards = 0 + observation = environment.reset() + + for step in range(200): + action = basic_policy(observation) + observation, reward, done, info = environment.step(action) + episode_rewards += reward + + if done: + break + + totals.append(episode_rewards) + + +print(np.mean(totals), np.std(totals), np.min(totals), np.max(totals)) + +# Let's visualize one episode: +environment.seed(42) + +frames = [] + +observation = environment.reset() + +for step in range(200): + image = environment.render(mode='rgb_array') + frames.append(image) + action = basic_policy(observation) + + observation, reward, done, info = environment.step(action) + + if done: + break + + +# Now show the animation: + +def update_scene(num, frames, patch): + patch.set_data(frames[num]) + return patch + + +def plot_animation(frames, repeat=False, interval=40): + figure = plt.figure() + patch = plt.imshow(X=frames[0]) + plt.axis('off') + animation = anime.FuncAnimation(fig=figure, func=update_scene, frames=len(frames), fargs=(frames, patch), interval=interval, repeat=repeat) + + plt.close() + return animation + + +animation = plot_animation(frames=frames) + +print(animation) + +animation.to_jshtml(fps=30, embed_frames=True, default_mode=None) diff --git a/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole_example2.ipynb b/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole_example2.ipynb new file mode 100644 index 00000000..ebed89f1 --- /dev/null +++ b/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole_example2.ipynb @@ -0,0 +1,217 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[-0.01258566 -0.00156614 0.04207708 -0.00180545]\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "c:\\program files (x86)\\microsoft visual studio\\shared\\python37_64\\lib\\site-packages\\pyglet\\image\\codecs\\wic.py:289: UserWarning: [WinError -2147417850] Cannot change thread mode after it is set\n", + " warnings.warn(str(err))\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(400, 600, 3)\n" + ] + }, + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAASUAAADICAYAAACuyvefAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFbUlEQVR4nO3dTW+UVRjH4fsZqlVBXuQlkhRjlBCDmhiQGF36DYxfgB0Lv4Ibtm7ck7h0wcKdG4OaGOMLGqOyMIqiC2JQAYG2FNtO53EBMY7YVmcq85/xupIues7M5F5MfnlmembatG1bACk6ox4A4M9ECYgiSkAUUQKiiBIQRZSAKFPr7DsvAPwXmtU2XCkBUUQJiCJKQBRRAqKIEhBFlIAoogREESUgiigBUUQJiCJKQBRRAqKIEhBFlIAoogREESUgiigBUUQJiCJKQBRRAqKIEhBFlIAoogREESUgiigBUUQJiCJKQBRRAqKIEhBFlIAoogREESUgiigBUUQJiCJKQBRRAqKIEhBFlIAoogREESUgiigBUUQJiCJKQBRRAqKIEhBFlIAoogREESUgiigBUUQJiCJKQBRRAqKIEhBFlIAoogREESU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s1T1HArjNPz0SMAhHArhl1SMB3lMCoogSEEWUgCiiBEQRJSCKj5lwm23bttXx48fX/ZaAQTRNUzMzMxv+uEwORwKAUXAkABgPogREESUgiigBUUQJiCJKQBRRAqKIEhBFlIAoogREESUgiigBUUQJiCJKQBRRAqKIEhBFlIAoogREESUgiigBUUQJiCJKQBRRAqKIEhBFlIAoogREESUgiigBUUQJiCJKQBRRAqKIEhBFlIAoogREESUgiigBUUQJiCJKQJSpdfabOzIFwC2ulIAoogREESUgiigBUUQJiCJKQJTfAVnC6DX0KQAkAAAAAElFTkSuQmCC\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Discrete(2)\n", + "0.042077083\n", + "[-0.01261699 0.1929279 0.04204097 -0.28092128] \n", + " 1.0 \n", + " False \n", + " {}\n" + ] + }, + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAASUAAADICAYAAACuyvefAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFbUlEQVR4nO3dzW6UZRjH4fsdioiiRUFCk2JMJMSgJkYkBpeegfEE2LHwFNywdeOexKULFu7cGNTEGD/QGD8WRlF0QQgoYEtbim2n87qQGEdsqzOV+U+9rqSLPs/M5F5Mfnln+kynadu2AFJ0Rj0AwJ+JEhBFlIAoogREESUgiigBUSY22HdeAPgvNGttuFICoogSEEWUgCiiBEQRJSCKKAFRRAmIIkpAFFECoogSEEWUgCiiBEQRJSCKKAFRRAmIIkpAFFECoogSEEWUgCiiBEQRJSCKKAFRRAmIIkpAFFECoogSEEWUgCiiBEQRJSCKKAFRRAmIIkpAFFECoogSEEWUgCiiBEQRJSCKKAFRRAmIIkpAFFECoogSEEWUgCiiBEQRJSCKKAFRRAmIIkpAFFECoogSEEWUgCiiB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23bOnPmTJ07d27IKRlnJ06cWHPPkQBu80+PBAzCkQBuWfNIgPeUgCiiBEQRJSCKKAFRRAmI4mMm3GZycrJOnjy54X8JGETTNDU9Pb3pj8vW4UgAMAqOBADjQZSAKKIERBElIIooAVFECYgiSkAUUQKiiBIQRZSAKKIERBElIIooAVFECYgiSkAUUQKiiBIQRZSAKKIERBElIIooAVFECYgiSkAUUQKiiBIQRZSAKKIERBElIIooAVFECYgiSkAUUQKiiBIQRZSAKKIERBElIIooAVFECYgyscF+c0emALjFlRIQRZSAKKIERBElIIooAVFECYjyG5qP6DUUObfbAAAAAElFTkSuQmCC\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "41.684 8.839917646675222 24.0 68.0\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "c:\\program files (x86)\\microsoft visual studio\\shared\\python37_64\\lib\\site-packages\\matplotlib\\animation.py:974: UserWarning: Animation was deleted without rendering anything. This is most likely unintended. To prevent deletion, assign the Animation to a variable that exists for as long as you need the Animation.\n", + " 'Animation was deleted without rendering anything. This is '\n" + ] + }, + { + "data": { + "text/plain": "'\\n\\n\\n\\n\\n\\n
\\n \\n
\\n \\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n
\\n \\n \\n \\n \\n \\n \\n
\\n
\\n
\\n\\n\\n\\n'" + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import gym\n", + "import matplotlib.animation\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "\n", + "environment = gym.make('CartPole-v1')\n", + "\n", + "environment.seed(42)\n", + "\n", + "observation = environment.reset()\n", + "\n", + "print(\n", + " observation) # cart's horizontal position, its velocity, the angle of the pole (0 = vertical), and the angular velocity.\n", + "\n", + "image = environment.render(mode=\"rgb_array\")\n", + "print(image.shape)\n", + "\n", + "\n", + "def plot_environment(environment, figsize=(5, 4)):\n", + " plt.figure(figsize=figsize)\n", + " image = environment.render(mode=\"rgb_array\")\n", + " plt.imshow(image)\n", + " plt.axis(\"off\")\n", + "\n", + " return image\n", + "\n", + "\n", + "plot_environment(environment)\n", + "\n", + "plt.show()\n", + "\n", + "print(environment.action_space)\n", + "\n", + "print(observation[2])\n", + "\n", + "action = 1 # accelerate right\n", + "observation, reward, done, info = environment.step(action)\n", + "\n", + "print(observation, '\\n', reward, '\\n', done, '\\n', info)\n", + "plot_environment(environment)\n", + "plt.show()\n", + "\n", + "\n", + "def basic_policy(observation):\n", + " angle = observation[2]\n", + "\n", + " return 0 if angle < 0 else 1\n", + "\n", + "\n", + "totals = []\n", + "\n", + "for episode in range(500):\n", + " episode_rewards = 0\n", + " observation = environment.reset()\n", + "\n", + " for step in range(200):\n", + " action = basic_policy(observation)\n", + " observation, reward, done, info = environment.step(action)\n", + " episode_rewards += reward\n", + "\n", + " if done:\n", + " break\n", + "\n", + " totals.append(episode_rewards)\n", + "\n", + "print(np.mean(totals), np.std(totals), np.min(totals), np.max(totals))\n", + "# Let's visualize one episode:\n", + "environment.seed(42)\n", + "\n", + "frames = []\n", + "\n", + "observation = environment.reset()\n", + "\n", + "for step in range(200):\n", + " image = environment.render(mode='rgb_array')\n", + " frames.append(image)\n", + " action = basic_policy(observation)\n", + "\n", + " observation, reward, done, info = environment.step(action)\n", + "\n", + " if done:\n", + " break\n", + "\n", + "# Now show the animation:\n", + "\n", + "def update_scene(num, frames, patch):\n", + " patch.set_data(frames[num])\n", + " return patch\n", + "\n", + "\n", + "def plot_animation(frames, repeat=False, interval=40):\n", + " figure = plt.figure()\n", + " patch = plt.imshow(X=frames[0])\n", + " plt.axis('off')\n", + " animation = matplotlib.animation.FuncAnimation(fig=figure, func=update_scene, frames=len(frames),\n", + " fargs=(frames, patch), interval=interval, repeat=repeat)\n", + "\n", + " plt.close()\n", + " return animation\n", + "\n", + "\n", + "plot_animation(frames=frames)\n", + "animation = plot_animation(frames=frames)\n", + "animation.to_jshtml(fps=30, embed_frames=True, default_mode=None)\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole_example2.py b/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole_example2.py new file mode 100644 index 00000000..b9b473d2 --- /dev/null +++ b/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/CartPole_example2.py @@ -0,0 +1,106 @@ +import gym +import matplotlib.pyplot as plt +import numpy as np +import matplotlib.animation as anime +from IPython.display import HTML, display + +environment = gym.make('CartPole-v1') + +environment.seed(42) + +observation = environment.reset() + +print(observation) # cart's horizontal position, its velocity, the angle of the pole (0 = vertical), and the angular velocity. + +image = environment.render(mode="rgb_array") +print(image.shape) + +def plot_environment(environment, figsize=(5, 4)): + plt.figure(figsize=figsize) + image = environment.render(mode="rgb_array") + plt.imshow(image) + plt.axis("off") + + return image + + +plot_environment(environment) + +plt.show() + +print(environment.action_space) + +print(observation[2]) + +action = 1 # accelerate right +observation, reward, done, info = environment.step(action) + +print(observation, '\n', reward, '\n', done, '\n', info) + +def basic_policy(observation): + angle = observation[2] + + return 0 if angle < 0 else 1 + + +totals = [] + +for episode in range(500): + episode_rewards = 0 + observation = environment.reset() + + for step in range(200): + action = basic_policy(observation) + observation, reward, done, info = environment.step(action) + episode_rewards += reward + + if done: + break + + totals.append(episode_rewards) + + +print(np.mean(totals), np.std(totals), np.min(totals), np.max(totals)) + +# Let's visualize one episode: +environment.seed(42) + +frames = [] + +observation = environment.reset() + +for step in range(200): + image = environment.render(mode='rgb_array') + frames.append(image) + action = basic_policy(observation) + + observation, reward, done, info = environment.step(action) + + if done: + break + + +# Now show the animation: + +def update_scene(num, frames, patch): + patch.set_data(frames[num]) + return patch + + +def plot_animation(frames, repeat=False, interval=40): + figure = plt.figure() + patch = plt.imshow(X=frames[0]) + plt.axis('off') + animation = anime.FuncAnimation(fig=figure, func=update_scene, frames=len(frames), fargs=(frames, patch), interval=interval, repeat=repeat) + + plt.close() + return animation + + +animation = plot_animation(frames=frames) + +print(animation) + +animation.to_jshtml(fps=30, embed_frames=True, default_mode=None) + +display(HTML(animation.to_jshtml())) diff --git a/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/__init__.py b/Hands on Machine Learning2/Chapter18 - Reinforcement Learning/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Hands-on Signal Analysis with Python/Chapter5 - Data Filter/Impulse and Step.ipynb b/Hands-on Signal Analysis with Python/Chapter5 - Data Filter/Impulse and Step.ipynb new file mode 100644 index 00000000..30338583 --- /dev/null +++ b/Hands-on Signal Analysis with Python/Chapter5 - Data Filter/Impulse and Step.ipynb @@ -0,0 +1,69 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true, + "pycharm": { + "name": "#%%\n" + } + }, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAEICAYAAABPgw/pAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAa1UlEQVR4nO3df7CcZ3ne8e+1u5b5YYyNLQyVZMvTCKhgOiUoBkrSuhQntpux22mbsQsNtBQ1nbhDazeNU1I3dTqdEDpAMziloqGmCWCcNJNqgjpOCg5pSUwtF0qQVScaJ2AJg+Uf2E6CbfZ97/6x77vaszpHZyXtas/73NdnRuOze16ffVZ776XnPPv8UERgZmbd11t2A8zMbD4c6GZmhXCgm5kVwoFuZlYIB7qZWSEc6GZmhXCgd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EHTkynmtTxFru1u6lxtb6Qe+iwH9nZOM+b2C8DBiHj/xLcmDx9+O/DfznTb5iEifiIitkbEdkav2Wcj4q3A3YwOVYYOP785cW13UBdre8MEevOvXXtg70Hgzog4sNxWzcWbgL8LvFnSl5o/VwM/A1wh6Q+AtzS3S/LjwI3N4coXMHrjp+Tadm2fKV76b2ZWiA3TQzczs9PjQDczK4QD3cysEA50M7NCONDNzArhQDczK4QD3cysEP8f/LDU47YSA1EAAAAASUVORK5CYII=\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "# Definition of \"Impulse\"\n", + "impulse = np.zeros(50)\n", + "impulse[10] = 1\n", + "\n", + "# Definition of \"Step\"\n", + "step = np.zeros(50)\n", + "step[10:] = 1\n", + "\n", + "# Show impulse and step\n", + "figure, axes = plt.subplots(1, 2)\n", + "axes[0].plot(impulse)\n", + "axes[0].set_title(\"Impulse\")\n", + "\n", + "axes[1].plot(step)\n", + "axes[1].set_title(\"Step\")\n", + "\n", + "plt.show()\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/Hands-on Signal Analysis with Python/Chapter5 - Data Filter/__init__.py b/Hands-on Signal Analysis with Python/Chapter5 - Data Filter/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Hands-on Signal Analysis with Python/__init__.py b/Hands-on Signal Analysis with Python/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas 4.py b/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas 4.py new file mode 100644 index 00000000..0adfc58a --- /dev/null +++ b/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas 4.py @@ -0,0 +1,11 @@ +import pandas as pd + +train = pd.read_csv('train_1.csv').fillna(0) +print(train.head()) + +def parse_page(page): + x = page.split('_') # split the string by underscore. + return ''.join(x[:-3]), x[-3], x[-2], x[-1] + + +print(parse_page(train.Page)) diff --git a/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas 5.py b/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas 5.py new file mode 100644 index 00000000..d9717386 --- /dev/null +++ b/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas 5.py @@ -0,0 +1,11 @@ +import pandas as pd + +train = pd.read_csv('train_1.csv').fillna(0) +print(train.head()) + +def parse_page(page): + x = page.split('_') # split the string by underscore. + return ''.join(x[:-3]), x[-3], x[-2], x[-1] + + +print(parse_page(train.Page[1])) diff --git a/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas 6.py b/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas 6.py new file mode 100644 index 00000000..a97955d0 --- /dev/null +++ b/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas 6.py @@ -0,0 +1,11 @@ +import pandas as pd + +train = pd.read_csv('train_1.csv').fillna(0) +print(train.head()) + +def parse_page(page): + x = page.split('_') # split the string by underscore. + return ''.join(x[:-3]), x[-3], x[-2], x[-1] + + +print(parse_page(train.Page[2])) diff --git a/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas 7.py b/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas 7.py new file mode 100644 index 00000000..ecd530fc --- /dev/null +++ b/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas 7.py @@ -0,0 +1,15 @@ +import pandas as pd + +train = pd.read_csv('train_1.csv').fillna(0) +print(train.head()) + +def parse_page(page): + x = page.split('_') # split the string by underscore. + return ''.join(x[:-3]), x[-3], x[-2], x[-1] + + +print(parse_page(train.Page[0])) + +trimmed_train = parse_page(train) + +print(trimmed_train.head()) diff --git a/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas 8.ipynb b/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas 8.ipynb new file mode 100644 index 00000000..209d6b78 --- /dev/null +++ b/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas 8.ipynb @@ -0,0 +1,115 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Page 2015-07-01 2015-07-02 \\\n", + "0 2NE1_zh.wikipedia.org_all-access_spider 18.0 11.0 \n", + "1 2PM_zh.wikipedia.org_all-access_spider 11.0 14.0 \n", + "2 3C_zh.wikipedia.org_all-access_spider 1.0 0.0 \n", + "3 4minute_zh.wikipedia.org_all-access_spider 35.0 13.0 \n", + "4 52_Hz_I_Love_You_zh.wikipedia.org_all-access_s... 0.0 0.0 \n", + "\n", + " 2015-07-03 2015-07-04 2015-07-05 2015-07-06 2015-07-07 2015-07-08 \\\n", + "0 5.0 13.0 14.0 9.0 9.0 22.0 \n", + "1 15.0 18.0 11.0 13.0 22.0 11.0 \n", + "2 1.0 1.0 0.0 4.0 0.0 3.0 \n", + "3 10.0 94.0 4.0 26.0 14.0 9.0 \n", + "4 0.0 0.0 0.0 0.0 0.0 0.0 \n", + "\n", + " 2015-07-09 ... 2016-12-22 2016-12-23 2016-12-24 2016-12-25 \\\n", + "0 26.0 ... 32.0 63.0 15.0 26.0 \n", + "1 10.0 ... 17.0 42.0 28.0 15.0 \n", + "2 4.0 ... 3.0 1.0 1.0 7.0 \n", + "3 11.0 ... 32.0 10.0 26.0 27.0 \n", + "4 0.0 ... 48.0 9.0 25.0 13.0 \n", + "\n", + " 2016-12-26 2016-12-27 2016-12-28 2016-12-29 2016-12-30 2016-12-31 \n", + "0 14.0 20.0 22.0 19.0 18.0 20.0 \n", + "1 9.0 30.0 52.0 45.0 26.0 20.0 \n", + "2 4.0 4.0 6.0 3.0 4.0 17.0 \n", + "3 16.0 11.0 17.0 19.0 10.0 11.0 \n", + "4 3.0 11.0 27.0 13.0 36.0 10.0 \n", + "\n", + "[5 rows x 551 columns]\n", + "('2NE1', 'zh.wikipedia.org', 'all-access', 'spider')\n" + ] + }, + { + "data": { + "text/plain": "" + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAEgCAYAAABBzo+bAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAThElEQVR4nO3dfbCedZ3f8ffHRBRpgSApYxPWZMeMW7RrxSxka6cPpAsB3Q3TuhTrLhlLyR/i1tqdVdzZDlMfpjrTWVdaZZaRrMG6sizuLKmGpSm63ba7IEEUBGQ4w8OSlIesiUDXUUS//eP+HbzP4fwSc25yrnDO+zVzz31d3+t33df3ZDLnc67HO1WFJElzecnQDUiSjl6GhCSpy5CQJHUZEpKkLkNCktRlSEiSupYP3cAL7eSTT641a9YM3YYkvajcfvvtf1VVK2fXF11IrFmzht27dw/dhiS9qCR5eK66h5skSV2GhCSpy5CQJHUZEpKkLkNCktRlSEiSugwJSVKXISFJ6lp0N9O9WKy57EtDt7BoPPTRtwzdgrRouSchSeoyJCRJXYaEJKnLkJAkdRkSkqQuQ0KS1GVISJK6DAlJUpchIUnqMiQkSV2GhCSpy5CQJHUZEpKkLkNCktRlSEiSug4ZEkm2JXkiyTfHaicl2ZXk/va+otWT5IokU0nuTHL62Dpb2vj7k2wZq78pyV1tnSuS5GDbkCQtnJ9kT+IzwKZZtcuAm6tqHXBzmwc4F1jXXluBK2H0Cx+4HDgTOAO4fOyX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cm53+5ZXp+ar66QVuadFzT0KzPZrk/e2vtOm/1B5vl8V6KayG9n7gDVW1Fvg94BvAP6+qtQbEkWFIaLZ/Caxm9OXyfwz8VKstAy4YrCtp5Leq6qkk/wA4C/g0cOXAPS1qHm6S9KIx/RTYJP8RuKuqfn+uJ8PqheMd15qh3WH9PuB1wMun61V11mBNST+2N8nvAr8AfCzJy/CIyBHlP65m+xzwLWAt8B+Ah4DbhmxIGnMBo++1PqeqvgOcBPzGoB0tch5u0gxJbq+qN41fj57kNp8CKy1NHm7SbNN3Vj+a5C3A/2X015qkJciQ0Gwfbs/q/3XgPwPHA+8dtiVJQ/FwkySpyxPX6krytaF7kDQsQ0IHk0MPkbSYGRI6mC8N3YCkYXlOQpLU5dVNAiDJ0/z4qZozFjF6uubxC9ySpKOAexKSpC73JAR0v7b0OVW1f6F6kXT0cE9CwHNf5lLMvKJpet4vc5GWKPckBED7Ehfgub2KdYw9BVbS0mRIaIYk/xp4D6MvHvo6sAH4c2DjgG1JGoj3SWi29wA/BzxcVf8EeCPw5LAtSRqKIaHZvldV3wNI8rKq+hbw2oF7kjQQDzdptj1JTmT0/da7khwAHh60I0mD8eomdSX5R8AJwJ9U1TND9yNp4RkSkqQuz0lIkroMCUlSlyEhSeoyJCRJXYaEJKnr/wPZPW/0e1qE1wAAAABJRU5ErkJggg==\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "import pandas as pd\n", + "\n", + "train = pd.read_csv('train_1.csv').fillna(0)\n", + "print(train.head())\n", + "\n", + "def parse_page(page):\n", + " x = page.split('_') # split the string by underscore.\n", + " return ''.join(x[:-3]), x[-3], x[-2], x[-1]\n", + "\n", + "\n", + "print(parse_page(train.Page[0]))\n", + "\n", + "\n", + "l = list(train.Page.apply(parse_page))\n", + "df = pd.DataFrame(l)\n", + "df.columns = ['Subject', 'Sub_Page', 'Access', 'Agent']\n", + "\n", + "train = pd.concat([train, df], axis=1)\n", + "del train['Page']\n", + "\n", + "train.Sub_Page.value_counts().plot(kind='bar')\n", + "\n", + "train.Access.value_counts().plot(kind='bar')\n", + "\n", + "train.Agent.value_counts().plot(kind='bar')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas 8.py b/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas 8.py new file mode 100644 index 00000000..1499c8ff --- /dev/null +++ b/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas 8.py @@ -0,0 +1,21 @@ +import pandas as pd + +train = pd.read_csv('train_1.csv').fillna(0) +print(train.head()) + +def parse_page(page): + x = page.split('_') # split the string by underscore. + return ''.join(x[:-3]), x[-3], x[-2], x[-1] + + +print(parse_page(train.Page[0])) + + +l = list(train.Page.apply(parse_page)) +df = pd.DataFrame(l) +df.columns = ['Subject', 'Sub_Page', 'Access', 'Agent'] + +train = pd.concat([train, df], axis=1) +del train['Page'] + +train.Sub_Page.value_counts().plot(kind='bar') diff --git a/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas2.py b/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas2.py new file mode 100644 index 00000000..8b08a5ad --- /dev/null +++ b/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation in pandas2.py @@ -0,0 +1,11 @@ +import pandas as pd + +train = pd.read_csv('train_1.csv').fillna(0) +print(train.head()) + +def parse_page(page): + x = page.split('_') # split the string by underscore. + return ''.join(x[:-3]), x[-3], x[-2], x[-1] + + +print(parse_page(train.Page[0])) diff --git a/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation pandas3.py b/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation pandas3.py new file mode 100644 index 00000000..3be93828 --- /dev/null +++ b/Machine Learning for Finance/Chapter4 - Time Series/Visualization and preparation pandas3.py @@ -0,0 +1,11 @@ +import pandas as pd + +train = pd.read_csv('train_1.csv').fillna(0) +print(train.head()) + +def parse_page(page): + x = page.split('_') # split the string by underscore. + return ''.join(x[:-3]), x[-3], x[-2], x[-1] + + +print(parse_page(train.loc['Page', 0])) diff --git a/Machine Learning for Finance/Chapter7 - Reinforcement Learning/__init__.py b/Machine Learning for Finance/Chapter7 - Reinforcement Learning/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Master Python Data Visualization/Chapter 7 - Bioinformatics, Genetics, and Network Models/Maximum flow and minimum cut.py b/Master Python Data Visualization/Chapter 7 - Bioinformatics, Genetics, and Network Models/Maximum flow and minimum cut.py new file mode 100644 index 00000000..5dcf4411 --- /dev/null +++ b/Master Python Data Visualization/Chapter 7 - Bioinformatics, Genetics, and Network Models/Maximum flow and minimum cut.py @@ -0,0 +1,17 @@ +import networkx as nx +import matplotlib.pyplot as plt + +G = nx.DiGraph() +G.add_edge('p', 'y', capacity=5.0) +G.add_edge('p', 's', capacity=4.0) +G.add_edge('y', 't', capacity=3.0) +G.add_edge('s', 'h', capacity=5.0) +G.add_edge('s', 'o', capacity=4.0) + +flow_value = nx.maximum_flow_value(flowG=G, _s='p', _t='o') + +print("Flow value", flow_value) + +nx.draw(G=G, node_color='#a0cbe2') + +plt.show() diff --git a/Master Python Data Visualization/Chapter 7 - Bioinformatics, Genetics, and Network Models/__init__.py b/Master Python Data Visualization/Chapter 7 - Bioinformatics, Genetics, and Network Models/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Master Python Data Visualization/__init__.py b/Master Python Data Visualization/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Matplotlib 2 By Example/Ticker locator and formatter.py b/Matplotlib 2 By Example/Ticker locator and formatter.py new file mode 100644 index 00000000..3f34a1c8 --- /dev/null +++ b/Matplotlib 2 By Example/Ticker locator and formatter.py @@ -0,0 +1,28 @@ +import numpy as np +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker + +x = range(2011, 2018) +y = [26.48, 27.56, 29.41, 33.27, 36.32, 37.55, 40.28, 44.35, 48.36, 50.05, + 53.06, 57.39, 62.27, 65.55, 69.17, 74.76, 81.5, 83.18, 86.74, 93.8, 98.75] + +plt.plot(y, marker='^', label="Netflix subscribers", linestyle='-') + +# get the current axes and store it to ax +ax = plt.gca() + +# set ticks in multiples for both labels +ax.xaxis.set_major_locator(ticker.MultipleLocator(4)) +# Set major marks every 4 quarters, i.e. once a year + +# set minor marks for each quarter +ax.xaxis.set_minor_locator(ticker.MultipleLocator(1)) + +ax.yaxis.set_major_locator(ticker.MultipleLocator(10)) +ax.yaxis.set_minor_locator(ticker.MultipleLocator(2)) + +# label the start of each year by Fixed Formatter +ax.get_xaxis().set_major_formatter(ticker.FixedFormatter(x)) + +plt.legend() +plt.show() diff --git a/Matplotlib 2 By Example/__init__.py b/Matplotlib 2 By Example/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Matplotlib 3 Cookbook/Annotating a point on a polar plot.py b/Matplotlib 3 Cookbook/Annotating a point on a polar plot.py new file mode 100644 index 00000000..9c08d1ff --- /dev/null +++ b/Matplotlib 3 Cookbook/Annotating a point on a polar plot.py @@ -0,0 +1,29 @@ +import numpy as np +import matplotlib.pyplot as plt + +fig = plt.figure() + +# Define the axes and declares it as a polar plot. (You can also use polar=True) +ax = fig.add_subplot(111, projection='polar') + +# r and theta set the data for radius, and the angle for the plot of the polar coordinates. +r = np.arange(0, 1, 0.001) +theta = 2 * 2*np.pi * r + +# Plot the polar chart with theta and r. +ax.plot(theta, r, color=[0.9, 0.4, 0.7], lw=3) # lw = line width +# color is specified with R, G, and B color values to create a custom color. +# R, G, and B values vary from 0 (dark) to 1 (bright). + +# Plot a point with diamond marker at the 600 point on the polar curve. +ind = 600 +pointr, pointtheta = r[ind], theta[ind] + +ax.plot([pointtheta], [pointr], 'D', markersize=10) + +# Define the annotation for the diamond point +ax.annotate('a polar annotation', xy=(pointtheta, pointr), xytext=(1.0, 0.75), + textcoords='figure fraction', arrowprops=dict(facecolor='red', shrink=0.05), + horizontalalignment='right', verticalalignment='bottom') + +plt.show() diff --git a/Matplotlib 3 Cookbook/Annotating a point on a polar plot_2.py b/Matplotlib 3 Cookbook/Annotating a point on a polar plot_2.py new file mode 100644 index 00000000..0cd7e558 --- /dev/null +++ b/Matplotlib 3 Cookbook/Annotating a point on a polar plot_2.py @@ -0,0 +1,32 @@ +import numpy as np +import matplotlib.pyplot as plt + +fig = plt.figure() + +# Define the axes and declares it as a polar plot. (You can also use polar=True) +ax = fig.add_subplot(111, projection='polar') + +# r and theta set the data for radius, and the angle for the plot of the polar coordinates. +r = np.arange(0, 1, 0.001) +theta = 2 * 2*np.pi * r + +# Plot the polar chart with theta and r. +ax.plot(theta, r, color=[0.9, 0.4, 0.7], lw=3) # lw = line width +# color is specified with R, G, and B color values to create a custom color. +# R, G, and B values vary from 0 (dark) to 1 (bright). + +# Plot a point with diamond marker at the 600 point on the polar curve. +index = 600 +point_r, point_theta = r[index], theta[index] + +# the coordinates point_theta and point_r +ax.plot([point_theta], [point_r], 'D', markersize=10) + +# Define the annotation for the diamond point +## xy specifies the coordinates of the point to be annotated. +## xytext specifies the coordinates where the text description should be placed. +ax.annotate('a polar annotation', xy=(point_theta, point_r), xytext=(1.0, 0.75), + textcoords='figure fraction', arrowprops=dict(facecolor='red', shrink=0.05), + horizontalalignment='right', verticalalignment='bottom') + +plt.show() diff --git a/Matplotlib 3 Cookbook/Bar plot (horizontal).py b/Matplotlib 3 Cookbook/Bar plot (horizontal).py new file mode 100644 index 00000000..bbb39e3b --- /dev/null +++ b/Matplotlib 3 Cookbook/Bar plot (horizontal).py @@ -0,0 +1,18 @@ +import matplotlib.pyplot as plt +import calendar + +# matplotlib accepts only floating point data types as its arguments for data. +# So months have to be represented in numerical format. +month_num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] +units_sold = [500, 600, 750, 900, 1100, 1050, 1000, 950, 800, 700, 550, 450] + +fig, ax = plt.subplots() + +# change the month number to month name on y axis +plt.yticks(month_num, calendar.month_name[1:13], rotation=20) + +# plot horizontal bar graph +plot = plt.barh(month_num, units_sold) + +# display the graph on the screen +plt.show() diff --git a/Matplotlib 3 Cookbook/Bar plot.py b/Matplotlib 3 Cookbook/Bar plot.py new file mode 100644 index 00000000..8177ebf3 --- /dev/null +++ b/Matplotlib 3 Cookbook/Bar plot.py @@ -0,0 +1,20 @@ +import matplotlib.pyplot as plt +import numpy as np +import calendar + +month_num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] + +units_sold = [500, 600, 750, 900, 1100, 1050, 1000, 950, 800, 700, 550, 450] + +fig, ax = plt.subplots() + +plt.xticks(month_num, calendar.month_name[1:13], rotation=27) + +plot = ax.bar(month_num, units_sold) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002*height, + '%d'%int(height), ha='center', va='bottom') + +plt.show() diff --git a/Matplotlib 3 Cookbook/Embedding Text and Expressions.py b/Matplotlib 3 Cookbook/Embedding Text and Expressions.py new file mode 100644 index 00000000..68a34dc1 --- /dev/null +++ b/Matplotlib 3 Cookbook/Embedding Text and Expressions.py @@ -0,0 +1,20 @@ +import numpy as np +import matplotlib.pyplot as plt + +font = {'family': 'DejaVu Sans', 'name': 'Times New Roman', 'style': 'italic', 'color': 'orange', + 'weight': 'bold', 'size': 16} + +t = np.linspace(0.0, 5.0, 100) +y = np.sin(2*np.pi*t) * np.exp(-t/2) +plt.plot(t, y, 'm') + +# Define the text, title, and labels, and print them on the plot: +plt.text(2, 0.65, r'$\sin(2 \pi t) \exp(-t/2)$', fontdict=font) +plt.title('Damped exponential decay', fontdict=font) +plt.xlabel('time (s)', fontdict=font) +plt.ylabel('voltage (mV)', fontdict=font) + +# Adjust the space to prevent clipping of ylabel. +plt.subplots_adjust(left=0.15) + +plt.show() diff --git a/Matplotlib 3 Cookbook/Font dictionary.py b/Matplotlib 3 Cookbook/Font dictionary.py new file mode 100644 index 00000000..d524dbeb --- /dev/null +++ b/Matplotlib 3 Cookbook/Font dictionary.py @@ -0,0 +1,24 @@ +import numpy as np +import matplotlib.pyplot as plt + +# Define the font dictionary to be applied to all the text in the plot. +font = {'family': 'DejaVu Sans', 'name': 'Times New Roman', 'style': 'italic', + 'color': 'orange', 'weight': 'bold', 'size': 16} + +# Define the data for an exponentially decaying curve and plot it. +t = np.linspace(0.0, 5.0, 100) +y = np.sin(2 * np.pi * t) * np.exp(-t/2) +plt.plot(t, y, 'm') + +# Define the text, title, and labels, and print them on the plot. +plt.text(x=2, y=0.65, s=r'$\sin(2 \pi t) \exp(-t/2)$', fontdict=font) + +plt.title('Damped exponential decay', fontdict=font) + +plt.xlabel('time (s)', fontdict=font) +plt.ylabel('voltage (mV)', fontdict=font) + +# Adjust the space to prevent clipping of ylabel. +plt.subplots_adjust(left=0.15) + +plt.show() diff --git a/Matplotlib 3 Cookbook/Pie plot.py b/Matplotlib 3 Cookbook/Pie plot.py new file mode 100644 index 00000000..a6bf13a4 --- /dev/null +++ b/Matplotlib 3 Cookbook/Pie plot.py @@ -0,0 +1,14 @@ +import matplotlib.pyplot as plt + +labels = ['SciFi', 'Drama', 'Thriller', 'Comedy', 'Action', 'Romance'] +sizes = [5, 15, 10, 20, 40, 10] # Add upto 100% + +# Show one slice slightly outside the circle. +explode = (0, 0, 0, 0, 0.1, 0) # only "explode" the 5th slice (i.e. 'Action') + +plt.pie(x=sizes, explode=explode, labels=labels, autopct='%1.1f%%', shadow=True, startangle=90) + +# The equal aspect ratio ensures that pie is drawn as a circle. The default is an ellipse. +plt.axis('equal') + +plt.show() diff --git a/Matplotlib 3 Cookbook/Pie plot2.py b/Matplotlib 3 Cookbook/Pie plot2.py new file mode 100644 index 00000000..70d8f9fb --- /dev/null +++ b/Matplotlib 3 Cookbook/Pie plot2.py @@ -0,0 +1,14 @@ +import matplotlib.pyplot as plt + +labels = ['SciFi', 'Drama', 'Thriller', 'Comedy', 'Action', 'Romance'] +sizes = [5, 15, 10, 20, 40, 10] # Add upto 100% + +# Show one slice slightly outside the circle. +explode = (0, 0, 0, 0, 0.1, 0) # only "explode" the 5th slice (i.e. 'Action') + +plt.pie(x=sizes, explode=explode, labels=labels, autopct='%1.2f%%', shadow=True, startangle=90) + +# The equal aspect ratio ensures that pie is drawn as a circle. The default is an ellipse. +plt.axis('equal') + +plt.show() diff --git a/Matplotlib 3 Cookbook/Pie plot3.py b/Matplotlib 3 Cookbook/Pie plot3.py new file mode 100644 index 00000000..d01ce3c2 --- /dev/null +++ b/Matplotlib 3 Cookbook/Pie plot3.py @@ -0,0 +1,14 @@ +import matplotlib.pyplot as plt + +labels = ['SciFi', 'Drama', 'Thriller', 'Comedy', 'Action', 'Romance'] +sizes = [5, 15, 10, 20, 40, 10] # Add upto 100% + +# Show one slice slightly outside the circle. +explode = (0, 0, 0, 0, 0.1, 0) # only "explode" the 5th slice (i.e. 'Action') + +plt.pie(x=sizes, explode=explode, labels=labels, autopct='%1.1f%%', shadow=False, startangle=90) + +# The equal aspect ratio ensures that pie is drawn as a circle. The default is an ellipse. +plt.axis('equal') + +plt.show() diff --git a/Matplotlib 3 Cookbook/Stacked plot.py b/Matplotlib 3 Cookbook/Stacked plot.py new file mode 100644 index 00000000..985fae99 --- /dev/null +++ b/Matplotlib 3 Cookbook/Stacked plot.py @@ -0,0 +1,19 @@ +import numpy as np +import matplotlib.pyplot as plt + +x = np.array([1, 2, 3, 4, 5, 6], dtype=np.int32) +April = [5, 7, 6, 7, 8, 9] +May = [0, 4, 3, 7, 8, 9] +June = [6, 7, 4, 5, 6, 8] + +labels = ["April ", "May", "June"] + +fig, ax = plt.subplots() + +ax.stackplot(x, April, May, June, labels=labels) +ax.legend(loc=2) +plt.xlabel('defect reason code') +plt.ylabel('number of defects') +plt.title('Product Defects - Q1 FY2019') + +plt.show() diff --git a/Matplotlib 3 Cookbook/Stacked plot2.py b/Matplotlib 3 Cookbook/Stacked plot2.py new file mode 100644 index 00000000..d9b11afa --- /dev/null +++ b/Matplotlib 3 Cookbook/Stacked plot2.py @@ -0,0 +1,19 @@ +import numpy as np +import matplotlib.pyplot as plt + +x = np.array([1, 2, 3, 4, 5, 6]) +April = [5, 7, 6, 7, 8, 9] +May = [0, 4, 3, 7, 8, 9] +June = [6, 7, 4, 5, 6, 8] + +labels = ["April ", "May", "June"] + +fig, ax = plt.subplots() + +ax.stackplot(x, April, May, June, labels=labels) +ax.legend(loc=2) +plt.xlabel('defect reason code') +plt.ylabel('number of defects') +plt.title('Product Defects - Q1 FY2019') + +plt.show() diff --git a/Matplotlib 3 Cookbook/Table chart 2.py b/Matplotlib 3 Cookbook/Table chart 2.py new file mode 100644 index 00000000..195beccc --- /dev/null +++ b/Matplotlib 3 Cookbook/Table chart 2.py @@ -0,0 +1,67 @@ +import matplotlib.pyplot as plt +import numpy as np +import matplotlib.cm as cm + +# table's row +rows = ['2011', '2012', '2013', '2014', '2015'] + +# table's column +columns = ('7Ah', '35Ah', '40Ah', '135Ah', '150Ah', '150Ah') + +# table's data +data = [[75, 144, 114, 102, 108], + [90, 126, 102, 84, 126], + [96, 114, 75, 105, 135], + [105, 90, 150, 90, 75], + [90, 75, 135, 75, 90]] + +# Define the range and scale for the y axis. +values = np.arange(0, 600, 100) + +cmap = cm.get_cmap("Spectral") +# Specify the color spectrum to be used. Each year will be represented in a different color: +colors = cmap(np.linspace(0, 0.5, len(rows))) + +# Define x axis ticks where the bars are to be plotted. +index = np.arange(len(columns)) + 0.3 + +# Initialize the vertical offset for the stacked bar chart +y_offset = np.zeros(len(columns)) + +# Specify the area for the plot in terms of figure and axes. +figure, axes = plt.subplots() + +# Plot bars and create text labels for the table. + +# Initialize the list where data for the table is save. +cell_text = [] + +n_rows = len(data) + +# Each iteration of the for loop plots one year of data (for all battery ratings in one color). +for row in range(n_rows): + plot = axes.bar(index, data[row], 0.5, bottom=y_offset, color=colors[row]) + y_offset = y_offset + data[row] + cell_text.append(['%1.1f' % (x) for x in y_offset]) + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table to the bottom of the axes +table = axes.table(cellText=cell_text, + rowLabels=rows, + rowColours=colors, + colLabels=columns, + loc='bottom') + +axes.set_ylabel("Units Sold") +axes.set_xticks([]) +axes.set_title("The Number Of Batteries Sold Per Year") + +plt.show() diff --git a/Matplotlib 3 Cookbook/Table chart 3.py b/Matplotlib 3 Cookbook/Table chart 3.py new file mode 100644 index 00000000..353a7dd6 --- /dev/null +++ b/Matplotlib 3 Cookbook/Table chart 3.py @@ -0,0 +1,67 @@ +import matplotlib.pyplot as plt +import numpy as np +import matplotlib.cm as cm + +# table's row +rows = ['2011', '2012', '2013', '2014', '2015'] + +# table's column +columns = ('7Ah', '35Ah', '40Ah', '135Ah', '150Ah', '150Ah') + +# table's data +data = [[75, 144, 114, 102, 108], + [90, 126, 102, 84, 126], + [96, 114, 75, 105, 135], + [105, 90, 150, 90, 75], + [90, 75, 135, 75, 90]] + +# Define the range and scale for the y axis. +values = np.arange(0, 600, 100) + +cmap = cm.get_cmap("Spectral") +# Specify the color spectrum to be used. Each year will be represented in a different color: +colors = cmap(np.linspace(0, 0.5, len(rows))) + +# Define x axis ticks where the bars are to be plotted. +index = np.arange(len(columns)) + 0.3 + +# Initialize the vertical offset for the stacked bar chart +y_offset = np.zeros(len(columns)) + +# Specify the area for the plot in terms of figure and axes. +figure, axes = plt.subplots() + +# Plot bars and create text labels for the table. + +# Initialize the list where data for the table is save. +cell_text = [] + +n_rows = len(data) + +# Each iteration of the for loop plots one year of data (for all battery ratings in one color). +for row in range(n_rows): + plot = axes.bar(index, data[row], 0.5, bottom=y_offset, color=colors[row]) + y_offset = y_offset + data[row] + cell_text.append(['%1.1f' % (x) for x in y_offset]) + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table to the bottom of the axes +table = axes.table(cellText=cell_text, + rowLabels=rows, + rowColours=colors, + colLabels=columns, + loc='bottom') + +axes.set_ylabel("Units Sold") +axes.set_xticks([]) +axes.set_title("The Number Of Batteries Sold Per Year") + +plt.show() diff --git a/Matplotlib 3 Cookbook/Table chart.py b/Matplotlib 3 Cookbook/Table chart.py new file mode 100644 index 00000000..d5036940 --- /dev/null +++ b/Matplotlib 3 Cookbook/Table chart.py @@ -0,0 +1,60 @@ +import matplotlib.pyplot as plt +import numpy as np + +# sold in each year +rows = ['2011', '2012', '2013', '2014', '2015'] + +# The types of batteries +columns = ('7Ah', '35Ah', '40Ah', '135Ah', '150Ah', '150Ah') + +data = [[75, 144, 114, 102, 108], + [90, 126, 102, 84, 126], + [96, 114, 75, 105, 135], + [105, 90, 150, 90, 75], + [90, 75, 135, 75, 90]] + +# Define the range and scale for the y axis. +values = np.arange(0, 600, 100) + +# Specify the color spectrum to be used. Each year will be represented in a different color: +colors = plt.cm.OrRd(np.linspace(0, 0.5, len(rows))) + +# Define x axis ticks where the bars are to be plotted. +index = np.arange(len(columns)) + 0.3 + +# Initialize the vertical offset for the stacked bar chart +y_offset = np.zeros(len(columns)) + +# Specify the area for the plot in terms of figure and axes. +figure, axes = plt.subplots() + +# Plot bars and create text labels for the table. +# Initialize the list in which data for the table is save. +cell_text = [] + +# Each iteration of the for loop plots one year of data for all battery ratings in one color. +n_rows = len(data) + +for row in range(n_rows): + plot = plt.bar(index, data[row], 0.5, bottom=y_offset, color=colors[row]) + y_offset = y_offset + data[row] + cell_text.append(['%1.1f' % (x) for x in y_offset]) + i = 0 + + # Each iteration of this for loop, label each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table to the bottom of the axes +table = plt.table(cellText=cell_text, rowLabels=rows, rowColours=colors, colLabels=columns, + loc='bottom') + +plt.ylabel("Units Sold") +plt.xticks([]) +plt.title("The Number Of Batteries Sold Per Year") + +plt.show() diff --git a/Matplotlib 3 Cookbook/Table.py b/Matplotlib 3 Cookbook/Table.py new file mode 100644 index 00000000..564428fa --- /dev/null +++ b/Matplotlib 3 Cookbook/Table.py @@ -0,0 +1,22 @@ +import matplotlib.pyplot as plt +import numpy as np + +# sold in each year +rows = ['2011', '2012', '2013', '2014', '2015'] + +# The types of batteries +columns = ('7Ah', '35Ah', '40Ah', '135Ah', '150Ah', '150Ah') + +data = [[75, 144, 114, 102, 108], + [90, 126, 102, 84, 126], + [96, 114, 75, 105, 135], + [105, 90, 150, 90, 75], + [90, 75, 135, 75, 90]] + +plt.table(cellText=data, rowLabels=rows, colLabels=columns, loc='bottom') + +plt.ylabel("Units Sold") +plt.xticks([]) +plt.title("The Number Of Batteries Sold Per Year") + +plt.show() diff --git a/Matplotlib 3 Cookbook/Text box.py b/Matplotlib 3 Cookbook/Text box.py new file mode 100644 index 00000000..6bac7289 --- /dev/null +++ b/Matplotlib 3 Cookbook/Text box.py @@ -0,0 +1,4 @@ +import matplotlib.pyplot as plt + + + diff --git a/Matplotlib 3 Cookbook/Using annotation.py b/Matplotlib 3 Cookbook/Using annotation.py new file mode 100644 index 00000000..5852aa34 --- /dev/null +++ b/Matplotlib 3 Cookbook/Using annotation.py @@ -0,0 +1,4 @@ +import matplotlib.pyplot as plt +import numpy as np + +plt.plot(theta, np.sin(theta)) \ No newline at end of file diff --git a/Matplotlib 3 Cookbook/__init__.py b/Matplotlib 3 Cookbook/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Matplotlib Official Primer/2D and 3D Axes in same Figure.py b/Matplotlib Official Primer/2D and 3D Axes in same Figure.py new file mode 100644 index 00000000..6e64a0a9 --- /dev/null +++ b/Matplotlib Official Primer/2D and 3D Axes in same Figure.py @@ -0,0 +1,40 @@ +import matplotlib.pyplot as plt +import numpy as np + + +def f(t): + return np.cos(2*np.pi*t) * np.exp(-t) + + +# Set up a figure twice as tall as it is wide +fig = plt.figure(figsize=plt.figaspect(2.)) +fig.suptitle('A tale of 2 subplots') + +# First subplot +ax = fig.add_subplot(2, 1, 1) + +t1 = np.arange(0.0, 5.0, 0.1) +t2 = np.arange(0.0, 5.0, 0.02) +t3 = np.arange(0.0, 2.0, 0.01) + +ax.plot(t1, f(t1), 'bo', + t2, f(t2), 'k--', markerfacecolor='green') +ax.grid(True) +ax.set_ylabel('Damped oscillation') + +# Second subplot +ax = fig.add_subplot(2, 1, 2, projection='3d') + +X = np.arange(-5, 5, 0.25) +Y = np.arange(-5, 5, 0.25) +X, Y = np.meshgrid(X, Y) +R = np.sqrt(X**2 + Y**2) +Z = np.sin(R) + +surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, + linewidth=0, antialiased=False) +ax.set_zlim(-1, 1) + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/mplot3d/mixed_subplots.html#sphx-glr-gallery-mplot3d-mixed-subplots-py diff --git a/Matplotlib Official Primer/Anatomy of a figure.py b/Matplotlib Official Primer/Anatomy of a figure.py new file mode 100644 index 00000000..19632e9b --- /dev/null +++ b/Matplotlib Official Primer/Anatomy of a figure.py @@ -0,0 +1,139 @@ +import numpy as np +import matplotlib.pyplot as plt +from matplotlib.ticker import AutoMinorLocator, MultipleLocator + +np.random.seed(19680801) + +X = np.linspace(0.5, 3.5, 100) +Y1 = 3+np.cos(X) +Y2 = 1+np.cos(1+X/0.75)/2 +Y3 = np.random.uniform(Y1, Y2, len(X)) + +fig = plt.figure(figsize=(8, 8)) +ax = fig.add_subplot(1, 1, 1, aspect=1) + + +def minor_tick(x, pos): + if not x % 1.0: + return "" + return f"{x:.2f}" + +ax.xaxis.set_major_locator(MultipleLocator(1.000)) +ax.xaxis.set_minor_locator(AutoMinorLocator(4)) +ax.yaxis.set_major_locator(MultipleLocator(1.000)) +ax.yaxis.set_minor_locator(AutoMinorLocator(4)) + +# FuncFormatter is created and used automatically +ax.xaxis.set_minor_formatter(minor_tick) + +ax.set_xlim(0, 4) +ax.set_ylim(0, 4) + +ax.tick_params(which='major', width=1.0) +ax.tick_params(which='major', length=10) +ax.tick_params(which='minor', width=1.0, labelsize=10) +ax.tick_params(which='minor', length=5, labelsize=10, labelcolor='0.25') + +ax.grid(linestyle="--", linewidth=0.5, color='.25', zorder=-10) + +ax.plot(X, Y1, c=(0.25, 0.25, 1.00), lw=2, label="Blue signal", zorder=10) +ax.plot(X, Y2, c=(1.00, 0.25, 0.25), lw=2, label="Red signal") +ax.plot(X, Y3, linewidth=0, + marker='o', markerfacecolor='w', markeredgecolor='k') + +ax.set_title("Anatomy of a figure", fontsize=20, verticalalignment='bottom') +ax.set_xlabel("X axis label") +ax.set_ylabel("Y axis label") + +ax.legend() + + +def circle(x, y, radius=0.15): + from matplotlib.patches import Circle + from matplotlib.patheffects import withStroke + circle = Circle((x, y), radius, clip_on=False, zorder=10, linewidth=1, + edgecolor='black', facecolor=(0, 0, 0, .0125), + path_effects=[withStroke(linewidth=5, foreground='w')]) + ax.add_artist(circle) + + +def text(x, y, text): + ax.text(x, y, text, backgroundcolor="white", + ha='center', va='top', weight='bold', color='blue') + + +# Minor tick +circle(0.50, -0.10) +text(0.50, -0.32, "Minor tick label") + +# Major tick +circle(-0.03, 4.00) +text(0.03, 3.80, "Major tick") + +# Minor tick +circle(0.00, 3.50) +text(0.00, 3.30, "Minor tick") + +# Major tick label +circle(-0.15, 3.00) +text(-0.15, 2.80, "Major tick label") + +# X Label +circle(1.80, -0.27) +text(1.80, -0.45, "X axis label") + +# Y Label +circle(-0.27, 1.80) +text(-0.27, 1.6, "Y axis label") + +# Title +circle(1.60, 4.13) +text(1.60, 3.93, "Title") + +# Blue plot +circle(1.75, 2.80) +text(1.75, 2.60, "Line\n(line plot)") + +# Red plot +circle(1.20, 0.60) +text(1.20, 0.40, "Line\n(line plot)") + +# Scatter plot +circle(3.20, 1.75) +text(3.20, 1.55, "Markers\n(scatter plot)") + +# Grid +circle(3.00, 3.00) +text(3.00, 2.80, "Grid") + +# Legend +circle(3.70, 3.80) +text(3.70, 3.60, "Legend") + +# Axes +circle(0.5, 0.5) +text(0.5, 0.3, "Axes") + +# Figure +circle(-0.3, 0.65) +text(-0.3, 0.45, "Figure") + +color = 'blue' +ax.annotate('Spines', xy=(4.0, 0.35), xytext=(3.3, 0.5), + weight='bold', color=color, + arrowprops=dict(arrowstyle='->', + connectionstyle="arc3", + color=color)) + +ax.annotate('', xy=(3.15, 0.0), xytext=(3.45, 0.45), + weight='bold', color=color, + arrowprops=dict(arrowstyle='->', + connectionstyle="arc3", + color=color)) + +ax.text(4.0, -0.4, "Made with https://matplotlib.org", + fontsize=10, ha="right", color='.5') + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/showcase/anatomy.html#sphx-glr-gallery-showcase-anatomy-py diff --git a/Matplotlib Official Primer/Annotations/Annotating with text with box.py b/Matplotlib Official Primer/Annotations/Annotating with text with box.py new file mode 100644 index 00000000..aa48ec64 --- /dev/null +++ b/Matplotlib Official Primer/Annotations/Annotating with text with box.py @@ -0,0 +1,51 @@ +import tensorflow as tf +import numpy as np +import matplotlib.pyplot as plt +import keras +from tensorflow.keras.utils import plot_model +from mlxtend.plotting import plot_decision_regions +import tensorflow + +tf.random.set_seed(1) +np.random.seed(1) + +# We generate a toy dataset of 200 training examples with 2 features (x0, x1) drawn from a +# uniform distribution between [-1, 1) +x = np.random.uniform(low=-1, high=1, size=(200, 2)) +print(x) + +# Assign the ground truth label +y = np.ones(len(x)) +print(y) + +## Applying the threshold rule: +y[x[:, 0] * x[:, 1] < 0] = 0 + +# Use half of the data (100 training examples) for training and the remaining half for +# validation +## feature set (0 - 99) +x_train = x[:100, :] +## label set (0- 99) +y_train = y[:100] + +## the feature set for validation (100 - 199) +x_valid = x[100:, :] + +## the label set for validation (100 - 199) +y_valid = y[100:] + +fig = plt.figure(figsize=(6, 6)) +plt.plot(x[y == 0, 0], x[y == 0, 1], 'o', alpha=0.75, markersize=10) +plt.plot(x[y == 1, 0], x[y == 1, 1], '<', alpha=0.75, markersize=10) +plt.xlabel(r'$x_1$', size=15) +plt.ylabel(r'$x_2$', size=15) + +plt.text(x=0, y=0, s='Direction', + horizontalalignment='center', + verticalalignment='center', + xycoords='data', + textcoords='data', + rotation=45, size=15, + bbox=dict(boxstyle="rarrow,pad=0.3", fc="cyan", ec="b", lw=2)) + +plt.show() diff --git a/Matplotlib Official Primer/Annotations/Annotating with text with box2.py b/Matplotlib Official Primer/Annotations/Annotating with text with box2.py new file mode 100644 index 00000000..dbcfd38d --- /dev/null +++ b/Matplotlib Official Primer/Annotations/Annotating with text with box2.py @@ -0,0 +1,46 @@ +import matplotlib.pyplot as plt +import numpy as np +import tensorflow as tf + +tf.random.set_seed(1) +np.random.seed(1) + +# We generate a toy dataset of 200 training examples with 2 features (x0, x1) drawn from a +# uniform distribution between [-1, 1) +x = np.random.uniform(low=-1, high=1, size=(200, 2)) +print(x) + +# Assign the ground truth label +y = np.ones(len(x)) +print(y) + +## Applying the threshold rule: +y[x[:, 0] * x[:, 1] < 0] = 0 + +# Use half of the data (100 training examples) for training and the remaining half for +# validation +## feature set (0 - 99) +x_train = x[:100, :] +## label set (0- 99) +y_train = y[:100] + +## the feature set for validation (100 - 199) +x_valid = x[100:, :] + +## the label set for validation (100 - 199) +y_valid = y[100:] + +figure, axes = plt.subplots(nrows=1, ncols=1, figsize=(6, 6)) + +axes.plot(x[y == 0, 0], x[y == 0, 1], 'o', alpha=0.75, markersize=10) +axes.plot(x[y == 1, 0], x[y == 1, 1], '<', alpha=0.75, markersize=10) +axes.set_xlabel(r'$x_1$', size=15) +axes.set_ylabel(r'$x_2$', size=15) + +axes.text( + 0, 0, "Direction", ha="center", va="center", rotation=45, size=15, + bbox=dict(boxstyle="rarrow,pad=0.3", fc="cyan", ec="b", lw=2)) + +plt.show() + +# Reference: https://matplotlib.org/stable/tutorials/text/annotations.html#sphx-glr-tutorials-text-annotations-py diff --git a/Matplotlib Official Primer/Annotations/Annotation basics.py b/Matplotlib Official Primer/Annotations/Annotation basics.py new file mode 100644 index 00000000..b0ad267a --- /dev/null +++ b/Matplotlib Official Primer/Annotations/Annotation basics.py @@ -0,0 +1,14 @@ +import numpy as np +import matplotlib.pyplot as plt + +# Define the data for an exponentially decaying curve and plot it. +t = np.linspace(0.0, 5.0, 100) +y = np.sin(2 * np.pi * t) * np.exp(-t/2) +plt.plot(t, y, 'm') + +plt.annotate('local max', xy=(1.3, 0.6), xycoords='data', + xytext=(2.8, 0.7), textcoords='data', + arrowprops=dict(facecolor='black', shrink=0.05), + horizontalalignment='center', verticalalignment='top',) + +plt.show() diff --git a/Matplotlib Official Primer/Annotations/Annotation basics2.py b/Matplotlib Official Primer/Annotations/Annotation basics2.py new file mode 100644 index 00000000..eaa10cdc --- /dev/null +++ b/Matplotlib Official Primer/Annotations/Annotation basics2.py @@ -0,0 +1,16 @@ +import numpy as np +import matplotlib.pyplot as plt + +# Define the data for an exponentially decaying curve and plot it. +t = np.linspace(0.0, 5.0, 100) +y = np.sin(2 * np.pi * t) * np.exp(-t/2) +plt.plot(t, y, 'm') + +plt.annotate('local max', xy=(1.3, 0.6), xycoords='data', + xytext=(2.8, 0.7), textcoords='data', + arrowprops=dict(facecolor='black', shrink=0.05), + horizontalalignment='center', verticalalignment='bottom',) + +plt.show() + +# Reference: https://matplotlib.org/stable/tutorials/text/annotations.html#sphx-glr-tutorials-text-annotations-py diff --git a/Matplotlib Official Primer/Annotations/Bachelor's degrees by gender.py b/Matplotlib Official Primer/Annotations/Bachelor's degrees by gender.py new file mode 100644 index 00000000..50c5c015 --- /dev/null +++ b/Matplotlib Official Primer/Annotations/Bachelor's degrees by gender.py @@ -0,0 +1,106 @@ +import numpy as np +import matplotlib.pyplot as plt +from matplotlib.cbook import get_sample_data + + +fname = get_sample_data('percent_bachelors_degrees_women_usa.csv', + asfileobj=False) +gender_degree_data = np.genfromtxt(fname, delimiter=',', names=True) + +# You typically want your plot to be ~1.33x wider than tall. This plot +# is a rare exception because of the number of lines being plotted on it. +# Common sizes: (10, 7.5) and (12, 9) +fig, ax = plt.subplots(1, 1, figsize=(12, 14)) + +# These are the colors that will be used in the plot +ax.set_prop_cycle(color=[ + '#1f77b4', '#aec7e8', '#ff7f0e', '#ffbb78', '#2ca02c', '#98df8a', + '#d62728', '#ff9896', '#9467bd', '#c5b0d5', '#8c564b', '#c49c94', + '#e377c2', '#f7b6d2', '#7f7f7f', '#c7c7c7', '#bcbd22', '#dbdb8d', + '#17becf', '#9edae5']) + +# Remove the plot frame lines. They are unnecessary here. +ax.spines[:].set_visible(False) + +# Ensure that the axis ticks only show up on the bottom and left of the plot. +# Ticks on the right and top of the plot are generally unnecessary. +ax.xaxis.tick_bottom() +ax.yaxis.tick_left() + +fig.subplots_adjust(left=.06, right=.75, bottom=.02, top=.94) +# Limit the range of the plot to only where the data is. +# Avoid unnecessary whitespace. +ax.set_xlim(1969.5, 2011.1) +ax.set_ylim(-0.25, 90) + +# Set a fixed location and format for ticks. +ax.set_xticks(range(1970, 2011, 10)) +ax.set_yticks(range(0, 91, 10)) + +# Use automatic StrMethodFormatter creation +ax.xaxis.set_major_formatter('{x:.0f}') +ax.yaxis.set_major_formatter('{x:.0f}%') + +# Provide tick lines across the plot to help your viewers trace along +# the axis ticks. Make sure that the lines are light and small so they +# don't obscure the primary data lines. +ax.grid(True, 'major', 'y', ls='--', lw=.5, c='k', alpha=.3) + +# Remove the tick marks; they are unnecessary with the tick lines we just +# plotted. Make sure your axis ticks are large enough to be easily read. +# You don't want your viewers squinting to read your plot. +ax.tick_params(axis='both', which='both', labelsize=14, + bottom=False, top=False, labelbottom=True, + left=False, right=False, labelleft=True) + +# Now that the plot is prepared, it's time to actually plot the data! +# Note that I plotted the majors in order of the highest % in the final year. +majors = ['Health Professions', 'Public Administration', 'Education', + 'Psychology', 'Foreign Languages', 'English', + 'Communications\nand Journalism', 'Art and Performance', 'Biology', + 'Agriculture', 'Social Sciences and History', 'Business', + 'Math and Statistics', 'Architecture', 'Physical Sciences', + 'Computer Science', 'Engineering'] + +y_offsets = {'Foreign Languages': 0.5, 'English': -0.5, + 'Communications\nand Journalism': 0.75, + 'Art and Performance': -0.25, 'Agriculture': 1.25, + 'Social Sciences and History': 0.25, 'Business': -0.75, + 'Math and Statistics': 0.75, 'Architecture': -0.75, + 'Computer Science': 0.75, 'Engineering': -0.25} + +for column in majors: + + # Plot each line separately with its own color. + column_rec_name = column.replace('\n', '_').replace(' ', '_') + + line, = ax.plot('Year', column_rec_name, data=gender_degree_data, + lw=2.5) + + # Add a text label to the right end of every line. Most of the code below + # is adding specific offsets y position because some labels overlapped. + y_pos = gender_degree_data[column_rec_name][-1] - 0.5 + + if column in y_offsets: + y_pos += y_offsets[column] + + # Again, make sure that all labels are large enough to be easily read + # by the viewer. + ax.text(2011.5, y_pos, column, fontsize=14, color=line.get_color()) + +# Make the title big enough so it spans the entire plot, but don't make it +# so big that it requires two lines to show. + +# Note that if the title is descriptive enough, it is unnecessary to include +# axis labels; they are self-evident, in this plot's case. +fig.suptitle("Percentage of Bachelor's degrees conferred to women in " + "the U.S.A. by major (1970-2011)", fontsize=18, ha="center") + +# Finally, save the figure as a PNG. +# You can also save it as a PDF, JPEG, etc. +# Just change the file extension in this call. +# fig.savefig('percent-bachelors-degrees-women-usa.png', bbox_inches='tight') +plt.show() + +# Source: +# https://matplotlib.org/stable/gallery/showcase/bachelors_degrees_by_gender.html#sphx-glr-gallery-showcase-bachelors-degrees-by-gender-py diff --git a/Matplotlib Official Primer/Annotations/Customizing_arrow_and_bubble_styles.py b/Matplotlib Official Primer/Annotations/Customizing_arrow_and_bubble_styles.py new file mode 100644 index 00000000..95d89e30 --- /dev/null +++ b/Matplotlib Official Primer/Annotations/Customizing_arrow_and_bubble_styles.py @@ -0,0 +1,149 @@ +import matplotlib.pyplot as plt +from matplotlib.patches import Ellipse +import numpy as np +from matplotlib.text import OffsetFrom + +fig, ax = plt.subplots(figsize=(8, 5)) + +t = np.arange(0.0, 5.0, 0.01) +s = np.cos(2*np.pi*t) +line, = ax.plot(t, s, lw=3) + +ax.annotate( + 'straight', + xy=(0, 1), xycoords='data', + xytext=(-50, 30), textcoords='offset points', + arrowprops=dict(arrowstyle="->")) +ax.annotate( + 'arc3,\nrad 0.2', + xy=(0.5, -1), xycoords='data', + xytext=(-80, -60), textcoords='offset points', + arrowprops=dict(arrowstyle="->", + connectionstyle="arc3,rad=.2")) +ax.annotate( + 'arc,\nangle 50', + xy=(1., 1), xycoords='data', + xytext=(-90, 50), textcoords='offset points', + arrowprops=dict(arrowstyle="->", + connectionstyle="arc,angleA=0,armA=50,rad=10")) +ax.annotate( + 'arc,\narms', + xy=(1.5, -1), xycoords='data', + xytext=(-80, -60), textcoords='offset points', + arrowprops=dict( + arrowstyle="->", + connectionstyle="arc,angleA=0,armA=40,angleB=-90,armB=30,rad=7")) +ax.annotate( + 'angle,\nangle 90', + xy=(2., 1), xycoords='data', + xytext=(-70, 30), textcoords='offset points', + arrowprops=dict(arrowstyle="->", + connectionstyle="angle,angleA=0,angleB=90,rad=10")) +ax.annotate( + 'angle3,\nangle -90', + xy=(2.5, -1), xycoords='data', + xytext=(-80, -60), textcoords='offset points', + arrowprops=dict(arrowstyle="->", + connectionstyle="angle3,angleA=0,angleB=-90")) +ax.annotate( + 'angle,\nround', + xy=(3., 1), xycoords='data', + xytext=(-60, 30), textcoords='offset points', + bbox=dict(boxstyle="round", fc="0.8"), + arrowprops=dict(arrowstyle="->", + connectionstyle="angle,angleA=0,angleB=90,rad=10")) +ax.annotate( + 'angle,\nround4', + xy=(3.5, -1), xycoords='data', + xytext=(-70, -80), textcoords='offset points', + size=20, + bbox=dict(boxstyle="round4,pad=.5", fc="0.8"), + arrowprops=dict(arrowstyle="->", + connectionstyle="angle,angleA=0,angleB=-90,rad=10")) +ax.annotate( + 'angle,\nshrink', + xy=(4., 1), xycoords='data', + xytext=(-60, 30), textcoords='offset points', + bbox=dict(boxstyle="round", fc="0.8"), + arrowprops=dict(arrowstyle="->", + shrinkA=0, shrinkB=10, + connectionstyle="angle,angleA=0,angleB=90,rad=10")) +# You can pass an empty string to get only annotation arrows rendered +ax.annotate('', xy=(4., 1.), xycoords='data', + xytext=(4.5, -1), textcoords='data', + arrowprops=dict(arrowstyle="<->", + connectionstyle="bar", + ec="k", + shrinkA=5, shrinkB=5)) + +ax.set(xlim=(-1, 5), ylim=(-4, 3)) + +# We'll create another figure so that it doesn't get too cluttered +fig, ax = plt.subplots() + +el = Ellipse((2, -1), 0.5, 0.5) +ax.add_patch(el) + +ax.annotate('$->$', + xy=(2., -1), xycoords='data', + xytext=(-150, -140), textcoords='offset points', + bbox=dict(boxstyle="round", fc="0.8"), + arrowprops=dict(arrowstyle="->", + patchB=el, + connectionstyle="angle,angleA=90,angleB=0,rad=10")) +ax.annotate('arrow\nfancy', + xy=(2., -1), xycoords='data', + xytext=(-100, 60), textcoords='offset points', + size=20, + # bbox=dict(boxstyle="round", fc="0.8"), + arrowprops=dict(arrowstyle="fancy", + fc="0.6", ec="none", + patchB=el, + connectionstyle="angle3,angleA=0,angleB=-90")) +ax.annotate('arrow\nsimple', + xy=(2., -1), xycoords='data', + xytext=(100, 60), textcoords='offset points', + size=20, + # bbox=dict(boxstyle="round", fc="0.8"), + arrowprops=dict(arrowstyle="simple", + fc="0.6", ec="none", + patchB=el, + connectionstyle="arc3,rad=0.3")) +ax.annotate('wedge', + xy=(2., -1), xycoords='data', + xytext=(-100, -100), textcoords='offset points', + size=20, + # bbox=dict(boxstyle="round", fc="0.8"), + arrowprops=dict(arrowstyle="wedge,tail_width=0.7", + fc="0.6", ec="none", + patchB=el, + connectionstyle="arc3,rad=-0.3")) +ax.annotate('bubble,\ncontours', + xy=(2., -1), xycoords='data', + xytext=(0, -70), textcoords='offset points', + size=20, + bbox=dict(boxstyle="round", + fc=(1.0, 0.7, 0.7), + ec=(1., .5, .5)), + arrowprops=dict(arrowstyle="wedge,tail_width=1.", + fc=(1.0, 0.7, 0.7), ec=(1., .5, .5), + patchA=None, + patchB=el, + relpos=(0.2, 0.8), + connectionstyle="arc3,rad=-0.1")) +ax.annotate('bubble', + xy=(2., -1), xycoords='data', + xytext=(55, 0), textcoords='offset points', + size=20, va="center", + bbox=dict(boxstyle="round", fc=(1.0, 0.7, 0.7), ec="none"), + arrowprops=dict(arrowstyle="wedge,tail_width=1.", + fc=(1.0, 0.7, 0.7), ec="none", + patchA=None, + patchB=el, + relpos=(0.2, 0.5))) + +ax.set(xlim=(-1, 5), ylim=(-5, 3)) + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/text_labels_and_annotations/annotation_demo.html#customizing-arrow-and-bubble-styles diff --git a/Matplotlib Official Primer/Annotations/Labeling a pie and a donut.py b/Matplotlib Official Primer/Annotations/Labeling a pie and a donut.py new file mode 100644 index 00000000..bde31d4a --- /dev/null +++ b/Matplotlib Official Primer/Annotations/Labeling a pie and a donut.py @@ -0,0 +1,36 @@ +import numpy as np +import matplotlib.pyplot as plt + +fig, ax = plt.subplots(figsize=(6, 3), subplot_kw=dict(aspect="equal")) + +recipe = ["225 g flour", + "90 g sugar", + "1 egg", + "60 g butter", + "100 ml milk", + "1/2 package of yeast"] + +data = [225, 90, 50, 60, 100, 5] + +wedges, texts = ax.pie(data, wedgeprops=dict(width=0.5), startangle=-40) + +bbox_props = dict(boxstyle="square,pad=0.3", fc="w", ec="k", lw=0.72) +kw = dict(arrowprops=dict(arrowstyle="-"), + bbox=bbox_props, zorder=0, va="center") + +for i, p in enumerate(wedges): + ang = (p.theta2 - p.theta1)/2. + p.theta1 + y = np.sin(np.deg2rad(ang)) + x = np.cos(np.deg2rad(ang)) + horizontalalignment = {-1: "right", 1: "left"}[int(np.sign(x))] + connectionstyle = "angle,angleA=0,angleB={}".format(ang) + kw["arrowprops"].update({"connectionstyle": connectionstyle}) + ax.annotate(recipe[i], xy=(x, y), xytext=(1.35*np.sign(x), 1.4*y), + horizontalalignment=horizontalalignment, **kw) + +ax.set_title("Matplotlib bakery: A donut") + +plt.show() + +# Source: +# https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py diff --git a/Matplotlib Official Primer/Annotations/More examples of coordinate systems.py b/Matplotlib Official Primer/Annotations/More examples of coordinate systems.py new file mode 100644 index 00000000..f81ea714 --- /dev/null +++ b/Matplotlib Official Primer/Annotations/More examples of coordinate systems.py @@ -0,0 +1,93 @@ +import matplotlib.pyplot as plt +from matplotlib.patches import Ellipse +import numpy as np +from matplotlib.text import OffsetFrom + +fig, (ax1, ax2) = plt.subplots(1, 2) + +bbox_args = dict(boxstyle="round", fc="0.8") +arrow_args = dict(arrowstyle="->") + +# Here we'll demonstrate the extents of the coordinate system and how +# we place annotating text. + +ax1.annotate('figure fraction : 0, 0', xy=(0, 0), xycoords='figure fraction', + xytext=(20, 20), textcoords='offset points', + ha="left", va="bottom", + bbox=bbox_args, + arrowprops=arrow_args) + +ax1.annotate('figure fraction : 1, 1', xy=(1, 1), xycoords='figure fraction', + xytext=(-20, -20), textcoords='offset points', + ha="right", va="top", + bbox=bbox_args, + arrowprops=arrow_args) + +ax1.annotate('axes fraction : 0, 0', xy=(0, 0), xycoords='axes fraction', + xytext=(20, 20), textcoords='offset points', + ha="left", va="bottom", + bbox=bbox_args, + arrowprops=arrow_args) + +ax1.annotate('axes fraction : 1, 1', xy=(1, 1), xycoords='axes fraction', + xytext=(-20, -20), textcoords='offset points', + ha="right", va="top", + bbox=bbox_args, + arrowprops=arrow_args) + +# It is also possible to generate draggable annotations + +an1 = ax1.annotate('Drag me 1', xy=(.5, .7), xycoords='data', + #xytext=(.5, .7), textcoords='data', + ha="center", va="center", + bbox=bbox_args, + #arrowprops=arrow_args + ) + +an2 = ax1.annotate('Drag me 2', xy=(.5, .5), xycoords=an1, + xytext=(.5, .3), textcoords='axes fraction', + ha="center", va="center", + bbox=bbox_args, + arrowprops=dict(patchB=an1.get_bbox_patch(), + connectionstyle="arc3,rad=0.2", + **arrow_args)) +an1.draggable() +an2.draggable() + +an3 = ax1.annotate('', xy=(.5, .5), xycoords=an2, + xytext=(.5, .5), textcoords=an1, + ha="center", va="center", + bbox=bbox_args, + arrowprops=dict(patchA=an1.get_bbox_patch(), + patchB=an2.get_bbox_patch(), + connectionstyle="arc3,rad=0.2", + **arrow_args)) + +# Finally we'll show off some more complex annotation and placement + +text = ax2.annotate('xy=(0, 1)\nxycoords=("data", "axes fraction")', + xy=(0, 1), xycoords=("data", 'axes fraction'), + xytext=(0, -20), textcoords='offset points', + ha="center", va="top", + bbox=bbox_args, + arrowprops=arrow_args) + +ax2.annotate('xy=(0.5, 0)\nxycoords=artist', + xy=(0.5, 0.), xycoords=text, + xytext=(0, -20), textcoords='offset points', + ha="center", va="top", + bbox=bbox_args, + arrowprops=arrow_args) + +ax2.annotate('xy=(0.8, 0.5)\nxycoords=ax1.transData', + xy=(0.8, 0.5), xycoords=ax1.transData, + xytext=(10, 10), + textcoords=OffsetFrom(ax2.bbox, (0, 0), "points"), + ha="left", va="bottom", + bbox=bbox_args, + arrowprops=arrow_args) + +ax2.set(xlim=[-2, 2], ylim=[-2, 2]) +plt.show() + +# Source: https://matplotlib.org/stable/gallery/text_labels_and_annotations/annotation_demo.html#more-examples-of-coordinate-systems diff --git a/Matplotlib Official Primer/Annotations/Placing text boxes.py b/Matplotlib Official Primer/Annotations/Placing text boxes.py new file mode 100644 index 00000000..8ed9ad4a --- /dev/null +++ b/Matplotlib Official Primer/Annotations/Placing text boxes.py @@ -0,0 +1,27 @@ +import numpy as np +import matplotlib.pyplot as plt + +np.random.seed(19680801) + +fig, ax = plt.subplots() +x = 30*np.random.randn(10000) +mu = x.mean() +median = np.median(x) +sigma = x.std() +textstr = '\n'.join(( + r'$\mu=%.2f$' % (mu, ), + r'$\mathrm{median}=%.2f$' % (median, ), + r'$\sigma=%.2f$' % (sigma, ))) + +ax.hist(x, 50) +# these are matplotlib.patch.Patch properties +props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) + +# place a text box in upper left in axes coords +ax.text(0.05, 0.95, textstr, transform=ax.transAxes, fontsize=14, + verticalalignment='top', bbox=props) + +plt.show() + +# Reference: +# https://matplotlib.org/stable/gallery/text_labels_and_annotations/placing_text_boxes.html#sphx-glr-gallery-text-labels-and-annotations-placing-text-boxes-py diff --git a/Matplotlib Official Primer/Annotations/__init__.py b/Matplotlib Official Primer/Annotations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Matplotlib Official Primer/Annotations/annotate().py b/Matplotlib Official Primer/Annotations/annotate().py new file mode 100644 index 00000000..0fdef487 --- /dev/null +++ b/Matplotlib Official Primer/Annotations/annotate().py @@ -0,0 +1,2 @@ +# Reference: +# https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.annotate.html#matplotlib.axes.Axes.annotate \ No newline at end of file diff --git a/Matplotlib Official Primer/Annotations/text.py b/Matplotlib Official Primer/Annotations/text.py new file mode 100644 index 00000000..0a40ca0a --- /dev/null +++ b/Matplotlib Official Primer/Annotations/text.py @@ -0,0 +1,36 @@ +import matplotlib +import matplotlib.pyplot as plt + +fig = plt.figure() +ax = fig.add_subplot() +fig.subplots_adjust(top=0.85) + +# Set titles for the figure and the subplot respectively +fig.suptitle('bold figure suptitle', fontsize=14, fontweight='bold') +ax.set_title('axes title') + +ax.set_xlabel('xlabel') +ax.set_ylabel('ylabel') + +# Set both x- and y-axis limits to [0, 10] instead of default [0, 1] +ax.axis([0, 10, 0, 10]) + +ax.text(3, 8, 'boxed italics text in data coords', style='italic', + bbox={'facecolor': 'red', 'alpha': 0.5, 'pad': 10}) + +ax.text(2, 6, r'an equation: $E=mc^2$', fontsize=15) + +ax.text(3, 2, 'unicode: Institut f羹r Festk繹rperphysik') + +ax.text(0.95, 0.01, 'colored text in axes coords', + verticalalignment='bottom', horizontalalignment='right', + transform=ax.transAxes, + color='green', fontsize=15) + +ax.plot([2], [1], 'o') +ax.annotate('annotate', xy=(2, 1), xytext=(3, 4), + arrowprops=dict(facecolor='black', shrink=0.05)) + +plt.show() + +# Source: https://matplotlib.org/stable/tutorials/text/text_intro.html diff --git a/Matplotlib Official Primer/Bar Label Demo 1.jpg b/Matplotlib Official Primer/Bar Label Demo 1.jpg new file mode 100644 index 00000000..6b96eb97 Binary files /dev/null and b/Matplotlib Official Primer/Bar Label Demo 1.jpg differ diff --git a/Matplotlib Official Primer/Bar Label Demo 1.py b/Matplotlib Official Primer/Bar Label Demo 1.py new file mode 100644 index 00000000..eb516c4f --- /dev/null +++ b/Matplotlib Official Primer/Bar Label Demo 1.py @@ -0,0 +1,34 @@ +import matplotlib.pyplot as plt +import numpy as np + +N = 5 +menMeans = (20, 35, 30, 35, -27) +womenMeans = (25, 32, 34, 20, -25) +menStd = (2, 3, 4, 1, 2) +womenStd = (3, 5, 2, 3, 3) +ind = np.arange(N) # the x locations for the groups +width = 0.35 # the width of the bars: can also be len(x) sequence + +fig, ax = plt.subplots() + +p1 = ax.bar(ind, menMeans, width, yerr=menStd, label='Men') +p2 = ax.bar(ind, womenMeans, width, + bottom=menMeans, yerr=womenStd, label='Women') + +ax.axhline(0, color='grey', linewidth=0.8) +ax.set_ylabel('Scores') +ax.set_title('Scores by group and gender') +ax.set_xticks(ind) +ax.set_xticklabels(('G1', 'G2', 'G3', 'G4', 'G5')) +ax.legend() + +# Label with label_type 'center' instead of the default 'edge' +ax.bar_label(p1, label_type='center') +ax.bar_label(p2, label_type='center') +ax.bar_label(p2) + +plt.savefig('Bar Label Demo 1.jpg') + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html?highlight=stack#bar-label-demo diff --git a/Matplotlib Official Primer/Bar Label Demo 2.py b/Matplotlib Official Primer/Bar Label Demo 2.py new file mode 100644 index 00000000..cef1eda6 --- /dev/null +++ b/Matplotlib Official Primer/Bar Label Demo 2.py @@ -0,0 +1,28 @@ +import matplotlib.pyplot as plt +import numpy as np + +# Fixing random state for reproducibility +np.random.seed(19680801) + +# Example data +people = ('Tom', 'Dick', 'Harry', 'Slim', 'Jim') +y_pos = np.arange(len(people)) +performance = 3 + 10 * np.random.rand(len(people)) +error = np.random.rand(len(people)) + +fig, ax = plt.subplots() + +hbars = ax.barh(y_pos, performance, xerr=error, align='center') +ax.set_yticks(y_pos) +ax.set_yticklabels(people) +ax.invert_yaxis() # labels read top-to-bottom +ax.set_xlabel('Performance') +ax.set_title('How fast do you want to go today?') + +# Label with specially formatted floats +ax.bar_label(hbars, fmt='%.2f') +ax.set_xlim(right=15) # adjust xlim to fit labels + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html?highlight=stack#bar-label-demo diff --git a/Matplotlib Official Primer/Bar Label Demo 3.py b/Matplotlib Official Primer/Bar Label Demo 3.py new file mode 100644 index 00000000..600bd718 --- /dev/null +++ b/Matplotlib Official Primer/Bar Label Demo 3.py @@ -0,0 +1,29 @@ +import matplotlib.pyplot as plt +import numpy as np + +# Fixing random state for reproducibility +np.random.seed(19680801) + +# Example data +people = ('Tom', 'Dick', 'Harry', 'Slim', 'Jim') +y_pos = np.arange(len(people)) +performance = 3 + 10 * np.random.rand(len(people)) +error = np.random.rand(len(people)) + +fig, ax = plt.subplots() + +hbars = ax.barh(y_pos, performance, xerr=error, align='center') +ax.set_yticks(y_pos) +ax.set_yticklabels(people) +ax.invert_yaxis() # labels read top-to-bottom +ax.set_xlabel('Performance') +ax.set_title('How fast do you want to go today?') + +# Label with given captions, custom padding and annotate options +ax.bar_label(hbars, labels=['簣%.2f' % e for e in error], + padding=8, color='b', fontsize=14) +ax.set_xlim(right=16) + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html?highlight=stack#bar-label-demo diff --git a/Matplotlib Official Primer/Bar Label Demo.py b/Matplotlib Official Primer/Bar Label Demo.py new file mode 100644 index 00000000..35e67d51 --- /dev/null +++ b/Matplotlib Official Primer/Bar Label Demo.py @@ -0,0 +1,32 @@ +import matplotlib.pyplot as plt +import numpy as np + +N = 5 +menMeans = (20, 35, 30, 35, -27) +womenMeans = (25, 32, 34, 20, -25) +menStd = (2, 3, 4, 1, 2) +womenStd = (3, 5, 2, 3, 3) +ind = np.arange(N) # the x locations for the groups +width = 0.35 # the width of the bars: can also be len(x) sequence + +fig, ax = plt.subplots() + +p1 = ax.bar(ind, menMeans, width, yerr=menStd, label='Men') +p2 = ax.bar(ind, womenMeans, width, + bottom=menMeans, yerr=womenStd, label='Women') + +ax.axhline(0, color='grey', linewidth=0.8) +ax.set_ylabel('Scores') +ax.set_title('Scores by group and gender') +ax.set_xticks(ind) +ax.set_xticklabels(('G1', 'G2', 'G3', 'G4', 'G5')) +ax.legend() + +# Label with label_type 'center' instead of the default 'edge' +ax.bar_label(p1, label_type='center') +ax.bar_label(p2, label_type='center') +ax.bar_label(p2) + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html?highlight=stack#bar-label-demo diff --git a/Matplotlib Official Primer/Bar chart on polar axis.py b/Matplotlib Official Primer/Bar chart on polar axis.py new file mode 100644 index 00000000..2131539c --- /dev/null +++ b/Matplotlib Official Primer/Bar chart on polar axis.py @@ -0,0 +1,20 @@ +import numpy as np +import matplotlib.pyplot as plt + + +# Fixing random state for reproducibility +np.random.seed(19680801) + +# Compute pie slices +N = 20 +theta = np.linspace(0.0, 2 * np.pi, N, endpoint=False) +radii = 10 * np.random.rand(N) +width = np.pi / 4 * np.random.rand(N) +colors = plt.cm.viridis(radii / 10.) + +ax = plt.subplot(projection='polar') +ax.bar(theta, radii, width=width, bottom=0.0, color=colors, alpha=0.5) + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/pie_and_polar_charts/polar_bar.html#sphx-glr-gallery-pie-and-polar-charts-polar-bar-py diff --git a/Matplotlib Official Primer/Bar label 2.jpg b/Matplotlib Official Primer/Bar label 2.jpg new file mode 100644 index 00000000..e46620c4 Binary files /dev/null and b/Matplotlib Official Primer/Bar label 2.jpg differ diff --git a/Matplotlib Official Primer/Bar label 2.py b/Matplotlib Official Primer/Bar label 2.py new file mode 100644 index 00000000..c7de6b4d --- /dev/null +++ b/Matplotlib Official Primer/Bar label 2.py @@ -0,0 +1,31 @@ +import matplotlib.pyplot as plt +import numpy as np + +N = 5 +menMeans = (20, 35, 30, 35, -27) +womenMeans = (25, 32, 34, 20, -25) +menStd = (2, 3, 4, 1, 2) +womenStd = (3, 5, 2, 3, 3) +ind = np.arange(N) # the x locations for the groups +width = 0.35 # the width of the bars: can also be len(x) sequence + +fig, ax = plt.subplots() + +p1 = ax.bar(ind, menMeans, width, yerr=menStd, label='Men') +p2 = ax.bar(ind, womenMeans, width, bottom=menMeans, yerr=womenStd, label='Women') + +ax.axhline(0, color='grey', linewidth=0.8) +ax.set_ylabel('Scores') +ax.set_title('Scores by group and gender') +ax.set_xticks(ind) +ax.set_xticklabels(('G1', 'G2', 'G3', 'G4', 'G5')) +ax.legend() + +# Label with label_type 'center' instead of the default 'edge' +ax.bar_label(p1, label_type='center') +# ax.bar_label(p2, label_type='center') +ax.bar_label(p2) + +plt.savefig('Bar label 2.jpg') + +plt.show() diff --git a/Matplotlib Official Primer/Bar label 3.jpg b/Matplotlib Official Primer/Bar label 3.jpg new file mode 100644 index 00000000..943c8884 Binary files /dev/null and b/Matplotlib Official Primer/Bar label 3.jpg differ diff --git a/Matplotlib Official Primer/Bar label 3.py b/Matplotlib Official Primer/Bar label 3.py new file mode 100644 index 00000000..ed694b83 --- /dev/null +++ b/Matplotlib Official Primer/Bar label 3.py @@ -0,0 +1,32 @@ +import matplotlib.pyplot as plt +import numpy as np + +N = 5 +menMeans = (20, 35, 30, 35, -27) +womenMeans = (25, 32, 34, 20, -25) +menStd = (2, 3, 4, 1, 2) +womenStd = (3, 5, 2, 3, 3) +ind = np.arange(N) # the x locations for the groups +width = 0.35 # the width of the bars: can also be len(x) sequence + +fig, ax = plt.subplots() + +p1 = ax.bar(ind, menMeans, width, yerr=menStd, label='Men') +p2 = ax.bar(ind, womenMeans, width, + bottom=menMeans, yerr=womenStd, label='Women') + +ax.axhline(0, color='grey', linewidth=0.8) +ax.set_ylabel('Scores') +ax.set_title('Scores by group and gender') +ax.set_xticks(ind) +ax.set_xticklabels(('G1', 'G2', 'G3', 'G4', 'G5')) +ax.legend() + +# Label with label_type 'center' instead of the default 'edge' +# ax.bar_label(p1, label_type='center') +ax.bar_label(p2, label_type='center') +ax.bar_label(p2) + +plt.savefig('Bar label 3.jpg') + +plt.show() diff --git a/Matplotlib Official Primer/Bar label.jpg b/Matplotlib Official Primer/Bar label.jpg new file mode 100644 index 00000000..77d2f8c0 Binary files /dev/null and b/Matplotlib Official Primer/Bar label.jpg differ diff --git a/Matplotlib Official Primer/Bar label.py b/Matplotlib Official Primer/Bar label.py new file mode 100644 index 00000000..5b76a806 --- /dev/null +++ b/Matplotlib Official Primer/Bar label.py @@ -0,0 +1,32 @@ +import matplotlib.pyplot as plt +import numpy as np + +N = 5 +menMeans = (20, 35, 30, 35, -27) +womenMeans = (25, 32, 34, 20, -25) +menStd = (2, 3, 4, 1, 2) +womenStd = (3, 5, 2, 3, 3) +ind = np.arange(N) # the x locations for the groups +width = 0.35 # the width of the bars: can also be len(x) sequence + +fig, ax = plt.subplots() + +p1 = ax.bar(ind, menMeans, width, yerr=menStd, label='Men') +p2 = ax.bar(ind, womenMeans, width, + bottom=menMeans, yerr=womenStd, label='Women') + +ax.axhline(0, color='grey', linewidth=0.8) +ax.set_ylabel('Scores') +ax.set_title('Scores by group and gender') +ax.set_xticks(ind) +ax.set_xticklabels(('G1', 'G2', 'G3', 'G4', 'G5')) +ax.legend() + +# Label with label_type 'center' instead of the default 'edge' +ax.bar_label(p1, label_type='center') +ax.bar_label(p2, label_type='center') +# ax.bar_label(p2) + +plt.savefig('Bar label.jpg') + +plt.show() diff --git a/Matplotlib Official Primer/Bar_label().py b/Matplotlib Official Primer/Bar_label().py new file mode 100644 index 00000000..7c21629a --- /dev/null +++ b/Matplotlib Official Primer/Bar_label().py @@ -0,0 +1,2 @@ +# Reference: +# https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bar_label.html#matplotlib.axes.Axes.bar_label \ No newline at end of file diff --git a/Matplotlib Official Primer/Bar_of_pie.py b/Matplotlib Official Primer/Bar_of_pie.py new file mode 100644 index 00000000..fc37d17d --- /dev/null +++ b/Matplotlib Official Primer/Bar_of_pie.py @@ -0,0 +1,65 @@ +import matplotlib.pyplot as plt +from matplotlib.patches import ConnectionPatch +import numpy as np + +# make figure and assign axis objects +fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(9, 5)) +fig.subplots_adjust(wspace=0) + +# pie chart parameters +ratios = [.27, .56, .17] +labels = ['Approve', 'Disapprove', 'Undecided'] +explode = [0.1, 0, 0] +# rotate so that first wedge is split by the x-axis +angle = -180 * ratios[0] +ax1.pie(ratios, autopct='%1.1f%%', startangle=angle, + labels=labels, explode=explode) + +# bar chart parameters + +xpos = 0 +bottom = 0 +ratios = [.33, .54, .07, .06] +width = .2 +colors = [[.1, .3, .5], [.1, .3, .3], [.1, .3, .7], [.1, .3, .9]] + +for j in range(len(ratios)): + height = ratios[j] + ax2.bar(xpos, height, width, bottom=bottom, color=colors[j]) + ypos = bottom + ax2.patches[j].get_height() / 2 + bottom += height + ax2.text(xpos, ypos, "%d%%" % (ax2.patches[j].get_height() * 100), + ha='center') + +ax2.set_title('Age of approvers') +ax2.legend(('50-65', 'Over 65', '35-49', 'Under 35')) +ax2.axis('off') +ax2.set_xlim(- 2.5 * width, 2.5 * width) + +# use ConnectionPatch to draw lines between the two plots +# get the wedge data +theta1, theta2 = ax1.patches[0].theta1, ax1.patches[0].theta2 +center, r = ax1.patches[0].center, ax1.patches[0].r +bar_height = sum([item.get_height() for item in ax2.patches]) + +# draw top connecting line +x = r * np.cos(np.pi / 180 * theta2) + center[0] +y = r * np.sin(np.pi / 180 * theta2) + center[1] +con = ConnectionPatch(xyA=(-width / 2, bar_height), coordsA=ax2.transData, + xyB=(x, y), coordsB=ax1.transData) +con.set_color([0, 0, 0]) +con.set_linewidth(4) +ax2.add_artist(con) + +# draw bottom connecting line +x = r * np.cos(np.pi / 180 * theta1) + center[0] +y = r * np.sin(np.pi / 180 * theta1) + center[1] +con = ConnectionPatch(xyA=(-width / 2, 0), coordsA=ax2.transData, + xyB=(x, y), coordsB=ax1.transData) +con.set_color([0, 0, 0]) +ax2.add_artist(con) +con.set_linewidth(4) + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/pie_and_polar_charts/bar_of_pie.html#sphx-glr-gallery-pie-and-polar-charts-bar-of-pie-py diff --git a/Matplotlib Official Primer/Basic text commands.py b/Matplotlib Official Primer/Basic text commands.py new file mode 100644 index 00000000..0a40ca0a --- /dev/null +++ b/Matplotlib Official Primer/Basic text commands.py @@ -0,0 +1,36 @@ +import matplotlib +import matplotlib.pyplot as plt + +fig = plt.figure() +ax = fig.add_subplot() +fig.subplots_adjust(top=0.85) + +# Set titles for the figure and the subplot respectively +fig.suptitle('bold figure suptitle', fontsize=14, fontweight='bold') +ax.set_title('axes title') + +ax.set_xlabel('xlabel') +ax.set_ylabel('ylabel') + +# Set both x- and y-axis limits to [0, 10] instead of default [0, 1] +ax.axis([0, 10, 0, 10]) + +ax.text(3, 8, 'boxed italics text in data coords', style='italic', + bbox={'facecolor': 'red', 'alpha': 0.5, 'pad': 10}) + +ax.text(2, 6, r'an equation: $E=mc^2$', fontsize=15) + +ax.text(3, 2, 'unicode: Institut f羹r Festk繹rperphysik') + +ax.text(0.95, 0.01, 'colored text in axes coords', + verticalalignment='bottom', horizontalalignment='right', + transform=ax.transAxes, + color='green', fontsize=15) + +ax.plot([2], [1], 'o') +ax.annotate('annotate', xy=(2, 1), xytext=(3, 4), + arrowprops=dict(facecolor='black', shrink=0.05)) + +plt.show() + +# Source: https://matplotlib.org/stable/tutorials/text/text_intro.html diff --git a/Matplotlib Official Primer/Broken Barh.py b/Matplotlib Official Primer/Broken Barh.py new file mode 100644 index 00000000..d72be407 --- /dev/null +++ b/Matplotlib Official Primer/Broken Barh.py @@ -0,0 +1,22 @@ +import matplotlib.pyplot as plt + +fig, ax = plt.subplots() +ax.broken_barh([(110, 30), (150, 10)], (10, 9), facecolors='tab:blue') +ax.broken_barh([(10, 50), (100, 20), (130, 10)], (20, 9), + facecolors=('tab:orange', 'tab:green', 'tab:red')) +ax.set_ylim(5, 35) +ax.set_xlim(0, 200) +ax.set_xlabel('seconds since start') +ax.set_yticks([15, 25]) +ax.set_yticklabels(['Bill', 'Jim']) +ax.grid(True) +ax.annotate('race interrupted', (61, 25), + xytext=(0.8, 0.9), textcoords='axes fraction', + arrowprops=dict(facecolor='black', shrink=0.05), + fontsize=16, + horizontalalignment='right', verticalalignment='top') + +plt.show() + +# Source: +# https://matplotlib.org/stable/gallery/lines_bars_and_markers/broken_barh.html#sphx-glr-gallery-lines-bars-and-markers-broken-barh-py diff --git a/Matplotlib Official Primer/Catalogs.py b/Matplotlib Official Primer/Catalogs.py new file mode 100644 index 00000000..aad4d34e --- /dev/null +++ b/Matplotlib Official Primer/Catalogs.py @@ -0,0 +1,8 @@ +# This gallery contains examples of the many things you can do with Matplotlib. +# Click on any image to see the full image and source code.[1] + +# Most of the examples use the object-oriented approach (except for the pyplot section).[2] + +# References: +# 1. https://matplotlib.org/stable/gallery/index.html#examples-index +# 2. https://matplotlib.org/stable/api/index.html diff --git a/Matplotlib Official Primer/Circles, Wedges and Polygons.py b/Matplotlib Official Primer/Circles, Wedges and Polygons.py new file mode 100644 index 00000000..3c0f2e12 --- /dev/null +++ b/Matplotlib Official Primer/Circles, Wedges and Polygons.py @@ -0,0 +1,51 @@ +import numpy as np +from matplotlib.patches import Circle, Wedge, Polygon +from matplotlib.collections import PatchCollection +import matplotlib.pyplot as plt + +# Fixing random state for reproducibility +np.random.seed(19680801) + + +fig, ax = plt.subplots() + +resolution = 50 # the number of vertices +N = 3 +x = np.random.rand(N) +y = np.random.rand(N) +radii = 0.1*np.random.rand(N) +patches = [] +for x1, y1, r in zip(x, y, radii): + circle = Circle((x1, y1), r) + patches.append(circle) + +x = np.random.rand(N) +y = np.random.rand(N) +radii = 0.1*np.random.rand(N) +theta1 = 360.0*np.random.rand(N) +theta2 = 360.0*np.random.rand(N) +for x1, y1, r, t1, t2 in zip(x, y, radii, theta1, theta2): + wedge = Wedge((x1, y1), r, t1, t2) + patches.append(wedge) + +# Some limiting conditions on Wedge +patches += [ + Wedge((.3, .7), .1, 0, 360), # Full circle + Wedge((.7, .8), .2, 0, 360, width=0.05), # Full ring + Wedge((.8, .3), .2, 0, 45), # Full sector + Wedge((.8, .3), .2, 45, 90, width=0.10), # Ring sector +] + +for i in range(N): + polygon = Polygon(np.random.rand(N, 2), True) + patches.append(polygon) + +colors = 100 * np.random.rand(len(patches)) +p = PatchCollection(patches, alpha=0.4) +p.set_array(colors) +ax.add_collection(p) +fig.colorbar(p, ax=ax) + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/shapes_and_collections/patch_collection.html#sphx-glr-gallery-shapes-and-collections-patch-collection-py diff --git a/Matplotlib Official Primer/Colorbar Tick Labelling.py b/Matplotlib Official Primer/Colorbar Tick Labelling.py new file mode 100644 index 00000000..97dee097 --- /dev/null +++ b/Matplotlib Official Primer/Colorbar Tick Labelling.py @@ -0,0 +1,23 @@ +import matplotlib.pyplot as plt +import numpy as np +from matplotlib import cm +from numpy.random import randn + + +# Fixing random state for reproducibility +np.random.seed(19680801) + +fig, ax = plt.subplots() + +data = np.clip(randn(250, 250), -1, 1) + +cax = ax.imshow(data, cmap=cm.coolwarm) +ax.set_title('Gaussian noise with vertical colorbar') + +# Add colorbar, make sure to specify tick locations to match desired ticklabels +cbar = fig.colorbar(cax, ticks=[-1, 0, 1]) +cbar.ax.set_yticklabels(['< -1', '0', '> 1']) # vertically oriented colorbar + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/ticks_and_spines/colorbar_tick_labelling_demo.html#sphx-glr-gallery-ticks-and-spines-colorbar-tick-labelling-demo-py diff --git a/Matplotlib Official Primer/Creating a timeline with lines, dates, and text.py b/Matplotlib Official Primer/Creating a timeline with lines, dates, and text.py new file mode 100644 index 00000000..257d3b39 --- /dev/null +++ b/Matplotlib Official Primer/Creating a timeline with lines, dates, and text.py @@ -0,0 +1,78 @@ +import matplotlib.pyplot as plt +import numpy as np +import matplotlib.dates as mdates +from datetime import datetime + +try: + # Try to fetch a list of Matplotlib releases and their dates + # from https://api.github.com/repos/matplotlib/matplotlib/releases + import urllib.request + import json + + url = 'https://api.github.com/repos/matplotlib/matplotlib/releases' + url += '?per_page=100' + data = json.loads(urllib.request.urlopen(url, timeout=.4).read().decode()) + + dates = [] + names = [] + for item in data: + if 'rc' not in item['tag_name'] and 'b' not in item['tag_name']: + dates.append(item['published_at'].split("T")[0]) + names.append(item['tag_name']) + # Convert date strings (e.g. 2014-10-18) to datetime + dates = [datetime.strptime(d, "%Y-%m-%d") for d in dates] + +except Exception: + # In case the above fails, e.g. because of missing internet connection + # use the following lists as fallback. + names = ['v2.2.4', 'v3.0.3', 'v3.0.2', 'v3.0.1', 'v3.0.0', 'v2.2.3', + 'v2.2.2', 'v2.2.1', 'v2.2.0', 'v2.1.2', 'v2.1.1', 'v2.1.0', + 'v2.0.2', 'v2.0.1', 'v2.0.0', 'v1.5.3', 'v1.5.2', 'v1.5.1', + 'v1.5.0', 'v1.4.3', 'v1.4.2', 'v1.4.1', 'v1.4.0'] + + dates = ['2019-02-26', '2019-02-26', '2018-11-10', '2018-11-10', + '2018-09-18', '2018-08-10', '2018-03-17', '2018-03-16', + '2018-03-06', '2018-01-18', '2017-12-10', '2017-10-07', + '2017-05-10', '2017-05-02', '2017-01-17', '2016-09-09', + '2016-07-03', '2016-01-10', '2015-10-29', '2015-02-16', + '2014-10-26', '2014-10-18', '2014-08-26'] + + # Convert date strings (e.g. 2014-10-18) to datetime + dates = [datetime.strptime(d, "%Y-%m-%d") for d in dates] + + + +# Choose some nice levels +levels = np.tile([-5, 5, -3, 3, -1, 1], + int(np.ceil(len(dates)/6)))[:len(dates)] + +# Create figure and plot a stem plot with the date +fig, ax = plt.subplots(figsize=(8.8, 4), constrained_layout=True) +ax.set(title="Matplotlib release dates") + +ax.vlines(dates, 0, levels, color="tab:red") # The vertical stems. +ax.plot(dates, np.zeros_like(dates), "-o", + color="k", markerfacecolor="w") # Baseline and markers on it. + +# annotate lines +for d, l, r in zip(dates, levels, names): + ax.annotate(r, xy=(d, l), + xytext=(-3, np.sign(l)*3), textcoords="offset points", + horizontalalignment="right", + verticalalignment="bottom" if l > 0 else "top") + +# format xaxis with 4 month intervals +ax.xaxis.set_major_locator(mdates.MonthLocator(interval=4)) +ax.xaxis.set_major_formatter(mdates.DateFormatter("%b %Y")) +plt.setp(ax.get_xticklabels(), rotation=30, ha="right") + +# remove y axis and spines +ax.yaxis.set_visible(False) +ax.spines[["left", "top", "right"]].set_visible(False) + +ax.margins(y=0.1) +plt.show() + +# Source: +# https://matplotlib.org/stable/gallery/lines_bars_and_markers/timeline.html#sphx-glr-gallery-lines-bars-and-markers-timeline-py + diff --git a/Matplotlib Official Primer/Custom tick formatter for time series.py b/Matplotlib Official Primer/Custom tick formatter for time series.py new file mode 100644 index 00000000..27fa599d --- /dev/null +++ b/Matplotlib Official Primer/Custom tick formatter for time series.py @@ -0,0 +1,36 @@ +import numpy as np +import matplotlib.pyplot as plt +import matplotlib.cbook as cbook + +# Load a numpy record array from yahoo csv data with fields date, open, close, +# volume, adj_close from the mpl-data/example directory. The record array +# stores the date as an np.datetime64 with a day unit ('D') in the date column. +r = (cbook.get_sample_data('goog.npz', np_load=True)['price_data'] + .view(np.recarray)) +r = r[-30:] # get the last 30 days + +# first we'll do it the default way, with gaps on weekends +fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=(8, 4)) +ax1.plot(r.date, r.adj_close, 'o-') +ax1.set_title("Default") +fig.autofmt_xdate() + +# next we'll write a custom formatter +N = len(r) +ind = np.arange(N) # the evenly spaced plot indices + + +def format_date(x, pos=None): + thisind = np.clip(int(x + 0.5), 0, N - 1) + return r.date[thisind].item().strftime('%Y-%m-%d') + + +ax2.plot(ind, r.adj_close, 'o-') +# Use automatic FuncFormatter creation +ax2.xaxis.set_major_formatter(format_date) +ax2.set_title("Custom tick formatter") +fig.autofmt_xdate() + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/text_labels_and_annotations/date_index_formatter.html#sphx-glr-gallery-text-labels-and-annotations-date-index-formatter-py diff --git a/Matplotlib Official Primer/Demo of the histogram function's different histtype settings.py b/Matplotlib Official Primer/Demo of the histogram function's different histtype settings.py new file mode 100644 index 00000000..34d03b7e --- /dev/null +++ b/Matplotlib Official Primer/Demo of the histogram function's different histtype settings.py @@ -0,0 +1,34 @@ +import numpy as np +import matplotlib.pyplot as plt + +np.random.seed(19680801) + +mu_x = 200 +sigma_x = 25 +x = np.random.normal(mu_x, sigma_x, size=100) + +mu_w = 200 +sigma_w = 10 +w = np.random.normal(mu_w, sigma_w, size=100) + +fig, axs = plt.subplots(nrows=2, ncols=2) + +axs[0, 0].hist(x, 20, density=True, histtype='stepfilled', facecolor='g', alpha=0.75) +axs[0, 0].set_title('stepfilled') + +axs[0, 1].hist(x, 20, density=True, histtype='step', facecolor='g', alpha=0.75) +axs[0, 1].set_title('step') + +axs[1, 0].hist(x, density=True, histtype='barstacked', rwidth=0.8) +axs[1, 0].hist(w, density=True, histtype='barstacked', rwidth=0.8) +axs[1, 0].set_title('barstacked') + +# Create a histogram by providing the bin edges (unequally spaced). +bins = [100, 150, 180, 195, 205, 220, 250, 300] +axs[1, 1].hist(x, bins, density=True, histtype='bar', rwidth=0.8) +axs[1, 1].set_title('bar, unequal bins') + +fig.tight_layout() +plt.show() + +# Source: https://matplotlib.org/stable/gallery/statistics/histogram_histtypes.html?highlight=stack diff --git a/Matplotlib Official Primer/Different ways of specifying error bars.py b/Matplotlib Official Primer/Different ways of specifying error bars.py new file mode 100644 index 00000000..173cdbb5 --- /dev/null +++ b/Matplotlib Official Primer/Different ways of specifying error bars.py @@ -0,0 +1,26 @@ +import numpy as np +import matplotlib.pyplot as plt + +# example data +x = np.arange(0.1, 4, 0.5) +y = np.exp(-x) + +# example error bar values that vary with x-position +error = 0.1 + 0.2 * x + +fig, (ax0, ax1) = plt.subplots(nrows=2, sharex=True) +ax0.errorbar(x, y, yerr=error, fmt='-o') +ax0.set_title('variable, symmetric error') + +# error bar values w/ different -/+ errors that +# also vary with the x-position +lower_error = 0.4 * error +upper_error = error +asymmetric_error = [lower_error, upper_error] + +ax1.errorbar(x, y, xerr=asymmetric_error, fmt='o') +ax1.set_title('variable, asymmetric error') +ax1.set_yscale('log') +plt.show() + +# Source: https://matplotlib.org/stable/gallery/statistics/errorbar_features.html diff --git a/Matplotlib Official Primer/Discrete distribution as horizontal bar chart.py b/Matplotlib Official Primer/Discrete distribution as horizontal bar chart.py new file mode 100644 index 00000000..d871a69c --- /dev/null +++ b/Matplotlib Official Primer/Discrete distribution as horizontal bar chart.py @@ -0,0 +1,56 @@ +import numpy as np +import matplotlib.pyplot as plt + +category_names = ['Strongly disagree', 'Disagree', + 'Neither agree nor disagree', 'Agree', 'Strongly agree'] +results = { + 'Question 1': [10, 15, 17, 32, 26], + 'Question 2': [26, 22, 29, 10, 13], + 'Question 3': [35, 37, 7, 2, 19], + 'Question 4': [32, 11, 9, 15, 33], + 'Question 5': [21, 29, 5, 5, 40], + 'Question 6': [8, 19, 5, 30, 38] +} + + +def survey(results, category_names): + """ + Parameters + ---------- + results : dict + A mapping from question labels to a list of answers per category. + It is assumed all lists contain the same number of entries and that + it matches the length of *category_names*. + category_names : list of str + The category labels. + """ + labels = list(results.keys()) + data = np.array(list(results.values())) + data_cum = data.cumsum(axis=1) + category_colors = plt.get_cmap('RdYlGn')( + np.linspace(0.15, 0.85, data.shape[1])) + + fig, ax = plt.subplots(figsize=(9.2, 5)) + ax.invert_yaxis() + ax.xaxis.set_visible(False) + ax.set_xlim(0, np.sum(data, axis=1).max()) + + for i, (colname, color) in enumerate(zip(category_names, category_colors)): + widths = data[:, i] + starts = data_cum[:, i] - widths + rects = ax.barh(labels, widths, left=starts, height=0.5, + label=colname, color=color) + + r, g, b, _ = color + text_color = 'white' if r * g * b < 0.5 else 'darkgrey' + ax.bar_label(rects, label_type='center', color=text_color) + ax.legend(ncol=len(category_names), bbox_to_anchor=(0, 1), + loc='lower left', fontsize='small') + + return fig, ax + + +survey(results, category_names) +plt.show() + +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/horizontal_barchart_distribution.html?highlight=stack#discrete-distribution-as-horizontal-bar-chart diff --git a/Matplotlib Official Primer/Errorbar_function.py b/Matplotlib Official Primer/Errorbar_function.py new file mode 100644 index 00000000..967880c0 --- /dev/null +++ b/Matplotlib Official Primer/Errorbar_function.py @@ -0,0 +1,15 @@ +import numpy as np +import matplotlib.pyplot as plt + +# example data +x = np.arange(0.1, 4, 0.5) +y = np.exp(-x) + +fig, ax = plt.subplots() +ax.errorbar(x, y, xerr=0.2, yerr=0.4) + +plt.title('Error_bar function') + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/statistics/errorbar.html diff --git a/Matplotlib Official Primer/Grouped bar chart with labels.py b/Matplotlib Official Primer/Grouped bar chart with labels.py new file mode 100644 index 00000000..9d7a3cb4 --- /dev/null +++ b/Matplotlib Official Primer/Grouped bar chart with labels.py @@ -0,0 +1,29 @@ +import matplotlib.pyplot as plt +import numpy as np + +labels = ['G1', 'G2', 'G3', 'G4', 'G5'] +men_means = [20, 34, 30, 35, 27] +women_means = [25, 32, 34, 20, 25] + +x = np.arange(len(labels)) # the label locations +width = 0.35 # the width of the bars + +fig, ax = plt.subplots() +rects1 = ax.bar(x - width/2, men_means, width, label='Men') +rects2 = ax.bar(x + width/2, women_means, width, label='Women') + +# Add some text for labels, title and custom x-axis tick labels, etc. +ax.set_ylabel('Scores') +ax.set_title('Scores by group and gender') +ax.set_xticks(x) +ax.set_xticklabels(labels) +ax.legend() + +ax.bar_label(rects1, padding=3) +ax.bar_label(rects2, padding=3) + +fig.tight_layout() + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/barchart.html diff --git a/Matplotlib Official Primer/Hat graph.py b/Matplotlib Official Primer/Hat graph.py new file mode 100644 index 00000000..ef0cabb3 --- /dev/null +++ b/Matplotlib Official Primer/Hat graph.py @@ -0,0 +1,66 @@ +import numpy as np +import matplotlib.pyplot as plt + + +def hat_graph(ax, xlabels, values, group_labels): + """ + Create a hat graph. + + Parameters + ---------- + ax : matplotlib.axes.Axes + The Axes to plot into. + xlabels : list of str + The category names to be displayed on the x-axis. + values : (M, N) array-like + The data values. + Rows are the groups (len(group_labels) == M). + Columns are the categories (len(xlabels) == N). + group_labels : list of str + The group labels displayed in the legend. + """ + + def label_bars(heights, rects): + """Attach a text label on top of each bar.""" + for height, rect in zip(heights, rects): + ax.annotate(f'{height}', + xy=(rect.get_x() + rect.get_width() / 2, height), + xytext=(0, 4), # 4 points vertical offset. + textcoords='offset points', + ha='center', va='bottom') + + values = np.asarray(values) + x = np.arange(values.shape[1]) + ax.set_xticks(x) + ax.set_xticklabels(xlabels) + spacing = 0.3 # spacing between hat groups + width = (1 - spacing) / values.shape[0] + heights0 = values[0] + for i, (heights, group_label) in enumerate(zip(values, group_labels)): + style = {'fill': False} if i == 0 else {'edgecolor': 'black'} + rects = ax.bar(x - spacing/2 + i * width, heights - heights0, + width, bottom=heights0, label=group_label, **style) + label_bars(heights, rects) + + +# initialise labels and a numpy array make sure you have +# N labels of N number of values in the array +xlabels = ['I', 'II', 'III', 'IV', 'V'] +playerA = np.array([5, 15, 22, 20, 25]) +playerB = np.array([25, 32, 34, 30, 27]) + +fig, ax = plt.subplots() +hat_graph(ax, xlabels, [playerA, playerB], ['Player A', 'Player B']) + +# Add some text for labels, title and custom x-axis tick labels, etc. +ax.set_xlabel('Games') +ax.set_ylabel('Score') +ax.set_ylim(0, 60) +ax.set_title('Scores by number of game and players') +ax.legend() + +fig.tight_layout() +plt.show() + +# Source: +# https://matplotlib.org/stable/gallery/lines_bars_and_markers/hat_graph.html#sphx-glr-gallery-lines-bars-and-markers-hat-graph-py diff --git a/Matplotlib Official Primer/Histogram with trendline.py b/Matplotlib Official Primer/Histogram with trendline.py new file mode 100644 index 00000000..3e997178 --- /dev/null +++ b/Matplotlib Official Primer/Histogram with trendline.py @@ -0,0 +1,17 @@ +import matplotlib.pyplot as plt +import numpy as np + +random_state = np.random.RandomState(19680801) +X = random_state.randn(10000) + +fig, ax = plt.subplots() +ax.hist(X, bins=25, density=True) +x = np.linspace(-5, 5, 1000) +ax.plot(x, 1 / np.sqrt(2*np.pi) * np.exp(-(x**2)/2), linewidth=4) +ax.set_xticks([]) +ax.set_yticks([]) + +plt.show() + +# Reference: +# https://matplotlib.org/stable/gallery/frontpage/histogram.html#sphx-glr-gallery-frontpage-histogram-py diff --git a/Matplotlib Official Primer/Horizontal bar chart.py b/Matplotlib Official Primer/Horizontal bar chart.py new file mode 100644 index 00000000..f01377ce --- /dev/null +++ b/Matplotlib Official Primer/Horizontal bar chart.py @@ -0,0 +1,26 @@ +import matplotlib.pyplot as plt +import numpy as np + +# Fixing random state for reproducibility +np.random.seed(19680801) + + +plt.rcdefaults() +fig, ax = plt.subplots() + +# Example data +people = ('Tom', 'Dick', 'Harry', 'Slim', 'Jim') +y_pos = np.arange(len(people)) +performance = 3 + 10 * np.random.rand(len(people)) +error = np.random.rand(len(people)) + +ax.barh(y_pos, performance, xerr=error, align='center') +ax.set_yticks(y_pos) +ax.set_yticklabels(people) +ax.invert_yaxis() # labels read top-to-bottom +ax.set_xlabel('Performance') +ax.set_title('How fast do you want to go today?') + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/barh.html diff --git a/Matplotlib Official Primer/Horizontal bar chart2.py b/Matplotlib Official Primer/Horizontal bar chart2.py new file mode 100644 index 00000000..eb55b82d --- /dev/null +++ b/Matplotlib Official Primer/Horizontal bar chart2.py @@ -0,0 +1,28 @@ +import matplotlib.pyplot as plt +import numpy as np + +# Fixing random state for reproducibility +np.random.seed(19680801) + + +plt.rcdefaults() +fig, ax = plt.subplots() + +# Example data +people = ('Tom', 'Dick', 'Harry', 'Slim', 'Jim') +y_pos = np.arange(len(people)) + +performance = 3 + 10 * np.random.rand(len(people)) +error = np.random.rand(len(people)) + +ax.barh(y_pos, performance, xerr=error, align='center') + +ax.set_yticks(y_pos) +ax.set_yticklabels(people) + +# ax.invert_yaxis() # labels read top-to-bottom + +ax.set_xlabel('Performance') +ax.set_title('How fast do you want to go today?') + +plt.show() diff --git a/Matplotlib Official Primer/Horizontal_bar_chart3.py b/Matplotlib Official Primer/Horizontal_bar_chart3.py new file mode 100644 index 00000000..100fc2c3 --- /dev/null +++ b/Matplotlib Official Primer/Horizontal_bar_chart3.py @@ -0,0 +1,28 @@ +import matplotlib.pyplot as plt +import numpy as np + +# Fixing random state for reproducibility +np.random.seed(19680801) + +plt.rcdefaults() + +fig, ax = plt.subplots() + +# Example data +people = ('Tom', 'Dick', 'Harry', 'Slim', 'Jim') +y_pos = np.arange(len(people)) + +performance = 3 + 10 * np.random.rand(len(people)) +error = np.random.rand(len(people)) + +ax.barh(y_pos, performance, align='center') + +ax.set_yticks(y_pos) +ax.set_yticklabels(people) + +ax.invert_yaxis() # labels read top-to-bottom + +ax.set_xlabel('Performance') +ax.set_title('How fast do you want to go today?') + +plt.show() diff --git a/Matplotlib Official Primer/Label_right.py b/Matplotlib Official Primer/Label_right.py new file mode 100644 index 00000000..f5934314 --- /dev/null +++ b/Matplotlib Official Primer/Label_right.py @@ -0,0 +1,18 @@ +import numpy as np +import matplotlib.pyplot as plt + +# Fixing random state for reproducibility +np.random.seed(19680801) + +fig, ax = plt.subplots() +ax.plot(100*np.random.rand(20)) + +# Use automatic StrMethodFormatter +ax.yaxis.set_major_formatter('${x:1.2f}') + +ax.yaxis.set_tick_params(which='major', labelcolor='green', + labelleft=False, labelright=True) + +plt.show() + +# Source: https://matplotlib.org/stable/tutorials/intermediate/artists.html diff --git a/Matplotlib Official Primer/Labeling a pie and a donut.py b/Matplotlib Official Primer/Labeling a pie and a donut.py new file mode 100644 index 00000000..4ef4739d --- /dev/null +++ b/Matplotlib Official Primer/Labeling a pie and a donut.py @@ -0,0 +1,35 @@ +import numpy as np +import matplotlib.pyplot as plt + +fig, ax = plt.subplots(figsize=(6, 3), subplot_kw=dict(aspect="equal")) + +recipe = ["375 g flour", + "75 g sugar", + "250 g butter", + "300 g berries"] + +data = [float(x.split()[0]) for x in recipe] +ingredients = [x.split()[-1] for x in recipe] + + +def func(pct, allvals): + absolute = int(round(pct/100.*np.sum(allvals))) + return "{:.1f}%\n({:d} g)".format(pct, absolute) + + +wedges, texts, autotexts = ax.pie(data, autopct=lambda pct: func(pct, data), + textprops=dict(color="w")) + +ax.legend(wedges, ingredients, + title="Ingredients", + loc="center left", + bbox_to_anchor=(1, 0, 0.5, 1)) + +plt.setp(autotexts, size=8, weight="bold") + +ax.set_title("Matplotlib bakery: A pie") + +plt.show() + +# Source: +# https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py \ No newline at end of file diff --git a/Matplotlib Official Primer/Labeling a pie and a donut2.py b/Matplotlib Official Primer/Labeling a pie and a donut2.py new file mode 100644 index 00000000..5d0b2649 --- /dev/null +++ b/Matplotlib Official Primer/Labeling a pie and a donut2.py @@ -0,0 +1,40 @@ +import numpy as np +import matplotlib.pyplot as plt + +fig, ax = plt.subplots(figsize=(6, 3), subplot_kw=dict(aspect="equal")) + +recipe = ["375 g flour", + "75 g sugar", + "250 g butter", + "300 g berries"] + +data = [float(x.split()[0]) for x in recipe] +ingredients = [x.split()[-1] for x in recipe] + + +def func(pct, allvals): + absolute = int(round(pct/100.*np.sum(allvals))) + return "{:.1f}%\n({:d} g)".format(pct, absolute) + + +wedges, texts, autotexts = ax.pie(data, autopct=lambda pct: func(pct, data), + textprops=dict(color="w")) + +# We can use the legend's bbox_to_anchor argument +# to position the legend outside of the pie. +# Here we use the axes coordinates (1, 0, 0.5, 1) together with the location "center left"; +# i.e. the left central point of the legend will be at the left central point of the bounding box, +# spanning from (1, 0) to (1.5, 1) in axes coordinates. +ax.legend(wedges, ingredients, + title="Ingredients", + loc="center left", + bbox_to_anchor=(1, 10, 0.5, 1)) + +plt.setp(autotexts, size=8, weight="bold") + +ax.set_title("Matplotlib bakery: A pie") + +plt.show() + +# Source: +# https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py \ No newline at end of file diff --git a/Matplotlib Official Primer/Labeling a pie and a donut3.py b/Matplotlib Official Primer/Labeling a pie and a donut3.py new file mode 100644 index 00000000..9e2a29a3 --- /dev/null +++ b/Matplotlib Official Primer/Labeling a pie and a donut3.py @@ -0,0 +1,40 @@ +import numpy as np +import matplotlib.pyplot as plt + +fig, ax = plt.subplots(figsize=(6, 3), subplot_kw=dict(aspect="equal")) + +recipe = ["375 g flour", + "75 g sugar", + "250 g butter", + "300 g berries"] + +data = [float(x.split()[0]) for x in recipe] +ingredients = [x.split()[-1] for x in recipe] + + +def func(pct, allvals): + absolute = int(round(pct/100.*np.sum(allvals))) + return "{:.1f}%\n({:d} g)".format(pct, absolute) + + +wedges, texts, autotexts = ax.pie(data, autopct=lambda pct: func(pct, data), + textprops=dict(color="w")) + +# We can use the legend's bbox_to_anchor argument +# to position the legend outside of the pie. +# Here we use the axes coordinates (1, 0, 0.5, 1) together with the location "center left"; +# i.e. the left central point of the legend will be at the left central point of the bounding box, +# spanning from (1, 0) to (1.5, 1) in axes coordinates. +ax.legend(wedges, ingredients, + title="Ingredients", + loc="center left", + bbox_to_anchor=(1, 0, 0.5, 1)) + +plt.setp(autotexts, size=8, weight="bold") + +ax.set_title("Matplotlib bakery: A pie") + +plt.show() + +# Source: +# https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py \ No newline at end of file diff --git a/Matplotlib Official Primer/Labeling a pie and a donut4.py b/Matplotlib Official Primer/Labeling a pie and a donut4.py new file mode 100644 index 00000000..9b3957a2 --- /dev/null +++ b/Matplotlib Official Primer/Labeling a pie and a donut4.py @@ -0,0 +1,41 @@ +import numpy as np +import matplotlib.pyplot as plt + +fig, ax = plt.subplots(figsize=(6, 3), subplot_kw=dict(aspect="equal")) + +recipe = ["375 g flour", + "75 g sugar", + "250 g butter", + "300 g berries"] + +data = [float(x.split()[0]) for x in recipe] +ingredients = [x.split()[-1] for x in recipe] + + +def func(pct, allvals): + absolute = int(round(pct/100.*np.sum(allvals))) + return "{:.1f}%\n({:d} g)".format(pct, absolute) + + +wedges, texts, autotexts = ax.pie(data, autopct=lambda pct: func(pct, data), + textprops=dict(color="w")) + +# We can use the legend's bbox_to_anchor argument +# to position the legend outside of the pie. +# Here we use the axes coordinates (1, 0, 0.5, 1) together with the location "center left"; +# i.e. the left central point of the legend will be at the left central point of the bounding box, +# spanning from (1, 0) to (1.5, 1) in axes coordinates. +ax.legend(wedges, ingredients, + title="Ingredients", + loc="center left", + bbox_to_anchor=(0.1, 0.5, 1., .102)) + +plt.setp(autotexts, size=8, weight="bold") + +ax.set_title("Matplotlib bakery: A pie") + +plt.show() + +# References: +# 1. https://stackoverflow.com/questions/25068384/bbox-to-anchor-and-loc-in-matplotlib +# 2. https://stackoverflow.com/questions/39803385/what-does-a-4-element-tuple-argument-for-bbox-to-anchor-mean-in-matplotlib/39806180#39806180 diff --git a/Matplotlib Official Primer/MRI With EEG.py b/Matplotlib Official Primer/MRI With EEG.py new file mode 100644 index 00000000..b0e5e1b9 --- /dev/null +++ b/Matplotlib Official Primer/MRI With EEG.py @@ -0,0 +1,71 @@ +import numpy as np +import matplotlib.pyplot as plt +import matplotlib.cbook as cbook +import matplotlib.cm as cm + +from matplotlib.collections import LineCollection +from matplotlib.ticker import MultipleLocator + +fig = plt.figure("MRI_with_EEG") + +# Load the MRI data (256x256 16 bit integers) +with cbook.get_sample_data('s1045.ima.gz') as dfile: + im = np.frombuffer(dfile.read(), np.uint16).reshape((256, 256)) + +# Plot the MRI image +ax0 = fig.add_subplot(2, 2, 1) +ax0.imshow(im, cmap=cm.gray) +ax0.axis('off') + +# Plot the histogram of MRI intensity +ax1 = fig.add_subplot(2, 2, 2) +im = np.ravel(im) +im = im[np.nonzero(im)] # Ignore the background +im = im / (2**16 - 1) # Normalize +ax1.hist(im, bins=100) +ax1.xaxis.set_major_locator(MultipleLocator(0.4)) +ax1.minorticks_on() +ax1.set_yticks([]) +ax1.set_xlabel('Intensity (a.u.)') +ax1.set_ylabel('MRI density') + +# Load the EEG data +n_samples, n_rows = 800, 4 +with cbook.get_sample_data('eeg.dat') as eegfile: + data = np.fromfile(eegfile, dtype=float).reshape((n_samples, n_rows)) +t = 10 * np.arange(n_samples) / n_samples + +# Plot the EEG +ticklocs = [] +ax2 = fig.add_subplot(2, 1, 2) +ax2.set_xlim(0, 10) +ax2.set_xticks(np.arange(10)) +dmin = data.min() +dmax = data.max() +dr = (dmax - dmin) * 0.7 # Crowd them a bit. +y0 = dmin +y1 = (n_rows - 1) * dr + dmax +ax2.set_ylim(y0, y1) + +segs = [] +for i in range(n_rows): + segs.append(np.column_stack((t, data[:, i]))) + ticklocs.append(i * dr) + +offsets = np.zeros((n_rows, 2), dtype=float) +offsets[:, 1] = ticklocs + +lines = LineCollection(segs, offsets=offsets, transOffset=None) +ax2.add_collection(lines) + +# Set the yticks to use axes coordinates on the y axis +ax2.set_yticks(ticklocs) +ax2.set_yticklabels(['PG3', 'PG5', 'PG7', 'PG9']) + +ax2.set_xlabel('Time (s)') + + +plt.tight_layout() +plt.show() + +# Source: https://matplotlib.org/stable/gallery/specialty_plots/mri_with_eeg.html#sphx-glr-gallery-specialty-plots-mri-with-eeg-py diff --git a/Matplotlib Official Primer/Multiple Yaxis With Spines.py b/Matplotlib Official Primer/Multiple Yaxis With Spines.py new file mode 100644 index 00000000..18348cdf --- /dev/null +++ b/Matplotlib Official Primer/Multiple Yaxis With Spines.py @@ -0,0 +1,42 @@ +import matplotlib.pyplot as plt + + +fig, ax = plt.subplots() +fig.subplots_adjust(right=0.75) + +twin1 = ax.twinx() +twin2 = ax.twinx() + +# Offset the right spine of twin2. The ticks and label have already been +# placed on the right by twinx above. +twin2.spines.right.set_position(("axes", 1.2)) + +p1, = ax.plot([0, 1, 2], [0, 1, 2], "b-", label="Density") +p2, = twin1.plot([0, 1, 2], [0, 3, 2], "r-", label="Temperature") +p3, = twin2.plot([0, 1, 2], [50, 30, 15], "g-", label="Velocity") + +ax.set_xlim(0, 2) +ax.set_ylim(0, 2) +twin1.set_ylim(0, 4) +twin2.set_ylim(1, 65) + +ax.set_xlabel("Distance") +ax.set_ylabel("Density") +twin1.set_ylabel("Temperature") +twin2.set_ylabel("Velocity") + +ax.yaxis.label_year.set_color(p1.get_color()) +twin1.yaxis.label_year.set_color(p2.get_color()) +twin2.yaxis.label_year.set_color(p3.get_color()) + +tkw = dict(size=4, width=1.5) +ax.tick_params(axis='y', colors=p1.get_color(), **tkw) +twin1.tick_params(axis='y', colors=p2.get_color(), **tkw) +twin2.tick_params(axis='y', colors=p3.get_color(), **tkw) +ax.tick_params(axis='x', **tkw) + +ax.legend(handles=[p1, p2, p3]) + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/ticks_and_spines/multiple_yaxis_with_spines.html#sphx-glr-gallery-ticks-and-spines-multiple-yaxis-with-spines-py diff --git a/Matplotlib Official Primer/Percentiles as horizontal bar chart.py b/Matplotlib Official Primer/Percentiles as horizontal bar chart.py new file mode 100644 index 00000000..38698a64 --- /dev/null +++ b/Matplotlib Official Primer/Percentiles as horizontal bar chart.py @@ -0,0 +1,145 @@ +import numpy as np +import matplotlib.pyplot as plt +from matplotlib.ticker import MaxNLocator +from collections import namedtuple + +np.random.seed(42) + +Student = namedtuple('Student', ['name', 'grade', 'gender']) +Score = namedtuple('Score', ['score', 'percentile']) + +# GLOBAL CONSTANTS +test_names = ['Pacer Test', 'Flexed Arm\n Hang', 'Mile Run', 'Agility', + 'Push Ups'] +test_units = dict(zip(test_names, ['laps', 'sec', 'min:sec', 'sec', ''])) + + +def attach_ordinal(num): + """Convert an integer to an ordinal string, e.g. 2 -> '2nd'.""" + suffixes = {str(i): v + for i, v in enumerate(['th', 'st', 'nd', 'rd', 'th', + 'th', 'th', 'th', 'th', 'th'])} + v = str(num) + # special case early teens + if v in {'11', '12', '13'}: + return v + 'th' + return v + suffixes[v[-1]] + + +def format_score(score, test): + """ + Create score labels for the right y-axis as the test name followed by the + measurement unit (if any), split over two lines. + """ + unit = test_units[test] + if unit: + return f'{score}\n{unit}' + else: # If no unit, don't include a newline, so that label stays centered. + return score + + +def format_ycursor(y): + y = int(y) + if y < 0 or y >= len(test_names): + return '' + else: + return test_names[y] + + +def plot_student_results(student, scores, cohort_size): + fig, ax1 = plt.subplots(figsize=(9, 7)) # Create the figure + fig.subplots_adjust(left=0.115, right=0.88) + fig.canvas.manager.set_window_title('Eldorado K-8 Fitness Chart') + + pos = np.arange(len(test_names)) + + rects = ax1.barh(pos, [scores[k].percentile for k in test_names], + align='center', + height=0.5, + tick_label=test_names) + + ax1.set_title(student.name) + + ax1.set_xlim([0, 100]) + ax1.xaxis.set_major_locator(MaxNLocator(11)) + ax1.xaxis.grid(True, linestyle='--', which='major', + color='grey', alpha=.25) + + # Plot a solid vertical gridline to highlight the median position + ax1.axvline(50, color='grey', alpha=0.25) + + # Set the right-hand Y-axis ticks and labels + ax2 = ax1.twinx() + + # Set the tick locations + ax2.set_yticks(pos) + # Set equal limits on both yaxis so that the ticks line up + ax2.set_ylim(ax1.get_ylim()) + + # Set the tick labels + ax2.set_yticklabels([format_score(scores[k].score, k) for k in test_names]) + + ax2.set_ylabel('Test Scores') + + xlabel = ('Percentile Ranking Across {grade} Grade {gender}s\n' + 'Cohort Size: {cohort_size}') + ax1.set_xlabel(xlabel.format(grade=attach_ordinal(student.grade), + gender=student.gender.title(), + cohort_size=cohort_size)) + + rect_labels = [] + # Lastly, write in the ranking inside each bar to aid in interpretation + for rect in rects: + # Rectangle widths are already integer-valued but are floating + # type, so it helps to remove the trailing decimal point and 0 by + # converting width to int type + width = int(rect.get_width()) + + rank_str = attach_ordinal(width) + # The bars aren't wide enough to print the ranking inside + if width < 40: + # Shift the text to the right side of the right edge + xloc = 5 + # Black against white background + clr = 'black' + align = 'left' + else: + # Shift the text to the left side of the right edge + xloc = -5 + # White on magenta + clr = 'white' + align = 'right' + + # Center the text vertically in the bar + yloc = rect.get_y() + rect.get_height() / 2 + label = ax1.annotate( + rank_str, xy=(width, yloc), xytext=(xloc, 0), + textcoords="offset points", + horizontalalignment=align, verticalalignment='center', + color=clr, weight='bold', clip_on=True) + rect_labels.append(label) + + # Make the interactive mouse over give the bar title + ax2.fmt_ydata = format_ycursor + # Return all of the artists created + return {'fig': fig, + 'ax': ax1, + 'ax_right': ax2, + 'bars': rects, + 'perc_labels': rect_labels} + + +student = Student('Johnny Doe', 2, 'boy') +scores = dict(zip( + test_names, + (Score(v, p) for v, p in + zip(['7', '48', '12:52', '17', '14'], + np.round(np.random.uniform(0, 100, len(test_names)), 0))))) +cohort_size = 62 # The number of other 2nd grade boys + +arts = plot_student_results(student, scores, cohort_size) +plt.show() + +# Source: https://matplotlib.org/stable/gallery/statistics/barchart_demo.html + +# Further reading: https://matplotlib.org/stable/tutorials/introductory/sample_plots.html?highlight=stack \ No newline at end of file diff --git a/Matplotlib Official Primer/Pie Bar.py b/Matplotlib Official Primer/Pie Bar.py new file mode 100644 index 00000000..65e05516 --- /dev/null +++ b/Matplotlib Official Primer/Pie Bar.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +from matplotlib.patches import ConnectionPatch +import numpy as np + +# make figure and assign axis objects +fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(9, 5)) +fig.subplots_adjust(wspace=0) + +# pie chart parameters +ratios = [.27, .56, .17] +labels = ['Approve', 'Disapprove', 'Undecided'] +explode = [0.1, 0, 0] +# rotate so that first wedge is split by the x-axis +angle = -180 * ratios[0] +ax1.pie(ratios, autopct='%1.1f%%', startangle=angle, + labels=labels, explode=explode) + +# bar chart parameters + +xpos = 0 +bottom = 0 +ratios = [.33, .54, .07, .06] +width = .2 +colors = [[.1, .3, .5], [.1, .3, .3], [.1, .3, .7], [.1, .3, .9]] + +for j in range(len(ratios)): + height = ratios[j] + ax2.bar(xpos, height, width, bottom=bottom, color=colors[j]) + ypos = bottom + ax2.patches[j].get_height() / 2 + bottom += height + ax2.text(xpos, ypos, "%d%%" % (ax2.patches[j].get_height() * 100), + ha='center') + +ax2.set_title('Age of approvers') +ax2.legend(('50-65', 'Over 65', '35-49', 'Under 35')) +ax2.axis('off') +ax2.set_xlim(- 2.5 * width, 2.5 * width) + +# use ConnectionPatch to draw lines between the two plots +# get the wedge data +theta1, theta2 = ax1.patches[0].theta1, ax1.patches[0].theta2 +center, r = ax1.patches[0].center, ax1.patches[0].r +bar_height = sum([item.get_height() for item in ax2.patches]) + +# draw top connecting line +x = r * np.cos(np.pi / 180 * theta2) + center[0] +y = r * np.sin(np.pi / 180 * theta2) + center[1] +con = ConnectionPatch(xyA=(-width / 2, bar_height), coordsA=ax2.transData, + xyB=(x, y), coordsB=ax1.transData) +con.set_color([0, 0, 0]) +con.set_linewidth(4) +ax2.add_artist(con) + +# draw bottom connecting line +x = r * np.cos(np.pi / 180 * theta1) + center[0] +y = r * np.sin(np.pi / 180 * theta1) + center[1] +con = ConnectionPatch(xyA=(-width / 2, 0), coordsA=ax2.transData, + xyB=(x, y), coordsB=ax1.transData) +con.set_color([0, 0, 0]) +ax2.add_artist(con) +con.set_linewidth(4) + +plt.show() + +# Source: +# https://matplotlib.org/stable/gallery/pie_and_polar_charts/bar_of_pie.html#sphx-glr-gallery-pie-and-polar-charts-bar-of-pie-py \ No newline at end of file diff --git a/Matplotlib Official Primer/Pyplot tutorial/Annotating text.py b/Matplotlib Official Primer/Pyplot tutorial/Annotating text.py new file mode 100644 index 00000000..91b08404 --- /dev/null +++ b/Matplotlib Official Primer/Pyplot tutorial/Annotating text.py @@ -0,0 +1,17 @@ +import matplotlib.pyplot as plt +import numpy as np + +ax = plt.subplot() + +t = np.arange(0.0, 5.0, 0.01) +s = np.cos(2*np.pi*t) +line, = plt.plot(t, s, lw=2) + +plt.annotate('local max', xy=(2, 1), xytext=(3, 1.5), + arrowprops=dict(facecolor='black', shrink=0.05), + ) + +plt.ylim(-2, 2) +plt.show() + +# Source: https://matplotlib.org/stable/tutorials/introductory/pyplot.html#annotating-text diff --git a/Matplotlib Official Primer/Pyplot tutorial/Date tick labels.py b/Matplotlib Official Primer/Pyplot tutorial/Date tick labels.py new file mode 100644 index 00000000..8796de91 --- /dev/null +++ b/Matplotlib Official Primer/Pyplot tutorial/Date tick labels.py @@ -0,0 +1,43 @@ +import numpy as np +import matplotlib.pyplot as plt +import matplotlib.dates as mdates +import matplotlib.cbook as cbook + +# Load a numpy structured array from yahoo csv data with fields date, open, +# close, volume, adj_close from the mpl-data/example directory. This array +# stores the date as an np.datetime64 with a day unit ('D') in the 'date' +# column. +data = cbook.get_sample_data('goog.npz', np_load=True)['price_data'] + +fig, ax = plt.subplots() +ax.plot('date', 'adj_close', data=data) + +# Major ticks every 6 months. +fmt_half_year = mdates.MonthLocator(interval=6) +ax.xaxis.set_major_locator(fmt_half_year) + +# Minor ticks every month. +fmt_month = mdates.MonthLocator() +ax.xaxis.set_minor_locator(fmt_month) + +# Text in the x axis will be displayed in 'YYYY-mm' format. +ax.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m')) + +# Round to nearest years. +datemin = np.datetime64(data['date'][0], 'Y') +datemax = np.datetime64(data['date'][-1], 'Y') + np.timedelta64(1, 'Y') +ax.set_xlim(datemin, datemax) + +# Format the coords message box, i.e. the numbers displayed as the cursor moves +# across the axes within the interactive GUI. +ax.format_xdata = mdates.DateFormatter('%Y-%m') +ax.format_ydata = lambda x: f'${x:.2f}' # Format the price. +ax.grid(True) + +# Rotates and right aligns the x labels, and moves the bottom of the +# axes up to make room for them. +fig.autofmt_xdate() + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/text_labels_and_annotations/date.html diff --git a/Matplotlib Official Primer/Pyplot tutorial/Scatter.py b/Matplotlib Official Primer/Pyplot tutorial/Scatter.py new file mode 100644 index 00000000..a02ad5b6 --- /dev/null +++ b/Matplotlib Official Primer/Pyplot tutorial/Scatter.py @@ -0,0 +1,30 @@ +import numpy as np +import matplotlib.pyplot as plt +import matplotlib.cbook as cbook + +# Load a numpy record array from yahoo csv data with fields date, open, close, +# volume, adj_close from the mpl-data/example directory. The record array +# stores the date as an np.datetime64 with a day unit ('D') in the date column. +price_data = (cbook.get_sample_data('goog.npz', np_load=True)['price_data'] + .view(np.recarray)) +price_data = price_data[-250:] # get the most recent 250 trading days + +delta1 = np.diff(price_data.adj_close) / price_data.adj_close[:-1] + +# Marker size in units of points^2 +volume = (15 * price_data.volume[:-2] / price_data.volume[0])**2 +close = 0.003 * price_data.close[:-2] / 0.003 * price_data.open[:-2] + +fig, ax = plt.subplots() +ax.scatter(delta1[:-1], delta1[1:], c=close, s=volume, alpha=0.5) + +ax.set_xlabel(r'$\Delta_i$', fontsize=15) +ax.set_ylabel(r'$\Delta_{i+1}$', fontsize=15) +ax.set_title('Volume and percent change') + +ax.grid(True) +fig.tight_layout() + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_demo2.html diff --git a/Matplotlib Official Primer/Pyplot tutorial/Subplot.py b/Matplotlib Official Primer/Pyplot tutorial/Subplot.py new file mode 100644 index 00000000..0acdb303 --- /dev/null +++ b/Matplotlib Official Primer/Pyplot tutorial/Subplot.py @@ -0,0 +1,21 @@ +import matplotlib.pyplot as plt + +names = ['group_a', 'group_b', 'group_c'] +values = [1, 10, 100] + +plt.figure(figsize=(9, 3)) + +plt.subplot(131) +plt.bar(names, values) + +plt.subplot(132) +plt.scatter(names, values) + +plt.subplot(133) +plt.plot(names, values) + +plt.suptitle('Categorical Plotting') + +plt.show() + +# Source: https://matplotlib.org/stable/tutorials/introductory/pyplot.html#plotting-with-categorical-variables diff --git a/Matplotlib Official Primer/Pyplot tutorial/Subplot_2.py b/Matplotlib Official Primer/Pyplot tutorial/Subplot_2.py new file mode 100644 index 00000000..2bc3253c --- /dev/null +++ b/Matplotlib Official Primer/Pyplot tutorial/Subplot_2.py @@ -0,0 +1,20 @@ +import matplotlib.pyplot as plt +import numpy as np + +def f(t): + return np.exp(-t) * np.cos(2*np.pi*t) + +t1 = np.arange(0.0, 5.0, 0.1) +t2 = np.arange(0.0, 5.0, 0.02) + +plt.figure() +plt.subplot(211) + +plt.plot(t1, f(t1), 'bo', t2, f(t2), 'k') + +plt.subplot(212) +plt.plot(t2, np.cos(2*np.pi*t2), 'r--') + +plt.show() + +# Source: https://matplotlib.org/stable/tutorials/introductory/pyplot.html#working-with-multiple-figures-and-axes diff --git a/Matplotlib Official Primer/Pyplot tutorial/Subplot_3.py b/Matplotlib Official Primer/Pyplot tutorial/Subplot_3.py new file mode 100644 index 00000000..7a1617a1 --- /dev/null +++ b/Matplotlib Official Primer/Pyplot tutorial/Subplot_3.py @@ -0,0 +1,23 @@ +import matplotlib.pyplot as plt +import numpy as np + +plt.figure(1) # the first figure +plt.subplot(211) # the first subplot in the first figure + +plt.plot([1, 2, 3]) + +plt.subplot(212) # the second subplot in the first figure + +plt.plot([4, 5, 6]) + + +plt.figure(2) # a second figure +plt.plot([4, 5, 6]) # creates a subplot() by default + +plt.figure(1) # figure 1 current; subplot(212) still current +plt.subplot(211) # make subplot(211) in figure1 current +plt.title('Easy as 1, 2, 3') # subplot 211 title + +plt.show() + +# Source: https://matplotlib.org/stable/tutorials/introductory/pyplot.html#working-with-multiple-figures-and-axes diff --git a/Matplotlib Official Primer/Pyplot tutorial/Table.py b/Matplotlib Official Primer/Pyplot tutorial/Table.py new file mode 100644 index 00000000..2fdb4b65 --- /dev/null +++ b/Matplotlib Official Primer/Pyplot tutorial/Table.py @@ -0,0 +1,54 @@ +import numpy as np +import matplotlib.pyplot as plt + + +data = [[ 66386, 174296, 75131, 577908, 32015], + [ 58230, 381139, 78045, 99308, 160454], + [ 89135, 80552, 152558, 497981, 603535], + [ 78415, 81858, 150656, 193263, 69638], + [139361, 331509, 343164, 781380, 52269]] + +columns = ('Freeze', 'Wind', 'Flood', 'Quake', 'Hail') +rows = ['%d year' % x for x in (100, 50, 20, 10, 5)] + +values = np.arange(0, 2500, 500) +value_increment = 1000 + +# Get some pastel shades for the colors +colors = plt.cm.BuPu(np.linspace(0, 0.5, len(rows))) +n_rows = len(data) + +index = np.arange(len(columns)) + 0.3 +bar_width = 0.4 + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(columns)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plt.bar(index, data[row], bar_width, bottom=y_offset, color=colors[row]) + y_offset = y_offset + data[row] + cell_text.append(['%1.1f' % (x / 1000.0) for x in y_offset]) +# Reverse colors and text labels to display the last value at the top. +colors = colors[::-1] +cell_text.reverse() + +# Add a table at the bottom of the axes +the_table = plt.table(cellText=cell_text, + rowLabels=rows, + rowColours=colors, + colLabels=columns, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +plt.ylabel("Loss in ${0}'s".format(value_increment)) +plt.yticks(values * value_increment, ['%d' % val for val in values]) +plt.xticks([]) +plt.title('Loss by Disaster') + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/Matplotlib Official Primer/Pyplot tutorial/Using histograms to plot a cumulative distribution.py b/Matplotlib Official Primer/Pyplot tutorial/Using histograms to plot a cumulative distribution.py new file mode 100644 index 00000000..c6916831 --- /dev/null +++ b/Matplotlib Official Primer/Pyplot tutorial/Using histograms to plot a cumulative distribution.py @@ -0,0 +1,38 @@ +import numpy as np +import matplotlib.pyplot as plt + +np.random.seed(19680801) + +mu = 200 +sigma = 25 +n_bins = 50 +x = np.random.normal(mu, sigma, size=100) + +fig, ax = plt.subplots(figsize=(8, 4)) + +# plot the cumulative histogram +n, bins, patches = ax.hist(x, n_bins, density=True, histtype='step', + cumulative=True, label='Empirical') + +# Add a line showing the expected distribution. +y = ((1 / (np.sqrt(2 * np.pi) * sigma)) * + np.exp(-0.5 * (1 / sigma * (bins - mu))**2)) +y = y.cumsum() +y /= y[-1] + +ax.plot(bins, y, 'k--', linewidth=1.5, label='Theoretical') + +# Overlay a reversed cumulative histogram. +ax.hist(x, bins=bins, density=True, histtype='step', cumulative=-1, + label='Reversed emp.') + +# tidy up the figure +ax.grid(True) +ax.legend(loc='right') +ax.set_title('Cumulative step histograms') +ax.set_xlabel('Annual rainfall (mm)') +ax.set_ylabel('Likelihood of occurrence') + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/statistics/histogram_cumulative.html diff --git a/Matplotlib Official Primer/Pyplot tutorial/Working with texts.py b/Matplotlib Official Primer/Pyplot tutorial/Working with texts.py new file mode 100644 index 00000000..bf6d0416 --- /dev/null +++ b/Matplotlib Official Primer/Pyplot tutorial/Working with texts.py @@ -0,0 +1,19 @@ +import matplotlib.pyplot as plt +import numpy as np + +mu, sigma = 100, 15 +x = mu + sigma * np.random.randn(10000) + +# the histogram of the data +n, bins, patches = plt.hist(x, 50, density=1, facecolor='g', alpha=0.75) + + +plt.xlabel('Smarts') +plt.ylabel('Probability') +plt.title('Histogram of IQ') +plt.text(60, .025, r'$\mu=100,\ \sigma=15$') +plt.axis([40, 160, 0, 0.03]) +plt.grid(True) +plt.show() + +# Source: https://matplotlib.org/stable/tutorials/introductory/pyplot.html#working-with-text diff --git a/Matplotlib Official Primer/Pyplot tutorial/__init__.py b/Matplotlib Official Primer/Pyplot tutorial/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Matplotlib Official Primer/Pyplot tutorial/colours.py b/Matplotlib Official Primer/Pyplot tutorial/colours.py new file mode 100644 index 00000000..0e0f3b28 --- /dev/null +++ b/Matplotlib Official Primer/Pyplot tutorial/colours.py @@ -0,0 +1,27 @@ +import matplotlib.pyplot as plt +import numpy as np + +t = np.linspace(0.0, 2.0, 201) +s = np.sin(2 * np.pi * t) + +# 1) RGB tuple: +fig, ax = plt.subplots(facecolor=(.18, .31, .31)) +# 2) hex string: +ax.set_facecolor('#eafff5') +# 3) gray level string: +ax.set_title('Voltage vs. time chart', color='0.7') +# 4) single letter color string +ax.set_xlabel('time (s)', color='c') +# 5) a named color: +ax.set_ylabel('voltage (mV)', color='peachpuff') +# 6) a named xkcd color: +ax.plot(t, s, 'xkcd:crimson') +# 7) Cn notation: +ax.plot(t, .7*s, color='C4', linestyle='--') +# 8) tab notation: +ax.tick_params(labelcolor='tab:orange') + + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/color/color_demo.html diff --git a/Matplotlib Official Primer/Pyplot tutorial/stackplot.py b/Matplotlib Official Primer/Pyplot tutorial/stackplot.py new file mode 100644 index 00000000..1ca2269d --- /dev/null +++ b/Matplotlib Official Primer/Pyplot tutorial/stackplot.py @@ -0,0 +1,2 @@ +# pyplot.stackplot +# https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.stackplot.html?highlight=stack#matplotlib.pyplot.stackplot \ No newline at end of file diff --git a/Matplotlib Official Primer/Ribbon Box.py b/Matplotlib Official Primer/Ribbon Box.py new file mode 100644 index 00000000..5a811fa1 --- /dev/null +++ b/Matplotlib Official Primer/Ribbon Box.py @@ -0,0 +1,88 @@ +import numpy as np + +from matplotlib import cbook, colors as mcolors +from matplotlib.image import AxesImage +import matplotlib.pyplot as plt +from matplotlib.transforms import Bbox, TransformedBbox, BboxTransformTo + + +class RibbonBox: + + original_image = plt.imread( + cbook.get_sample_data("Minduka_Present_Blue_Pack.png")) + cut_location = 70 + b_and_h = original_image[:, :, 2:3] + color = original_image[:, :, 2:3] - original_image[:, :, 0:1] + alpha = original_image[:, :, 3:4] + nx = original_image.shape[1] + + def __init__(self, color): + rgb = mcolors.to_rgba(color)[:3] + self.im = np.dstack( + [self.b_and_h - self.color * (1 - np.array(rgb)), self.alpha]) + + def get_stretched_image(self, stretch_factor): + stretch_factor = max(stretch_factor, 1) + ny, nx, nch = self.im.shape + ny2 = int(ny*stretch_factor) + return np.vstack( + [self.im[:self.cut_location], + np.broadcast_to( + self.im[self.cut_location], (ny2 - ny, nx, nch)), + self.im[self.cut_location:]]) + + +class RibbonBoxImage(AxesImage): + zorder = 1 + + def __init__(self, ax, bbox, color, *, extent=(0, 1, 0, 1), **kwargs): + super().__init__(ax, extent=extent, **kwargs) + self._bbox = bbox + self._ribbonbox = RibbonBox(color) + self.set_transform(BboxTransformTo(bbox)) + + def draw(self, renderer, *args, **kwargs): + stretch_factor = self._bbox.height / self._bbox.width + + ny = int(stretch_factor*self._ribbonbox.nx) + if self.get_array() is None or self.get_array().shape[0] != ny: + arr = self._ribbonbox.get_stretched_image(stretch_factor) + self.set_array(arr) + + super().draw(renderer, *args, **kwargs) + + +def main(): + fig, ax = plt.subplots() + + years = np.arange(2004, 2009) + heights = [7900, 8100, 7900, 6900, 2800] + box_colors = [ + (0.8, 0.2, 0.2), + (0.2, 0.8, 0.2), + (0.2, 0.2, 0.8), + (0.7, 0.5, 0.8), + (0.3, 0.8, 0.7), + ] + + for year, h, bc in zip(years, heights, box_colors): + bbox0 = Bbox.from_extents(year - 0.4, 0., year + 0.4, h) + bbox = TransformedBbox(bbox0, ax.transData) + ax.add_artist(RibbonBoxImage(ax, bbox, bc, interpolation="bicubic")) + ax.annotate(str(h), (year, h), va="bottom", ha="center") + + ax.set_xlim(years[0] - 0.5, years[-1] + 0.5) + ax.set_ylim(0, 10000) + + background_gradient = np.zeros((2, 2, 4)) + background_gradient[:, :, :3] = [1, 1, 0] + background_gradient[:, :, 3] = [[0.1, 0.3], [0.3, 0.5]] # alpha channel + ax.imshow(background_gradient, interpolation="bicubic", zorder=0.1, + extent=(0, 1, 0, 1), transform=ax.transAxes, aspect="auto") + + plt.show() + + +main() + +# Source: https://matplotlib.org/stable/gallery/misc/demo_ribbon_box.html#sphx-glr-gallery-misc-demo-ribbon-box-py diff --git a/Matplotlib Official Primer/Some features of the histogram (hist) function.py b/Matplotlib Official Primer/Some features of the histogram (hist) function.py new file mode 100644 index 00000000..3b22869b --- /dev/null +++ b/Matplotlib Official Primer/Some features of the histogram (hist) function.py @@ -0,0 +1,30 @@ +import numpy as np +import matplotlib.pyplot as plt + +np.random.seed(19680801) + +# example data +mu = 100 # mean of distribution +sigma = 15 # standard deviation of distribution +x = mu + sigma * np.random.randn(437) + +num_bins = 50 + +fig, ax = plt.subplots() + +# the histogram of the data +n, bins, patches = ax.hist(x, num_bins, density=True) + +# add a 'best fit' line +y = ((1 / (np.sqrt(2 * np.pi) * sigma)) * + np.exp(-0.5 * (1 / sigma * (bins - mu))**2)) +ax.plot(bins, y, '--') +ax.set_xlabel('Smarts') +ax.set_ylabel('Probability density') +ax.set_title(r'Histogram of IQ: $\mu=100$, $\sigma=15$') + +# Tweak spacing to prevent clipping of ylabel +fig.tight_layout() +plt.show() + +# Source: https://matplotlib.org/stable/gallery/statistics/histogram_features.html diff --git a/Matplotlib Official Primer/Spacing.jpg b/Matplotlib Official Primer/Spacing.jpg new file mode 100644 index 00000000..1a50eccf Binary files /dev/null and b/Matplotlib Official Primer/Spacing.jpg differ diff --git a/Matplotlib Official Primer/Spacing.py b/Matplotlib Official Primer/Spacing.py new file mode 100644 index 00000000..8d4ba22d --- /dev/null +++ b/Matplotlib Official Primer/Spacing.py @@ -0,0 +1,33 @@ +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt + +# Bring some raw data. +frequencies = [6, 16, 75, 160, 244, 260, 145, 73, 16, 4, 1] + +# In my original code I create a series and run on that, +# so for consistency I create a series from the list. +freq_series = pd.Series(frequencies) + +x_labels = [108300.0, 110540.0, 112780.0, 115020.0, 117260.0, 119500.0, + 121740.0, 123980.0, 126220.0, 128460.0, 130700.0] + + +# dataframe using frequencies and x_labels from the OP +df = pd.DataFrame({'Frequency': frequencies}, index=x_labels) + +# plot +ax = df.plot(kind='bar', figsize=(12, 8), title='Amount Frequency', + xlabel='Amount ($)', ylabel='Frequency', legend=False) + +# annotate +ax.bar_label(ax.containers[0], label_type='edge') + +# pad the spacing between the number and the edge of the figure +ax.margins(y=0.1) + +plt.savefig('Spacing.jpg') + +plt.show() + +# Source: https://stackoverflow.com/a/67561982/14900011 diff --git a/Matplotlib Official Primer/Spacing2.jpg b/Matplotlib Official Primer/Spacing2.jpg new file mode 100644 index 00000000..196b6f5b Binary files /dev/null and b/Matplotlib Official Primer/Spacing2.jpg differ diff --git a/Matplotlib Official Primer/Spacing2.py b/Matplotlib Official Primer/Spacing2.py new file mode 100644 index 00000000..8ce22753 --- /dev/null +++ b/Matplotlib Official Primer/Spacing2.py @@ -0,0 +1,33 @@ +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt + +# Bring some raw data. +frequencies = [6, 16, 75, 160, 244, 260, 145, 73, 16, 4, 1] + +# In my original code I create a series and run on that, +# so for consistency I create a series from the list. +freq_series = pd.Series(frequencies) + +x_labels = [108300.0, 110540.0, 112780.0, 115020.0, 117260.0, 119500.0, + 121740.0, 123980.0, 126220.0, 128460.0, 130700.0] + + +# dataframe using frequencies and x_labels from the OP +df = pd.DataFrame({'Frequency': frequencies}, index=x_labels) + +# plot +ax = df.plot(kind='bar', figsize=(12, 8), title='Amount Frequency', + xlabel='Amount ($)', ylabel='Frequency', legend=False) + +# annotate +ax.bar_label(ax.containers[0], label_type='edge') + +# pad the spacing between the number and the edge of the figure +ax.margins(y=0.8) + +plt.savefig('Spacing2.jpg') + +plt.show() + +# Source: https://stackoverflow.com/a/67561982/14900011 diff --git a/Matplotlib Official Primer/StackPlots.py b/Matplotlib Official Primer/StackPlots.py new file mode 100644 index 00000000..1e393cb4 --- /dev/null +++ b/Matplotlib Official Primer/StackPlots.py @@ -0,0 +1,27 @@ +import numpy as np +import matplotlib.pyplot as plt + +# data from United Nations World Population Prospects (Revision 2019) +# https://population.un.org/wpp/, license: CC BY 3.0 IGO +year = [1950, 1960, 1970, 1980, 1990, 2000, 2010, 2018] +population_by_continent = { + 'africa': [228, 284, 365, 477, 631, 814, 1044, 1275], + 'americas': [340, 425, 519, 619, 727, 840, 943, 1006], + 'asia': [1394, 1686, 2120, 2625, 3202, 3714, 4169, 4560], + 'europe': [220, 253, 276, 295, 310, 303, 294, 293], + 'oceania': [12, 15, 19, 22, 26, 31, 36, 39], +} + +fig, ax = plt.subplots() +ax.stackplot(year, population_by_continent.values(), + labels=population_by_continent.keys()) +ax.legend(loc='upper left') +ax.set_title('World population') +ax.set_xlabel('Year') +ax.set_ylabel('Number of people (millions)') + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/stackplot_demo.html#stackplots + +# Further reading: https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.stackplot.html?highlight=stack#matplotlib.axes.Axes.stackplot diff --git a/Matplotlib Official Primer/Stacked bar chart.py b/Matplotlib Official Primer/Stacked bar chart.py new file mode 100644 index 00000000..aa2522b1 --- /dev/null +++ b/Matplotlib Official Primer/Stacked bar chart.py @@ -0,0 +1,26 @@ +import matplotlib.pyplot as plt + + +labels = ['G1', 'G2', 'G3', 'G4', 'G5'] +men_means = [20, 35, 30, 35, 27] +women_means = [25, 32, 34, 20, 25] +men_std = [2, 3, 4, 1, 2] +women_std = [3, 5, 2, 3, 3] +width = 0.35 # the width of the bars: can also be len(x) sequence + +fig, ax = plt.subplots() + +# the parameters yerr used for error bars, +ax.bar(labels, men_means, width, yerr=men_std, label='Men') + +# and bottom to stack the women's bars on top of the men's bars. +ax.bar(labels, women_means, width, yerr=women_std, bottom=men_means, + label='Women') + +ax.set_ylabel('Scores') +ax.set_title('Scores by group and gender') +ax.legend() + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_stacked.html?highlight=stack diff --git a/Matplotlib Official Primer/Stacked bar chart2.py b/Matplotlib Official Primer/Stacked bar chart2.py new file mode 100644 index 00000000..351befec --- /dev/null +++ b/Matplotlib Official Primer/Stacked bar chart2.py @@ -0,0 +1,23 @@ +import matplotlib.pyplot as plt + + +labels = ['G1', 'G2', 'G3', 'G4', 'G5'] +men_means = [20, 35, 30, 35, 27] +women_means = [25, 32, 34, 20, 25] +men_std = [2, 3, 4, 1, 2] +women_std = [3, 5, 2, 3, 3] +width = 0.35 # the width of the bars: can also be len(x) sequence + +fig, ax = plt.subplots() + +ax.bar(labels, men_means, width, label='Men') +ax.bar(labels, women_means, width, bottom=men_means, + label='Women') + +ax.set_ylabel('Scores') +ax.set_title('Scores by group and gender') +ax.legend() + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_stacked.html diff --git a/Matplotlib Official Primer/Stairs Demo 2.py b/Matplotlib Official Primer/Stairs Demo 2.py new file mode 100644 index 00000000..cfa8230f --- /dev/null +++ b/Matplotlib Official Primer/Stairs Demo 2.py @@ -0,0 +1,42 @@ +import numpy as np +import matplotlib.pyplot as plt +from matplotlib.patches import StepPatch + +np.random.seed(0) +h, edges = np.histogram(np.random.normal(5, 3, 5000), + bins=np.linspace(0, 10, 20)) + +fig, axs = plt.subplots(3, 1, figsize=(7, 15)) +axs[0].stairs(h, edges, label='Simple histogram') +axs[0].stairs(h, edges + 5, baseline=50, label='Modified baseline') +axs[0].stairs(h, edges + 10, baseline=None, label='No edges') +axs[0].set_title("Step Histograms") + +axs[1].stairs(np.arange(1, 6, 1), fill=True, + label='Filled histogram\nw/ automatic edges') +axs[1].stairs(np.arange(1, 6, 1)*0.3, np.arange(2, 8, 1), + orientation='horizontal', hatch='//', + label='Hatched histogram\nw/ horizontal orientation') +axs[1].set_title("Filled histogram") + +patch = StepPatch(values=[1, 2, 3, 2, 1], + edges=range(1, 7), + label=('Patch derived underlying object\n' + 'with default edge/facecolor behaviour')) + +axs[2].add_patch(patch) +axs[2].set_xlim(0, 7) +axs[2].set_ylim(-1, 5) +axs[2].set_title("StepPatch artist") + +A = [[0, 0, 0], + [1, 2, 3], + [2, 4, 6], + [3, 6, 9]] + +for i in range(len(A) - 1): + plt.stairs(A[i+1], baseline=A[i], fill=True) + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/stairs_demo.html?highlight=stack diff --git a/Matplotlib Official Primer/Stairs Demo 3.py b/Matplotlib Official Primer/Stairs Demo 3.py new file mode 100644 index 00000000..e3e685ad --- /dev/null +++ b/Matplotlib Official Primer/Stairs Demo 3.py @@ -0,0 +1,20 @@ +import numpy as np +import matplotlib.pyplot as plt + +bins = np.arange(14) +centers = bins[:-1] + np.diff(bins) / 2 +y = np.sin(centers / 2) + +plt.step(bins[:-1], y, where='post', label='step(where="post")') +plt.plot(bins[:-1], y, 'o--', color='grey', alpha=0.3) + +plt.stairs(y - 1, bins, baseline=None, label='stairs()') +plt.plot(centers, y - 1, 'o--', color='grey', alpha=0.3) +plt.plot(np.repeat(bins, 2), np.hstack([y[0], np.repeat(y, 2), y[-1]]) - 1, + 'o', color='red', alpha=0.2) + +plt.legend() +plt.title('step() vs. stairs()') +plt.show() + +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/stairs_demo.html?highlight=stack#comparison-of-pyplot-step-and-pyplot-stairs diff --git a/Matplotlib Official Primer/Stairs Demo.py b/Matplotlib Official Primer/Stairs Demo.py new file mode 100644 index 00000000..5a470d92 --- /dev/null +++ b/Matplotlib Official Primer/Stairs Demo.py @@ -0,0 +1,36 @@ +import numpy as np +import matplotlib.pyplot as plt +from matplotlib.patches import StepPatch + +np.random.seed(0) +h, edges = np.histogram(np.random.normal(5, 3, 5000), + bins=np.linspace(0, 10, 20)) + +fig, axs = plt.subplots(3, 1, figsize=(7, 15)) +axs[0].stairs(h, edges, label='Simple histogram') +axs[0].stairs(h, edges + 5, baseline=50, label='Modified baseline') +axs[0].stairs(h, edges + 10, baseline=None, label='No edges') +axs[0].set_title("Step Histograms") + +axs[1].stairs(np.arange(1, 6, 1), fill=True, label='Filled histogram\nw/ automatic edges') +axs[1].stairs(np.arange(1, 6, 1)*0.3, np.arange(2, 8, 1), orientation='horizontal', hatch='//', + label='Hatched histogram\nw/ horizontal orientation') + +axs[1].set_title("Filled histogram") + +patch = StepPatch(values=[1, 2, 3, 2, 1], + edges=range(1, 7), + label=('Patch derived underlying object\n' + 'with default edge/facecolor behaviour')) + +axs[2].add_patch(patch) +axs[2].set_xlim(0, 7) +axs[2].set_ylim(-1, 5) +axs[2].set_title("StepPatch artist") + +for ax in axs: + ax.legend() + + +plt.show() + diff --git a/Matplotlib Official Primer/StreamGraph.py b/Matplotlib Official Primer/StreamGraph.py new file mode 100644 index 00000000..2bd7095b --- /dev/null +++ b/Matplotlib Official Primer/StreamGraph.py @@ -0,0 +1,31 @@ +import numpy as np +import matplotlib.pyplot as plt + +# Fixing random state for reproducibility +np.random.seed(19680801) + + +def gaussian_mixture(x, n=5): + """Return a random mixture of *n* Gaussians, evaluated at positions *x*.""" + def add_random_gaussian(a): + amplitude = 1 / (.1 + np.random.random()) + dx = x[-1] - x[0] + x0 = (2 * np.random.random() - .5) * dx + z = 10 / (.1 + np.random.random()) / dx + a += amplitude * np.exp(-(z * (x - x0))**2) + a = np.zeros_like(x) + for j in range(n): + add_random_gaussian(a) + return a + + +x = np.linspace(0, 100, 101) +ys = [gaussian_mixture(x) for _ in range(3)] + +fig, ax = plt.subplots() +ax.stackplot(x, ys, baseline='wiggle') +plt.show() + +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/stackplot_demo.html#streamgraphs + +# Further reading: https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.stackplot.html?highlight=stack#matplotlib.axes.Axes.stackplot diff --git a/Matplotlib Official Primer/The histogram (hist) function with multiple data sets.py b/Matplotlib Official Primer/The histogram (hist) function with multiple data sets.py new file mode 100644 index 00000000..abfabf22 --- /dev/null +++ b/Matplotlib Official Primer/The histogram (hist) function with multiple data sets.py @@ -0,0 +1,30 @@ +import numpy as np +import matplotlib.pyplot as plt + +np.random.seed(19680801) + +n_bins = 10 +x = np.random.randn(1000, 3) + +fig, ((ax0, ax1), (ax2, ax3)) = plt.subplots(nrows=2, ncols=2) + +colors = ['red', 'tan', 'lime'] +ax0.hist(x, n_bins, density=True, histtype='bar', color=colors, label=colors) +ax0.legend(prop={'size': 10}) +ax0.set_title('bars with legend') + +ax1.hist(x, n_bins, density=True, histtype='bar', stacked=True) +ax1.set_title('stacked bar') + +ax2.hist(x, n_bins, histtype='step', stacked=True, fill=False) +ax2.set_title('stack step (unfilled)') + +# Make a multiple-histogram of data-sets with different length. +x_multi = [np.random.randn(n) for n in [10000, 5000, 2000]] +ax3.hist(x_multi, n_bins, histtype='bar') +ax3.set_title('different sample sizes') + +fig.tight_layout() +plt.show() + +# Source: https://matplotlib.org/stable/gallery/statistics/histogram_multihist.html?highlight=stack diff --git a/Matplotlib Official Primer/__init__.py b/Matplotlib Official Primer/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Matplotlib Official Primer/bar_label()/Bar Label Demo.png b/Matplotlib Official Primer/bar_label()/Bar Label Demo.png new file mode 100644 index 00000000..beb2a6e2 Binary files /dev/null and b/Matplotlib Official Primer/bar_label()/Bar Label Demo.png differ diff --git a/Matplotlib Official Primer/bar_label()/Bar Label Demo.py b/Matplotlib Official Primer/bar_label()/Bar Label Demo.py new file mode 100644 index 00000000..0c2d5588 --- /dev/null +++ b/Matplotlib Official Primer/bar_label()/Bar Label Demo.py @@ -0,0 +1,32 @@ +import matplotlib.pyplot as plt +import numpy as np + +N = 5 +menMeans = (20, 35, 30, 35, -27) +womenMeans = (25, 32, 34, 20, -25) +menStd = (2, 3, 4, 1, 2) +womenStd = (3, 5, 2, 3, 3) +ind = np.arange(N) # the x locations for the groups +width = 0.35 # the width of the bars: can also be len(x) sequence + +fig, ax = plt.subplots() + +p1 = ax.bar(ind, menMeans, width, yerr=menStd, label='Men') +p2 = ax.bar(ind, womenMeans, width, + bottom=menMeans, yerr=womenStd, label='Women') + +ax.axhline(0, color='grey', linewidth=0.8) +ax.set_ylabel('Scores') +ax.set_title('Scores by group and gender') +ax.set_xticks(ind) +ax.set_xticklabels(('G1', 'G2', 'G3', 'G4', 'G5')) +ax.legend() + +# Label with label_type 'center' instead of the default 'edge' +ax.bar_label(p1, label_type='center') +ax.bar_label(p2, label_type='center') +ax.bar_label(p2) + +plt.savefig("Bar Label Demo.png") + +plt.show() diff --git a/Matplotlib Official Primer/bar_label()/Bar label label_type.py b/Matplotlib Official Primer/bar_label()/Bar label label_type.py new file mode 100644 index 00000000..ec98f14b --- /dev/null +++ b/Matplotlib Official Primer/bar_label()/Bar label label_type.py @@ -0,0 +1,33 @@ +import matplotlib.pyplot as plt +import numpy as np + +N = 5 +menMeans = (20, 35, 30, 35, -27) +womenMeans = (25, 32, 34, 20, -25) +menStd = (2, 3, 4, 1, 2) +womenStd = (3, 5, 2, 3, 3) +ind = np.arange(N) # the x locations for the groups +width = 0.35 # the width of the bars: can also be len(x) sequence + +fig, ax = plt.subplots() + +p1 = ax.bar(ind, menMeans, width, yerr=menStd, label='Men') +p2 = ax.bar(ind, womenMeans, width, bottom=menMeans, yerr=womenStd, label='Women') + +ax.axhline(0, color='grey', linewidth=0.8) +ax.set_ylabel('Scores') +ax.set_title('Scores by group and gender') +ax.set_xticks(ind) +ax.set_xticklabels(('G1', 'G2', 'G3', 'G4', 'G5')) +ax.legend() + +# Label with label_type 'center' instead of the default 'edge' +ax.bar_label(p1, label_type='edge') +ax.bar_label(p2, label_type='edge') +ax.bar_label(p2) + +plt.savefig('bar label type of edge.jpg') + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html?highlight=stack#bar-label-demo diff --git a/Matplotlib Official Primer/bar_label()/__init__.py b/Matplotlib Official Primer/bar_label()/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Matplotlib Official Primer/bar_label()/bar label showing percentile.py b/Matplotlib Official Primer/bar_label()/bar label showing percentile.py new file mode 100644 index 00000000..7bc70fa8 --- /dev/null +++ b/Matplotlib Official Primer/bar_label()/bar label showing percentile.py @@ -0,0 +1,52 @@ +import pandas as pd +import numpy as np +import matplotlib.pyplot as plt + +# create sample data as shown in the OP +np.random.seed(365) + +people = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H') +bottomdata = 3 + 10 * np.random.rand(len(people)) +topdata = 3 + 10 * np.random.rand(len(people)) + +# create the dataframe +df = pd.DataFrame({'Female': bottomdata, 'Male': topdata}, index=people) + +ax = df.plot(kind='barh', stacked=True, figsize=(8, 6)) + +for c in ax.containers: + + # customize the label to account for cases when there might not be a bar section + + labels = [] + for v in c: + w = v.get_width() + if w > 0: + labels.append(f'{w:.2f}%') + else: + labels.append('') + + # labels = [f'{w:.2f}%' if (w := v.get_width()) > 0 else '' for v in c ] + + # set the bar label + ax.bar_label(c, labels=labels, label_type='center') + + # uncomment and use the next line if there are no nan or 0 length sections; just use fmt to add a % (the previous two lines of code are not needed, in this case) +# ax.bar_label(c, fmt='%.2f%%', label_type='center') + +# move the legend +ax.legend(bbox_to_anchor=(1.025, 1), loc='upper left', borderaxespad=0.) + +# add labels +ax.set_ylabel("People", fontsize=18) +ax.set_xlabel("Percent", fontsize=18) +plt.show() + +# Source: https://stackoverflow.com/a/64202669/14900011 + +# References: +# 1. https://www.google.com/search?q=python+3.8+vs+3.7 +# 2. https://docs.python.org/3/whatsnew/3.8.html +# 3. https://www.google.com/search?q=walrus+operator +# 4. https://towardsdatascience.com/the-walrus-operator-7971cd339d7d +# 5. https://www.geeksforgeeks.org/display-percentage-above-bar-chart-in-matplotlib/ diff --git a/Matplotlib Official Primer/bar_label()/bar label showing percentile2.py b/Matplotlib Official Primer/bar_label()/bar label showing percentile2.py new file mode 100644 index 00000000..7ef13ef4 --- /dev/null +++ b/Matplotlib Official Primer/bar_label()/bar label showing percentile2.py @@ -0,0 +1,32 @@ +import pandas as pd +import numpy as np +import matplotlib.pyplot as plt + +# create sample data as shown in the OP +np.random.seed(365) + +people = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H') +bottomdata = 3 + 10 * np.random.rand(len(people)) +topdata = 3 + 10 * np.random.rand(len(people)) + +# create the dataframe +df = pd.DataFrame({'Female': bottomdata, 'Male': topdata}, index=people) + +ax = df.plot(kind='barh', stacked=True, figsize=(8, 6)) + +# move the legend +ax.legend(bbox_to_anchor=(1.025, 1), loc='upper left', borderaxespad=0.) + +# add labels +ax.set_ylabel("People", fontsize=18) +ax.set_xlabel("Percent", fontsize=18) +plt.show() + +# Source: https://stackoverflow.com/a/64202669/14900011 + +# References: +# 1. https://www.google.com/search?q=python+3.8+vs+3.7 +# 2. https://docs.python.org/3/whatsnew/3.8.html +# 3. https://www.google.com/search?q=walrus+operator +# 4. https://towardsdatascience.com/the-walrus-operator-7971cd339d7d +# 5. https://www.geeksforgeeks.org/display-percentage-above-bar-chart-in-matplotlib/ diff --git a/Matplotlib Official Primer/bar_label()/bar label showing percentile3.py b/Matplotlib Official Primer/bar_label()/bar label showing percentile3.py new file mode 100644 index 00000000..68025bda --- /dev/null +++ b/Matplotlib Official Primer/bar_label()/bar label showing percentile3.py @@ -0,0 +1,56 @@ +import pandas as pd +import numpy as np +import matplotlib.pyplot as plt + +# create sample data as shown in the OP +np.random.seed(365) + +people = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H') +bottomdata = 3 + 10 * np.random.rand(len(people)) +topdata = 3 + 10 * np.random.rand(len(people)) + +# create the dataframe +df = pd.DataFrame({'Female': bottomdata, 'Male': topdata}, index=people) + +print(df) + +cm = 1 / 2.54 + +ax = df.plot(kind='bar', stacked=True, figsize=(28 * cm, 15 * cm)) + +for c in ax.containers: + + # customize the label to account for cases when there might not be a bar section + + labels = [] + for v in c: + w = v.get_width() + if w > 0: + labels.append(f'{w:.2f}%') + else: + labels.append('') + + # labels = [f'{w:.2f}%' if (w := v.get_width()) > 0 else '' for v in c ] + + # set the bar label + ax.bar_label(c, labels=labels, label_type='center') + + # uncomment and use the next line if there are no nan or 0 length sections; just use fmt to add a % (the previous two lines of code are not needed, in this case) +# ax.bar_label(c, fmt='%.2f%%', label_type='center') + +# move the legend +ax.legend(bbox_to_anchor=(1.025, 1), loc='upper left', borderaxespad=0.) + +# add labels +ax.set_ylabel("People", fontsize=18) +ax.set_xlabel("Percent", fontsize=18) +plt.show() + +# Source: https://stackoverflow.com/a/64202669/14900011 + +# References: +# 1. https://www.google.com/search?q=python+3.8+vs+3.7 +# 2. https://docs.python.org/3/whatsnew/3.8.html +# 3. https://www.google.com/search?q=walrus+operator +# 4. https://towardsdatascience.com/the-walrus-operator-7971cd339d7d +# 5. https://www.geeksforgeeks.org/display-percentage-above-bar-chart-in-matplotlib/ diff --git a/Matplotlib Official Primer/bar_label()/bar label showing percentile4.py b/Matplotlib Official Primer/bar_label()/bar label showing percentile4.py new file mode 100644 index 00000000..7ade141d --- /dev/null +++ b/Matplotlib Official Primer/bar_label()/bar label showing percentile4.py @@ -0,0 +1,56 @@ +import pandas as pd +import numpy as np +import matplotlib.pyplot as plt + +# create sample data as shown in the OP +np.random.seed(365) + +people = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H') +bottomdata = 3 + 10 * np.random.rand(len(people)) +topdata = 3 + 10 * np.random.rand(len(people)) + +# create the dataframe +df = pd.DataFrame({'Female': bottomdata, 'Male': topdata}, index=people) + +print(df) + +cm = 1 / 2.54 + +ax = df.plot(kind='bar', stacked=True, figsize=(28 * cm, 15 * cm)) + +for c in ax.containers: + + # customize the label to account for cases when there might not be a bar section + + labels = [] + for v in c: + w = v.get_height() + if w > 0: + labels.append(f'{w:.2f}%') + else: + labels.append('') + + # labels = [f'{w:.2f}%' if (w := v.get_width()) > 0 else '' for v in c ] + + # set the bar label + ax.bar_label(c, labels=labels, label_type='center') + + # uncomment and use the next line if there are no nan or 0 length sections; just use fmt to add a % (the previous two lines of code are not needed, in this case) +# ax.bar_label(c, fmt='%.2f%%', label_type='center') + +# move the legend +ax.legend(bbox_to_anchor=(1.025, 1), loc='upper left', borderaxespad=0.) + +# add labels +ax.set_ylabel("People", fontsize=18) +ax.set_xlabel("Percent", fontsize=18) +plt.show() + +# Source: https://stackoverflow.com/a/64202669/14900011 + +# References: +# 1. https://www.google.com/search?q=python+3.8+vs+3.7 +# 2. https://docs.python.org/3/whatsnew/3.8.html +# 3. https://www.google.com/search?q=walrus+operator +# 4. https://towardsdatascience.com/the-walrus-operator-7971cd339d7d +# 5. https://www.geeksforgeeks.org/display-percentage-above-bar-chart-in-matplotlib/ diff --git a/Matplotlib Official Primer/bar_label()/bar label type of edge.jpg b/Matplotlib Official Primer/bar_label()/bar label type of edge.jpg new file mode 100644 index 00000000..57db088a Binary files /dev/null and b/Matplotlib Official Primer/bar_label()/bar label type of edge.jpg differ diff --git a/Matplotlib Official Primer/bbox_to_anchor.py b/Matplotlib Official Primer/bbox_to_anchor.py new file mode 100644 index 00000000..82a09e10 --- /dev/null +++ b/Matplotlib Official Primer/bbox_to_anchor.py @@ -0,0 +1,20 @@ +import matplotlib.pyplot as plt +import numpy as np + +fig = plt.figure() +ax = fig.add_subplot(projection="polar", facecolor="lightgoldenrodyellow") + +r = np.linspace(0, 3, 301) +theta = 2 * np.pi * r +ax.plot(theta, r, color="tab:orange", lw=3, label="a line") +ax.plot(0.5 * theta, r, color="tab:blue", ls="--", lw=3, label="another line") +ax.tick_params(grid_color="palegoldenrod") +# For polar axes, it may be useful to move the legend slightly away from the +# axes center, to avoid overlap between the legend and the axes. The following +# snippet places the legend's lower left corner just outside of the polar axes +# at an angle of 67.5 degrees in polar coordinates. +angle = np.deg2rad(67.5) +ax.legend(loc="lower left", + bbox_to_anchor=(.5 + np.cos(angle)/2, .5 + np.sin(angle)/2)) + +plt.show() \ No newline at end of file diff --git a/Matplotlib Official Primer/bbox_to_anchor2.py b/Matplotlib Official Primer/bbox_to_anchor2.py new file mode 100644 index 00000000..fae383f7 --- /dev/null +++ b/Matplotlib Official Primer/bbox_to_anchor2.py @@ -0,0 +1,42 @@ +import numpy as np +import matplotlib.pyplot as plt + +fig, ax = plt.subplots(figsize=(6, 3), subplot_kw=dict(aspect="equal")) + +recipe = ["375 g flour", + "75 g sugar", + "250 g butter", + "300 g berries"] + +data = [float(x.split()[0]) for x in recipe] +ingredients = [x.split()[-1] for x in recipe] + + +def func(pct, allvals): + absolute = int(round(pct/100.*np.sum(allvals))) + return "{:.1f}%\n({:d} g)".format(pct, absolute) + + +wedges, texts, autotexts = ax.pie(data, autopct=lambda pct: func(pct, data), + textprops=dict(color="w")) + +# We can use the legend's bbox_to_anchor argument +# to position the legend outside of the pie. +# Here we use the axes coordinates (1, 0, 0.5, 1) together with the location "center left"; +# i.e. the left central point of the legend will be at the left central point of the bounding box, +# spanning from (1, 0) to (1.5, 1) in axes coordinates. +ax.legend(wedges, ingredients, + title="Ingredients", + loc="center left", + bbox_to_anchor=(0.1, 0.5, 1., .102)) + +plt.setp(autotexts, size=8, weight="bold") + +ax.set_title("Matplotlib bakery: A pie") + +plt.show() + +# References: +# 1. https://stackoverflow.com/questions/25068384/bbox-to-anchor-and-loc-in-matplotlib +# 2. https://stackoverflow.com/questions/39803385/what-does-a-4-element-tuple-argument-for-bbox-to-anchor-mean-in-matplotlib/39806180#39806180 +# 3. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py diff --git a/Matplotlib Official Primer/bbox_to_anchor3.py b/Matplotlib Official Primer/bbox_to_anchor3.py new file mode 100644 index 00000000..778862dc --- /dev/null +++ b/Matplotlib Official Primer/bbox_to_anchor3.py @@ -0,0 +1,17 @@ +import pandas as pd +import matplotlib.pyplot as plt + +data = {'var': ['TR', 'AC', 'F&B'], '2019 1Q': [6600, 1256, 588], '2019 2Q': [6566, 1309, 586], '2019 3Q': [7383, 1525, 673]} +df = pd.DataFrame(data) +df.set_index('var', inplace=True) + +ax = df.T.plot.bar(stacked=True, figsize=(12, 6), rot=0) + +for c in ax.containers: + ax.bar_label(c, label_type='center') + +ax.legend(title='Categories', bbox_to_anchor=(1.01, 1), loc='upper left') + +plt.show() + +# Source: https://stackoverflow.com/a/63856446/14900011 diff --git a/Matplotlib Official Primer/stack.py b/Matplotlib Official Primer/stack.py new file mode 100644 index 00000000..5e86fb42 --- /dev/null +++ b/Matplotlib Official Primer/stack.py @@ -0,0 +1 @@ +# https://matplotlib.org/stable/search.html?q=stack \ No newline at end of file diff --git a/Matplotlib for Python Developers/Adjusting marker sizes and colors.py b/Matplotlib for Python Developers/Adjusting marker sizes and colors.py new file mode 100644 index 00000000..35b2207c --- /dev/null +++ b/Matplotlib for Python Developers/Adjusting marker sizes and colors.py @@ -0,0 +1,21 @@ +import matplotlib.pyplot as plt +import matplotlib.colors +import numpy as np + +# Prepare a list of integers +n = list(range(5)) + +# Prepare a list of sizes that increases with values in n +s = [i**2 * 100 + 100 for i in n] + +# Prepare a list of colors +c = ['red', 'orange', 'yellow', 'green', 'blue'] + +# Draw a scatter plot of n points with black cross markers of size 12 +plt.plot(n, marker='x', color='black', ms=12) + +# Set axis limits to show the markers completely +plt.xlim(-0.5, 4.5) +plt.ylim(-1, 5) + +plt.show() diff --git a/Matplotlib for Python Developers/Adjusting marker sizes and colors2.py b/Matplotlib for Python Developers/Adjusting marker sizes and colors2.py new file mode 100644 index 00000000..5375a7d9 --- /dev/null +++ b/Matplotlib for Python Developers/Adjusting marker sizes and colors2.py @@ -0,0 +1,22 @@ +import matplotlib.pyplot as plt +import matplotlib.colors +import numpy as np + +n = [0, 1, 2, 3, 4] + +s = [i**2 * 100 + 100 for i in n] + +# Prepare a list of colors +c = ['red', 'orange', 'yellow', 'green', ' blue'] + +# Draw a scatter plot of n points, with sizes in s and colors in c +plt.scatter(x=n, y=n, s=s, cmap=c) + +# Draw a line plot, with n points of black cross markers of size 12 +plt.plot(n, marker='x', color='black', ms=12) + +# Set axis limits to show the markers completely. +plt.xlim(-0.5, 4.5) +plt.ylim(-1, 5) + +plt.show() diff --git a/Matplotlib for Python Developers/Customizing data point markers.py b/Matplotlib for Python Developers/Customizing data point markers.py new file mode 100644 index 00000000..a18a67c4 --- /dev/null +++ b/Matplotlib for Python Developers/Customizing data point markers.py @@ -0,0 +1,9 @@ +import matplotlib.pyplot as plt +from matplotlib.lines import Line2D + +custom_markers = ['$'+x+'$' for x in ['\$', '\%', '\clubsuit', '\sigma', '']] + +for i, marker in enumerate(custom_markers): + plt.scatter(i%10, i, marker=marker, s=500) # plot each of the markers in size of 100 + +plt.show() diff --git a/Matplotlib for Python Developers/Data point markers.py b/Matplotlib for Python Developers/Data point markers.py new file mode 100644 index 00000000..2cdc9cc9 --- /dev/null +++ b/Matplotlib for Python Developers/Data point markers.py @@ -0,0 +1,8 @@ +import matplotlib.pyplot as plt +from matplotlib.lines import Line2D + +for i, marker in enumerate(Line2D.markers): + plt.scatter(x=i%10, y=i, marker=marker, s=100) # plot each of the markers in size of 100. + +plt.show() + diff --git a/Matplotlib for Python Developers/Embed your Matplotlib.py b/Matplotlib for Python Developers/Embed your Matplotlib.py new file mode 100644 index 00000000..e9868cc5 --- /dev/null +++ b/Matplotlib for Python Developers/Embed your Matplotlib.py @@ -0,0 +1,6 @@ +import matplotlib.pyplot as plt + +x = list(range(10)) +y = [i**2 for i in x] +plt.plot(x, y) +plt.show() diff --git a/Matplotlib for Python Developers/Line plot - customizing x-axis.py b/Matplotlib for Python Developers/Line plot - customizing x-axis.py new file mode 100644 index 00000000..acdd5aed --- /dev/null +++ b/Matplotlib for Python Developers/Line plot - customizing x-axis.py @@ -0,0 +1,8 @@ +import matplotlib.pyplot as plt + +temperature = [22.2, 22.3, 22.5, 21.8, 22.5, 23.4, 22.8] + +date = [11, 12, 13, 14, 15, 16, 17] + +plt.plot(date, temperature) +plt.show() diff --git a/Matplotlib for Python Developers/Line plot.py b/Matplotlib for Python Developers/Line plot.py new file mode 100644 index 00000000..35963f3b --- /dev/null +++ b/Matplotlib for Python Developers/Line plot.py @@ -0,0 +1,9 @@ +import matplotlib.pyplot as plt + +# daily temperature +temperatures = [22.2, 22.3, 22.5, 21.8, 22.5, 23.4, 22.8] + +# plot the daily temperature as a line plot +plt.plot(temperatures) + +plt.show() diff --git a/Matplotlib for Python Developers/Multiline plots.py b/Matplotlib for Python Developers/Multiline plots.py new file mode 100644 index 00000000..6f8292ed --- /dev/null +++ b/Matplotlib for Python Developers/Multiline plots.py @@ -0,0 +1,14 @@ +import matplotlib.pyplot as plt + +date = [11, 12, 13, 14, 15, 16, 17] + +temperature0 = [15.3, 15.4, 12.6, 12.7, 13.2, 12.3, 11.4] +temperature1 = [26.1, 26.2, 24.3, 25.1, 26.7, 27.8, 26.9] +temperature2 = [22.3, 20.6, 19.8, 21.6, 21.3, 19.4, 21.4] + +# plot the lines for each data series +plt.plot(date, temperature0) +plt.plot(date, temperature1) +plt.plot(date, temperature2) + +plt.show() diff --git a/Matplotlib for Python Developers/Scatter plot.py b/Matplotlib for Python Developers/Scatter plot.py new file mode 100644 index 00000000..8e4d11e2 --- /dev/null +++ b/Matplotlib for Python Developers/Scatter plot.py @@ -0,0 +1,11 @@ +import matplotlib.pyplot as plt +import numpy as np + +np.random.seed(42) + +r = np.random.rand(2, 100) + +# Plot the x and y coordinates of the random dots on a scatter plot +plt.scatter(r[0], r[1]) + +plt.show() diff --git a/Matplotlib for Python Developers/__init__.py b/Matplotlib for Python Developers/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Medley/2025 Level 4 Civil Servant Admission Exam.py b/Medley/2025 Level 4 Civil Servant Admission Exam.py new file mode 100644 index 00000000..219078e9 --- /dev/null +++ b/Medley/2025 Level 4 Civil Servant Admission Exam.py @@ -0,0 +1,3 @@ +data = [x * y for x in range(4) for y in range(3) if x > y and y % 2 == 0] + +print(data) \ No newline at end of file diff --git a/Medley/__init__.py b/Medley/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/NetworkX Altas/An directed graph.py b/NetworkX Altas/An directed graph.py new file mode 100644 index 00000000..3830a491 --- /dev/null +++ b/NetworkX Altas/An directed graph.py @@ -0,0 +1,16 @@ +import networkx as nx +import matplotlib.pyplot as plt + +vertices = range(1, 13) + +edges = [(2, 8), (2, 3), (2, 6), (3, 0), (3, 9), (0, 1), (0, 10), (9, 10), (1, 4), (10, 11), (4, 5), + (11, 12), (12, 5), (5, 7)] + +directed_graph = nx.DiGraph() + +directed_graph.add_edges_from(edges) +directed_graph.add_nodes_from(vertices) + +nx.draw(G=directed_graph, with_labels=True, node_color='y', node_size=800) + +plt.show() diff --git a/NetworkX Altas/An undirected graph.py b/NetworkX Altas/An undirected graph.py new file mode 100644 index 00000000..09a6d3ec --- /dev/null +++ b/NetworkX Altas/An undirected graph.py @@ -0,0 +1,15 @@ +import networkx as nx +import matplotlib.pyplot as plt + +vertices = range(1, 13) + +edges = [(2, 8), (2, 3), (2, 6), (3, 0), (3, 9), (0, 1), (0, 10), (9, 10), (1, 4), (10, 11), (4, 5), + (11, 12), (12, 5), (5, 7)] + +directed_acyclic_graph = nx.Graph() +directed_acyclic_graph.add_nodes_from(vertices) +directed_acyclic_graph.add_edges_from(edges) + +nx.draw(G=directed_acyclic_graph) + +plt.show() diff --git a/NetworkX Altas/Bipartite.py b/NetworkX Altas/Bipartite.py new file mode 100644 index 00000000..a7745722 --- /dev/null +++ b/NetworkX Altas/Bipartite.py @@ -0,0 +1,19 @@ +from networkx.algorithms import bipartite +import networkx as nx +import matplotlib.pyplot as plt + +B = nx.Graph() + +# Add nodes with the node attribute "bipartite" +B.add_nodes_from([1, 2, 3, 4], bipartite=0) +B.add_nodes_from(["a", "b", "c"], bipartite=1) + +# Add edges only between nodes of opposite node sets +B.add_edges_from([(1, "a"), (1, "b"), (2, "b"), (2, "c"), (3, "c"), (4, "a")]) + +c = bipartite.color(G=B) +print(c) + +nx.draw_planar(G=B, with_labels=True, node_color='g', node_size=800, font_size=14, width=0.8) + +plt.show() diff --git a/NetworkX Altas/Circuit's attracting components.py b/NetworkX Altas/Circuit's attracting components.py new file mode 100644 index 00000000..7d8fa042 --- /dev/null +++ b/NetworkX Altas/Circuit's attracting components.py @@ -0,0 +1,117 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="PO1", layer=3) +circuit.add_node(14, label="PO2", layer=3) + + +circuit.add_edge(9, 13) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +subgraph = nx.number_attracting_components(G=circuit) + +print(subgraph) diff --git a/NetworkX Altas/Circuit's attracting components2.py b/NetworkX Altas/Circuit's attracting components2.py new file mode 100644 index 00000000..6eff7179 --- /dev/null +++ b/NetworkX Altas/Circuit's attracting components2.py @@ -0,0 +1,124 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="PO1", layer=3) +circuit.add_node(14, label="PO2", layer=3) + + +circuit.add_edge(9, 13) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +for subgraph in nx.attracting_components(G=circuit): + subgraph_ = circuit.subgraph(nodes=subgraph).copy() + + print(subgraph_.edges()) + print(subgraph_.nodes()) + + +# References: +# 1. https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.components.attracting_components.html#networkx.algorithms.components.attracting_components +# 2. https://stackoverflow.com/a/22180998/ diff --git a/NetworkX Altas/Circuit_bipartite.py b/NetworkX Altas/Circuit_bipartite.py new file mode 100644 index 00000000..94eec711 --- /dev/null +++ b/NetworkX Altas/Circuit_bipartite.py @@ -0,0 +1,93 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="i1", layer=0) +circuit.add_node(1, label="i2", layer=0) +circuit.add_node(2, label="i3", layer=0) +circuit.add_node(3, label="i4", layer=0) +circuit.add_node(4, label="i5", layer=0) +circuit.add_node(5, label="i6", layer=0) +circuit.add_node(6, label="i7", layer=0) + +# Layer 1 +circuit.add_node(7, label="O1", layer=1) +circuit.add_node(8, label="O2", layer=1) +circuit.add_node(9, label="O3", layer=1) +circuit.add_node(10, label="O4", layer=1) + +circuit.add_edge(0, 7) +circuit.add_edge(1, 7) +circuit.add_edge(1, 8) +circuit.add_edge(2, 8) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(3, 9) +circuit.add_edge(4, 10) +circuit.add_edge(5, 9) +circuit.add_edge(5, 10) +circuit.add_edge(6, 10) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "black", + "labels": labels, + "font_size": 22, + "font_color": "white" +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer", scale=1) +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +subgraph = nx.number_attracting_components(G=circuit) + +print(subgraph) diff --git a/NetworkX Altas/Circuits.py b/NetworkX Altas/Circuits.py new file mode 100644 index 00000000..53f7ad97 --- /dev/null +++ b/NetworkX Altas/Circuits.py @@ -0,0 +1,83 @@ +import matplotlib.pyplot as plt +import networkx as nx + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="", layer=0) +# Layer 1 +circuit.add_node(1, label="", layer=1) +circuit.add_node(2, label="", layer=1) +circuit.add_edge(0, 1) +circuit.add_edge(0, 2) +# Layer 2 +circuit.add_node(3, label="x", layer=2) +circuit.add_node(4, label="y", layer=2) +circuit.add_node(5, label="竅", layer=2) +circuit.add_edge(1, 3) +circuit.add_edge(1, 4) +circuit.add_edge(2, 4) +circuit.add_edge(2, 5) +# Layer 3 +circuit.add_node(6, label="z", layer=3) +circuit.add_edge(5, 6) +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + + +labels = nx.get_node_attributes(circuit, "label") +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() + +# Source: https://networkx.org/documentation/stable/auto_examples/algorithms/plot_circuits.html#sphx-glr-auto-examples-algorithms-plot-circuits-py + diff --git a/NetworkX Altas/Circuits2.py b/NetworkX Altas/Circuits2.py new file mode 100644 index 00000000..e5071ab6 --- /dev/null +++ b/NetworkX Altas/Circuits2.py @@ -0,0 +1,75 @@ +import matplotlib.pyplot as plt +import networkx as nx + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) + +# Layer 1 +circuit.add_node(3, label="PO1", layer=1) + +circuit.add_edge(0, 3) +circuit.add_edge(1, 3) +circuit.add_edge(2, 3) + + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() + diff --git a/NetworkX Altas/Clustering/Clustering.py b/NetworkX Altas/Clustering/Clustering.py new file mode 100644 index 00000000..eebbf62a --- /dev/null +++ b/NetworkX Altas/Clustering/Clustering.py @@ -0,0 +1,122 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="I", layer=3) +circuit.add_node(14, label="PO1", layer=3) + +# Layer 4 +circuit.add_node(15, label="PO2", layer=4) + + +circuit.add_edge(9, 15) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +circuit.add_edge(13, 15) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() + +print(nx.algorithms.tree.is_tree(G=circuit)) +print(nx.algorithms.tree.is_forest(G=circuit)) + +print(nx.clustering(G=circuit)) diff --git a/NetworkX Altas/Clustering/Triangle.py b/NetworkX Altas/Clustering/Triangle.py new file mode 100644 index 00000000..e29bedca --- /dev/null +++ b/NetworkX Altas/Clustering/Triangle.py @@ -0,0 +1,122 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="I", layer=3) +circuit.add_node(14, label="PO1", layer=3) + +# Layer 4 +circuit.add_node(15, label="PO2", layer=4) + + +circuit.add_edge(9, 15) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +circuit.add_edge(13, 15) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() + +print(nx.algorithms.tree.is_tree(G=circuit)) +print(nx.algorithms.tree.is_forest(G=circuit)) + +print(nx.triangles(G=circuit)) diff --git a/NetworkX Altas/Clustering/__init__.py b/NetworkX Altas/Clustering/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/NetworkX Altas/Condensation.py b/NetworkX Altas/Condensation.py new file mode 100644 index 00000000..577f5d5b --- /dev/null +++ b/NetworkX Altas/Condensation.py @@ -0,0 +1,121 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="PO1", layer=3) +circuit.add_node(14, label="PO2", layer=3) + + +circuit.add_edge(9, 13) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +print(nx.condensation(G=circuit)) + +condensed = nx.condensation(G=circuit) + +nx.draw(G=condensed, with_labels=True, node_color='y', node_size=800) + +plt.show() diff --git a/NetworkX Altas/Degree centrality.py b/NetworkX Altas/Degree centrality.py new file mode 100644 index 00000000..22e602f5 --- /dev/null +++ b/NetworkX Altas/Degree centrality.py @@ -0,0 +1,24 @@ +import matplotlib.pyplot as plt +import networkx as nx + +graph = nx.Graph() + +edge = [('0', '1', 2.02), ('0', '3', 4.45), + ('0', '10', 6.2), ('1', '4', 1.7), + ('4', '5', 3.28), ('5', '7', 4.28), + ('1', '10', 5.8), ('5', '12', 3.3), + ('10', '11', 1.67), ('11', '12', 2.16), + ('9', '10', 2.32), ('3', '9', 5.02), + ] + +graph.add_weighted_edges_from(edge) + +nx.draw_planar(G=graph, with_labels=True, node_color='y', node_size=800, font_size=14, width=0.8) + +plt.show() + +print(nx.algorithms.centrality.degree_centrality(G=graph)) + +# Further reading: +# 1. https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.centrality.degree_centrality.html#networkx.algorithms.centrality.degree_centrality +# 2. https://networkx.org/documentation/stable/reference/algorithms/centrality.html diff --git a/NetworkX Altas/Dijkstra's algorithm.py b/NetworkX Altas/Dijkstra's algorithm.py new file mode 100644 index 00000000..c0bbed9a --- /dev/null +++ b/NetworkX Altas/Dijkstra's algorithm.py @@ -0,0 +1,12 @@ +import matplotlib.pyplot as plt +import networkx as nx + +graph = nx.Graph() + +edge = [('a', 'b', 0.3), ('b', 'c', 0.9), ('a', 'c', 0.5), ('c', 'd', 1.2)] + +graph.add_weighted_edges_from(edge) + +nx.draw(graph) + +plt.show() diff --git a/NetworkX Altas/Dijkstra's algorithm2.py b/NetworkX Altas/Dijkstra's algorithm2.py new file mode 100644 index 00000000..c3d9a0d4 --- /dev/null +++ b/NetworkX Altas/Dijkstra's algorithm2.py @@ -0,0 +1,17 @@ +import matplotlib.pyplot as plt +import networkx as nx + +graph = nx.Graph() + +edge = [('a', 'b', 0.3), ('b', 'c', 0.9), ('a', 'c', 0.5), ('c', 'd', 1.2)] + +graph.add_weighted_edges_from(edge) + +nx.draw_planar(G=graph, with_labels=True, node_color='y', node_size=800, font_size=14, width=0.8) + +plt.show() + +print(nx.dijkstra_path(G=graph, source='a', target='d')) + +# Reference: +# 1.https://networkx.org/documentation/stable/reference/introduction.html#algorithms diff --git a/NetworkX Altas/Dijkstra's algorithm3.py b/NetworkX Altas/Dijkstra's algorithm3.py new file mode 100644 index 00000000..22181c59 --- /dev/null +++ b/NetworkX Altas/Dijkstra's algorithm3.py @@ -0,0 +1,20 @@ +import matplotlib.pyplot as plt +import networkx as nx + +graph = nx.Graph() + +edge = [('0', '1', 2.02), ('0', '3', 4.45), + ('0', '10', 6.2), ('1', '4', 1.7), + ('4', '5', 3.28), ('5', '7', 4.28), + ('1', '10', 5.8), ('5', '12', 3.3), + ('10', '11', 1.67), ('11', '12', 2.16), + ('9', '10', 2.32), ('3', '9', 5.02), + ] + +graph.add_weighted_edges_from(edge) + +nx.draw_planar(G=graph, with_labels=True, node_color='y', node_size=800, font_size=14, width=0.8) + +plt.show() + +print(nx.dijkstra_path(G=graph, source='0', target='12')) diff --git a/NetworkX Altas/Dijkstra's algorithms4.py b/NetworkX Altas/Dijkstra's algorithms4.py new file mode 100644 index 00000000..7b557592 --- /dev/null +++ b/NetworkX Altas/Dijkstra's algorithms4.py @@ -0,0 +1,25 @@ +import matplotlib.pyplot as plt +import networkx as nx + +graph = nx.Graph() + +edge = [('0', '1', 2.02), ('0', '3', 4.45), + ('0', '10', 6.2), ('1', '4', 1.7), + ('4', '5', 3.28), ('5', '7', 4.28), + ('1', '10', 5.8), ('5', '12', 3.3), + ('10', '11', 1.67), ('11', '12', 2.16), + ('9', '10', 2.32), ('3', '9', 5.02), + ] + +graph.add_weighted_edges_from(edge) + +nx.draw_planar(G=graph, with_labels=True, node_color='y', node_size=800, font_size=14, width=0.8) + +plt.show() + +print(nx.dijkstra_path(G=graph, source='0', target='12')) + +print(nx.dijkstra_path_length(G=graph, source='0', target='12')) + +# Further reading: +# https://networkx.org/documentation/stable/reference/algorithms/shortest_paths.html diff --git a/NetworkX Altas/Directed graph.py b/NetworkX Altas/Directed graph.py new file mode 100644 index 00000000..08f8586e --- /dev/null +++ b/NetworkX Altas/Directed graph.py @@ -0,0 +1,10 @@ +import networkx as nx +import matplotlib.pyplot as plt + +triangle_graph = nx.from_edgelist([(1, 2), (2, 3), (3, 1)], create_using=nx.DiGraph) +nx.draw_planar(triangle_graph, with_labels=True, node_size=1000, node_color="#ffff8f", + width=0.8, font_size=14) + +plt.show() + +# Reference: https://networkx.org/nx-guides/content/algorithms/dag/index.html diff --git a/NetworkX Altas/Identifying trees (cuts) in a circuit10.py b/NetworkX Altas/Identifying trees (cuts) in a circuit10.py new file mode 100644 index 00000000..9d5c7f71 --- /dev/null +++ b/NetworkX Altas/Identifying trees (cuts) in a circuit10.py @@ -0,0 +1,124 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="I", layer=3) +circuit.add_node(14, label="PO1", layer=3) + +# Layer 4 +circuit.add_node(15, label="PO2", layer=4) + + +circuit.add_edge(9, 15) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +circuit.add_edge(13, 15) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() + +print(nx.algorithms.tree.is_tree(G=circuit)) +print(nx.algorithms.tree.is_forest(G=circuit)) + +residential = nx.algorithms.cut_size(G=circuit, S={i for i in range(1, 6)}, T={j for j in range(14, 16)}) + +print(residential) diff --git a/NetworkX Altas/Identifying trees (cuts) in a circuit11.py b/NetworkX Altas/Identifying trees (cuts) in a circuit11.py new file mode 100644 index 00000000..1b29f418 --- /dev/null +++ b/NetworkX Altas/Identifying trees (cuts) in a circuit11.py @@ -0,0 +1,126 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="I", layer=3) +circuit.add_node(14, label="PO1", layer=3) + +# Layer 4 +circuit.add_node(15, label="PO2", layer=4) + + +circuit.add_edge(9, 15) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +circuit.add_edge(13, 15) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() + +print(nx.algorithms.tree.is_tree(G=circuit)) +print(nx.algorithms.tree.is_forest(G=circuit)) + +residential = nx.algorithms.cut_size(G=circuit, S={i for i in range(1, 6)}, T={j for j in range(14, 16)}) + +print(residential) + +print(nx.algorithms.is_directed_acyclic_graph(G=circuit)) diff --git a/NetworkX Altas/Identifying trees (cuts) in a circuit12.py b/NetworkX Altas/Identifying trees (cuts) in a circuit12.py new file mode 100644 index 00000000..cd1fb0d7 --- /dev/null +++ b/NetworkX Altas/Identifying trees (cuts) in a circuit12.py @@ -0,0 +1,134 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="I", layer=3) +circuit.add_node(14, label="PO1", layer=3) + +# Layer 4 +circuit.add_node(15, label="PO2", layer=4) + + +circuit.add_edge(9, 15) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +circuit.add_edge(13, 15) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() + +print(nx.algorithms.tree.is_tree(G=circuit)) +print(nx.algorithms.tree.is_forest(G=circuit)) + +residential = nx.algorithms.cut_size(G=circuit, S={i for i in range(1, 6)}, T={j for j in range(14, 16)}) + +print(residential) + +print(nx.algorithms.is_directed_acyclic_graph(G=circuit)) + +branching = nx.algorithms.dag_to_branching(G=circuit) + +nx.draw_planar(G=branching, with_labels=True, node_color='g', node_size=800, font_size=14, width=0.8) + +plt.show() + +print('\n', nx.algorithms.minimum_spanning_arborescence(G=circuit)) diff --git a/NetworkX Altas/Identifying trees (cuts) in a circuit13.py b/NetworkX Altas/Identifying trees (cuts) in a circuit13.py new file mode 100644 index 00000000..5b6d4298 --- /dev/null +++ b/NetworkX Altas/Identifying trees (cuts) in a circuit13.py @@ -0,0 +1,134 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="I", layer=3) +circuit.add_node(14, label="PO1", layer=3) + +# Layer 4 +circuit.add_node(15, label="PO2", layer=4) + + +circuit.add_edge(9, 15) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +circuit.add_edge(13, 15) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() + +print(nx.algorithms.tree.is_tree(G=circuit)) +print(nx.algorithms.tree.is_forest(G=circuit)) + +residential = nx.algorithms.cut_size(G=circuit, S={i for i in range(1, 6)}, T={j for j in range(14, 16)}) + +print(residential) + +print(nx.algorithms.is_directed_acyclic_graph(G=circuit)) + +branching = nx.algorithms.dag_to_branching(G=circuit) + +nx.draw_planar(G=branching, with_labels=True, node_color='g', node_size=800, font_size=14, width=0.8) + +plt.show() + +print('\n', nx.algorithms.minimum_branching(G=circuit)) diff --git a/NetworkX Altas/Identifying trees (cuts) in a circuit14.py b/NetworkX Altas/Identifying trees (cuts) in a circuit14.py new file mode 100644 index 00000000..dceb239c --- /dev/null +++ b/NetworkX Altas/Identifying trees (cuts) in a circuit14.py @@ -0,0 +1,134 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="I", layer=3) +circuit.add_node(14, label="PO1", layer=3) + +# Layer 4 +circuit.add_node(15, label="PO2", layer=4) + + +circuit.add_edge(9, 15) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +circuit.add_edge(13, 15) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() + +print(nx.algorithms.tree.is_tree(G=circuit)) +print(nx.algorithms.tree.is_forest(G=circuit)) + +residential = nx.algorithms.cut_size(G=circuit, S={i for i in range(1, 6)}, T={j for j in range(14, 16)}) + +print(residential) + +print(nx.algorithms.is_directed_acyclic_graph(G=circuit)) + +branching = nx.algorithms.dag_to_branching(G=circuit) + +nx.draw_planar(G=branching, with_labels=True, node_color='g', node_size=800, font_size=14, width=0.8) + +plt.show() + +print('\n', nx.algorithms.maximum_branching(G=circuit)) diff --git a/NetworkX Altas/Identifying trees (cuts) in a circuit15.py b/NetworkX Altas/Identifying trees (cuts) in a circuit15.py new file mode 100644 index 00000000..1f666c03 --- /dev/null +++ b/NetworkX Altas/Identifying trees (cuts) in a circuit15.py @@ -0,0 +1,140 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="I", layer=3) +circuit.add_node(14, label="PO1", layer=3) + +# Layer 4 +circuit.add_node(15, label="PO2", layer=4) + + +circuit.add_edge(9, 15) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +circuit.add_edge(13, 15) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() + +print(nx.algorithms.tree.is_tree(G=circuit)) +print(nx.algorithms.tree.is_forest(G=circuit)) + +residential = nx.algorithms.cut_size(G=circuit, S={i for i in range(1, 6)}, T={j for j in range(14, 16)}) + +print(residential) + +print(nx.algorithms.is_directed_acyclic_graph(G=circuit)) + +branching = nx.algorithms.dag_to_branching(G=circuit) + +nx.draw_planar(G=branching, with_labels=True, node_color='g', node_size=800, font_size=14, width=0.8) + +plt.show() + +print('\n', nx.algorithms.maximum_branching(G=circuit)) +print('\n') +print(nx.is_tree(circuit), '\n') +print(nx.is_forest(circuit), '\n') +print(nx.is_directed_acyclic_graph(circuit), '\n') +print(nx.is_arborescence(circuit), '\n') +print(nx.is_branching(circuit)) diff --git a/NetworkX Altas/Identifying trees (cuts) in a circuit5.py b/NetworkX Altas/Identifying trees (cuts) in a circuit5.py new file mode 100644 index 00000000..edac148d --- /dev/null +++ b/NetworkX Altas/Identifying trees (cuts) in a circuit5.py @@ -0,0 +1,124 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="I", layer=3) +circuit.add_node(14, label="PO1", layer=3) + +# Layer 4 +circuit.add_node(15, label="PO2", layer=4) + + +circuit.add_edge(9, 15) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +circuit.add_edge(13, 15) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() + +print(nx.algorithms.tree.is_tree(G=circuit)) +print(nx.algorithms.tree.is_forest(G=circuit)) + +residential = nx.algorithms.flow.minimum_cut(flowG=circuit, _s=[0, 1, 2, 3, 4], _t=[14, 15]) + +print(residential) diff --git a/NetworkX Altas/Identifying trees (cuts) in a circuit6.py b/NetworkX Altas/Identifying trees (cuts) in a circuit6.py new file mode 100644 index 00000000..9aa05754 --- /dev/null +++ b/NetworkX Altas/Identifying trees (cuts) in a circuit6.py @@ -0,0 +1,126 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="I", layer=3) +circuit.add_node(14, label="PO1", layer=3) + +# Layer 4 +circuit.add_node(15, label="PO2", layer=4) + + +circuit.add_edge(9, 15) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +circuit.add_edge(13, 15) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() + +print(nx.algorithms.tree.is_tree(G=circuit)) +print(nx.algorithms.tree.is_forest(G=circuit)) + +residential = nx.algorithms.flow.minimum_cut(flowG=circuit, + _s=["PI1", "PI2", "PI3", "PI4", "PI5"], + _t=["PO1", "PO2"]) + +print(residential) diff --git a/NetworkX Altas/Identifying trees (cuts) in a circuit7.py b/NetworkX Altas/Identifying trees (cuts) in a circuit7.py new file mode 100644 index 00000000..8b623b66 --- /dev/null +++ b/NetworkX Altas/Identifying trees (cuts) in a circuit7.py @@ -0,0 +1,124 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="I", layer=3) +circuit.add_node(14, label="PO1", layer=3) + +# Layer 4 +circuit.add_node(15, label="PO2", layer=4) + + +circuit.add_edge(9, 15) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +circuit.add_edge(13, 15) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() + +print(nx.algorithms.tree.is_tree(G=circuit)) +print(nx.algorithms.tree.is_forest(G=circuit)) + +residential = nx.algorithms.cut_size(G=circuit, S=[0, 1, 2, 3, 4], T=[14, 15]) + +print(residential) diff --git a/NetworkX Altas/Identifying trees (cuts) in a circuit8.py b/NetworkX Altas/Identifying trees (cuts) in a circuit8.py new file mode 100644 index 00000000..2dbf6b22 --- /dev/null +++ b/NetworkX Altas/Identifying trees (cuts) in a circuit8.py @@ -0,0 +1,124 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="I", layer=3) +circuit.add_node(14, label="PO1", layer=3) + +# Layer 4 +circuit.add_node(15, label="PO2", layer=4) + + +circuit.add_edge(9, 15) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +circuit.add_edge(13, 15) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() + +print(nx.algorithms.tree.is_tree(G=circuit)) +print(nx.algorithms.tree.is_forest(G=circuit)) + +residential = nx.algorithms.cut_size(G=circuit, S=[0, 1, 2, 3, 4]) + +print(residential) diff --git a/NetworkX Altas/Identifying trees (cuts) in a circuit9.py b/NetworkX Altas/Identifying trees (cuts) in a circuit9.py new file mode 100644 index 00000000..cd5d52cb --- /dev/null +++ b/NetworkX Altas/Identifying trees (cuts) in a circuit9.py @@ -0,0 +1,124 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="I", layer=3) +circuit.add_node(14, label="PO1", layer=3) + +# Layer 4 +circuit.add_node(15, label="PO2", layer=4) + + +circuit.add_edge(9, 15) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +circuit.add_edge(13, 15) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() + +print(nx.algorithms.tree.is_tree(G=circuit)) +print(nx.algorithms.tree.is_forest(G=circuit)) + +residential = nx.algorithms.cut_size(G=circuit, S=[i for i in range(1, 6)], T=[j for j in range(14, 16)]) + +print(residential) diff --git a/NetworkX Altas/Identifying trees in a circuit.py b/NetworkX Altas/Identifying trees in a circuit.py new file mode 100644 index 00000000..8ac4aed3 --- /dev/null +++ b/NetworkX Altas/Identifying trees in a circuit.py @@ -0,0 +1,115 @@ +import matplotlib.pyplot as plt +import networkx as nx + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) +circuit.add_edge(4, 12) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="I", layer=3) +circuit.add_node(14, label="PO1", layer=3) + +# Layer 4 +circuit.add_node(15, label="PO2", layer=4) + + +circuit.add_edge(9, 15) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +circuit.add_edge(13, 15) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() diff --git a/NetworkX Altas/Identifying trees in a circuit2.py b/NetworkX Altas/Identifying trees in a circuit2.py new file mode 100644 index 00000000..bcfd48ce --- /dev/null +++ b/NetworkX Altas/Identifying trees in a circuit2.py @@ -0,0 +1,116 @@ +import matplotlib.pyplot as plt +import networkx as nx + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="I", layer=3) +circuit.add_node(14, label="PO1", layer=3) + +# Layer 4 +circuit.add_node(15, label="PO2", layer=4) + + +circuit.add_edge(9, 15) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +circuit.add_edge(13, 15) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() diff --git a/NetworkX Altas/Identifying trees in a circuit3.py b/NetworkX Altas/Identifying trees in a circuit3.py new file mode 100644 index 00000000..528eafd8 --- /dev/null +++ b/NetworkX Altas/Identifying trees in a circuit3.py @@ -0,0 +1,120 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="I", layer=3) +circuit.add_node(14, label="PO1", layer=3) + +# Layer 4 +circuit.add_node(15, label="PO2", layer=4) + + +circuit.add_edge(9, 15) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +circuit.add_edge(13, 15) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() + +print(approximate.steiner_tree(G=circuit, terminal_nodes=[14, 15])) + diff --git a/NetworkX Altas/Identifying trees in a circuit4.py b/NetworkX Altas/Identifying trees in a circuit4.py new file mode 100644 index 00000000..c360d077 --- /dev/null +++ b/NetworkX Altas/Identifying trees in a circuit4.py @@ -0,0 +1,120 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="I", layer=3) +circuit.add_node(14, label="PO1", layer=3) + +# Layer 4 +circuit.add_node(15, label="PO2", layer=4) + + +circuit.add_edge(9, 15) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +circuit.add_edge(13, 15) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "blue", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +plt.title(formula_to_string(formula)) +plt.axis("equal") +plt.show() + +print(nx.algorithms.tree.is_tree(G=circuit)) +print(nx.algorithms.tree.is_forest(G=circuit)) diff --git a/NetworkX Altas/Independent set & bipartite graphs/Bipartite.py b/NetworkX Altas/Independent set & bipartite graphs/Bipartite.py new file mode 100644 index 00000000..eb48d017 --- /dev/null +++ b/NetworkX Altas/Independent set & bipartite graphs/Bipartite.py @@ -0,0 +1,11 @@ +import networkx as nx + +Bipartite = nx.Graph() + +Bipartite.add_nodes_from(["Bob", "Carl", "Diane", "Eve", "Frank", "George"], bipartite=0) +Bipartite.add_nodes_from(["George", "Frank", "Eve", "Diane", "Carl", "Bob"], bipartite=1) +Bipartite.add_edges_from([("Bob", "George"), ("Bob", "Frank"), ("Bob", "Eve")]) + +# Abandoned because this method is overly time-consuming. + +# Reference: https://stackoverflow.com/a/62519225/ diff --git a/NetworkX Altas/Independent set & bipartite graphs/Bipartite2.py b/NetworkX Altas/Independent set & bipartite graphs/Bipartite2.py new file mode 100644 index 00000000..40850c56 --- /dev/null +++ b/NetworkX Altas/Independent set & bipartite graphs/Bipartite2.py @@ -0,0 +1,34 @@ +import pandas as pd +import networkx as nx +import matplotlib.pyplot as plt + +df = pd.DataFrame(index=["Alice", "Bob", "Carl", "Diane", "Eve", "Frank", "George"], + columns=["Alice1", "Bob1", "Carl1", "Diane1", "Eve1", "Frank1", "George1"], + data=[ + [0, 1, 1, 1, 1, 1, 1], + [1, 0, 1, 1, 1, 1, 1], + [1, 1, 0, 1, 1, 1, 1], + [1, 1, 1, 0, 1, 1, 1], + [1, 1, 1, 1, 0, 1, 1], + [1, 1, 1, 1, 1, 0, 1], + [1, 1, 1, 1, 1, 1, 0] + ]) + +print(df) + +Bipartite = nx.Graph() +Bipartite.add_nodes_from(df.index, bipartite=0) +Bipartite.add_nodes_from(df.columns, bipartite=1) + +s = df.stack() +Bipartite.add_edges_from(s[s == 1].index) + +top = nx.bipartite.sets(G=Bipartite)[0] +pos = nx.bipartite_layout(G=Bipartite, nodes=top) + +nx.draw(Bipartite, pos=pos, node_color='lightgreen', node_size=2500, with_labels=True) + +plt.show() + + +# Reference: https://stackoverflow.com/a/61125791/ diff --git a/NetworkX Altas/Independent set & bipartite graphs/Bipartite3.py b/NetworkX Altas/Independent set & bipartite graphs/Bipartite3.py new file mode 100644 index 00000000..980a65e8 --- /dev/null +++ b/NetworkX Altas/Independent set & bipartite graphs/Bipartite3.py @@ -0,0 +1,34 @@ +import pandas as pd +import networkx as nx +import matplotlib.pyplot as plt + +df = pd.DataFrame(index=["i1", "i2", "i3", "i4", "i5", "i6", "i7"], + columns=["O1", "O2", "O3", "O4"], + data=[ + [1, 0, 0, 0], + [1, 1, 0, 0], + [0, 1, 0, 0], + [1, 1, 1, 0], + [0, 0, 0, 1], + [0, 0, 1, 1], + [0, 0, 0, 1] + ]) + +print(df) + +Bipartite = nx.Graph() +Bipartite.add_nodes_from(df.index, bipartite=0) +Bipartite.add_nodes_from(df.columns, bipartite=1) + +s = df.stack() +Bipartite.add_edges_from(s[s == 1].index) + +top = nx.bipartite.sets(G=Bipartite)[0] +pos = nx.bipartite_layout(G=Bipartite, nodes=top) + +nx.draw(Bipartite, pos=pos, node_color='lightgreen', node_size=500, with_labels=True) + +plt.show() + + +# Reference: https://stackoverflow.com/a/61125791/ diff --git a/NetworkX Altas/Independent set & bipartite graphs/Bipartite_layout.py b/NetworkX Altas/Independent set & bipartite graphs/Bipartite_layout.py new file mode 100644 index 00000000..e2edcdb9 --- /dev/null +++ b/NetworkX Altas/Independent set & bipartite graphs/Bipartite_layout.py @@ -0,0 +1,10 @@ +import networkx as nx +import matplotlib.pyplot as plt + +G = nx.bipartite.gnmk_random_graph(3, 5, 10, seed=123) +top = nx.bipartite.sets(G)[0] +pos = nx.bipartite_layout(G, top) + +nx.draw(G, pos=pos, node_color='lightgreen', node_size=500, with_labels=True, arrowstyle="->") + +plt.show() \ No newline at end of file diff --git a/NetworkX Altas/Independent set & bipartite graphs/Independent set.ipynb b/NetworkX Altas/Independent set & bipartite graphs/Independent set.ipynb new file mode 100644 index 00000000..2e08c9cd --- /dev/null +++ b/NetworkX Altas/Independent set & bipartite graphs/Independent set.ipynb @@ -0,0 +1,193 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "source": [ + "Independent set or stable set is a set of vertices in a graph, no two of which are adjacent.[1]\n", + "The size of an independent set is the number of vertices it contains.[1]" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%% md\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": true, + "pycharm": { + "name": "#%%\n" + } + }, + "outputs": [ + { + "data": { + "text/plain":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W265hX79+tG6dWuysrJYtGgRP/3pT/1mdFSvXj2mT5/O008/TVlZmek4jqSpThEx6sSJE7z66qvMnj2bH/3oR8THxxMXF0dISIjpaG5jWRY/+9nPGDt2LA899JDpOI6j4hMRIzIzM0lMTGTlypXExcUxceJEbrzxRtOxPCYtLY3hw4ezf/9+n5++9TWa6hQRjykpKbk4dXnfffcRHR3NoUOHeO211xxVegC9evWiW7duzJ4923QUx9GIT0Tc7ujRoyQlJfHqq6/StWtX4uPjufvuu6lXr57paEbt3r2bW2+9lYMHD9KkSRPTcRxDIz4RcQvLskhLS2Po0KF07dqVU6dOsX79etatW8egQYMcX3oA1157LXfeeSfPP/+86SiOohGfiNSpoqIiFi9eTGJiIufOnSM+Pp6HH35YI5oK/Oc//+GGG25g9+7dtG7d2nQcR1DxiUid+Pzzz5k1axbJycn07NmThIQEbr/99jrdJNpfPfHEExQWFup+n4eo+ESk1izLYv369cyYMYO0tDRGjhzJo48+SseOHU1H8ymnTp0iKiqKjIwMunTpYjqO31PxiUiNFRQU8M9//pPExESCgoJISEhg+PDhhIeHm47ms/70pz+xc+dOXn/9ddNR/J6KT0Sqbf/+/cycOZOUlBRuvfVWEhIS+PnPf+43u6qYdO7cObp06cLKlSvp3r276Th+TZPvIlKpsrIy3n33Xfr378/Pf/5zGjVqxCeffMKbb75J7969VXp1JDw8nGeffZb//d//ReMR99KIT0Qu6auvvmLevHnMmjWLZs2akZCQwP33369dRtzI5XLRtWtXEhMT6devn+k4fksjPhH5jl27djF27Fg6dOjAxx9/zOLFi9m6dSsPPfSQSs/NgoOD+dOf/sRTTz1FeXm56Th+S8UnIrhcLt544w169+7NwIEDadeuHfv27SMlJYWePXtqOtODBg8eTFBQkBa5uJGmOkUc7Pjx48yZM4ekpCQ6dOhAfHw89957L8HBwaajOdrGjRt55JFH2Lt3r1+fUmGKRnwiDnRh6jIqKorPP/+cd999lw8//JD7779fpecFbrnlFjp37syrr75qOopf0ohPxCHOnz/P66+/TmJiIsePH+fRRx9lz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HWhoMGFCT0V4f4CPgwoi1LbC/Wq8MD4c1a7TQxVd4z5yEiPi8oKCgiwVWkbKyMvLy8n5Qjjt27Lj459zcXJo2bVrpFnJt27YlNDS0wuskJ9dmFWci8EhNX0Rhob2ZvorPN6j4RMSj6tWrR5s2bWjTpg09e/a85NeUl5dfPNPx2x+7du36zskcjRs3rrAcN26MxbI8c9jxhe3PxDdoqlNEfNKFY6sudb/xP//JZdOm1UBNjm/pA+wBLCAKmPbN31VPcLA9raoTY7yfik9E/E5ODkRF1XSqcwsQDYQAS4F4YCdQvVMYwsJg/3490+cLnL2dg4j4pZIS+5SFmukJNALqAw8DscD71X51YKB9XfF+Kj4R8TshIfbRQpcnAHvas3rKy+3rivdT8YmI34mIsM/Tq74zwBqgGCgFFgEfAgOq/Q4ul31d8X4qPhHxO8HB9iGy1ecCngFaAM2BGcDbQJdqv0OHDlrY4iv0OIOI+KVeveDgwcoPmf1/LYBttb5WQICe4fMlGvGJiF8aNcpeaekJYWEwerRnriWXT48ziIhf0l6dUhGN+ETELwUEwJQp9j6a7hQebl9Hpec7NOITEb9lWdCnD2RkuO88vthY2LhRxedLVHwi4tfcfQL73r3Qtm3dv7e4j6Y6RcSvRUbCqlV1v9AlLMx+X5We71HxiYjfi42FtWvtEdrlHhAfFGS/z9q1eoTBV6n4RMQRYmMhKwtiYmq/4CU8/P/fR6Xnu1R8IuIYkZGQmgpJSfYjCOHhVS9KCQiwv65DB/t1GzfqBAZfp8UtIuJIlmWv9pw3zz5E9vBhe8uxwEB7w2mXyy672Fj74fSYGK3c9BcqPhER7KLLy7OPFgoJsTec1t6b/knFJyIijqJ7fCIi4igqPhERcRQVn4iIOIqKT0REHEXFJyIijqLiExERR1HxiYiIo6j4RETEUVR8IiLiKCo+ERFxFBWfiIg4iopPREQcRcUnIiKOouITERFHUfGJiIij/B9M9Z2GS7bpywAAAABJRU5ErkJggg==\n" + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{1, 5}\n" + ] + } + ], + "source": [ + "import networkx as nx\n", + "import matplotlib.pyplot as plt\n", + "\n", + "G = nx.Graph(incoming_graph_data=[(1, 2), (1, 3), (2, 3), (2, 4), (3, 5), (4, 5)])\n", + "\n", + "nx.draw(G=G, with_labels=True, node_color='b', node_size=800)\n", + "\n", + "plt.show()\n", + "\n", + "print(nx.approximation.maximum_independent_set(G=G))" + ] + }, + { + "cell_type": "markdown", + "source": [ + "References:\n", + "1. https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.approximation.clique.maximum_independent_set.html" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%% md\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 7, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAb4AAAEuCAYAAADx63eqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAA4YElEQVR4nO3deVhV1eLG8e8BnMCyQcWMUjEHRCgnSNC0SVO7V69lqVkomlMYXZu0LK+WklqaiZZaOJc5WzlEpaY4z0DgkJRFvzRzyFmm/ftjN5PFvA7nvJ/n4enR2Hu/lPKy1l57bYdlWRYiIiJuwsN0ABERkZKk4hMREbei4hMREbei4hMREbei4hMREbei4hMREbei4hMREbei4hMREbei4hMREbei4hMREbei4hMREbei4hMREbei4hMREbei4hMREbei4hMREbei4hMREbfiZTpAfmRmwtGjkJEBZcuCry+UKWM6lYiIlCZOXXyWBRs3wowZkJAAX31lF52HB+Tk2EVYqxa0aAG9ekF4ODgcplOLiIgzc1iWZZkO8WeWBXPnwvDh8MMPcP68/XuX43CAtzdUrQojRkCPHipAERH5a05XfOnp8NBDsHMnnDuX/+N9fKBJE5g3D/z8ij6fiIiUbk5VfAkJ0L49XLgAWVkFP4+XF1SoAKtW2dOfIiIiv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mup0ItnZ2TRq1IiRI0fSqVMn03HyxbIsRo0axdSpU1m8eDEhISGmI4k4vc2bNxMVFYWPjw+xsbEudY/fmWnE50Q8PT2JiYnhueeeIysry3ScPDt79iwPPPAAK1asYNu2bSo9kTxq3rw527Zto3v37tx1111ER0dz6tQp07FcnorPybRv354qVaowe/Zs01Hy5KuvviI8PJyKFSuydu1arrvuOtORREoVT0/PX+/xX7x4kYCAAGbOnKl3dhYjTXU6oS1btvDAAw+wf/9+KlSoYDrOZa1du5Zu3brx3HPPMWjQIC3RFikC27dvJyoqCk9PT2JjY2ncuLHpSC5HIz4ndOutt9KkSRMmT55sOspfsiyL2NhYunXrxrx583j88cdVeiJFpFmzZmzevJnevXvTvn17BgwYwIkTJ0zHcikqPic1evRoxo4d63Tz/ZcuXeLRRx9l6tSpbNq0iTvvvNN0JBGX4+HhQe/evUlJScHT05OAgACmT59Odna26WguQVOdTqx37974+voyevRo01EAOHLkCPfddx++vr7Mnj2bihUrmo4k4hZ2795NVFQUGRkZTJ48WQvICknF58S+/fZbbrnlFpKSkqhevbrRLDt27KBz58707t2bF154AQ8PTRaIlCTLspgzZw5DhgyhQ4cOjB49mipVqpiOVSrpu5cTu+GGG4iMjGTEiBFGc8ydO5d27doxceJEhg8frtITMcDhcPDII4+QmppKxYoVCQwMZMqUKZr+LACN+JzciRMnqFu3Lhs3bizxV5tkZ2czZMgQlixZwrJlywgKCirR64vI5SUlJREVFcXp06eZPHkyYWFhpiOVGiq+UiAmJoZdu3axcOHCErvmyZMn6datG1lZWbz//vtce+21JXZtEckby7KYP38+Tz/9NHfddRdjxozB19fXdCynpzmrUiA6OppNmzaxffv2ErleamoqoaGhBAQEsHr1apWeiJNyOBx069aN1NRUqlatSsOGDZk4cWKp2vnJBI34SompU6eyYMECPv3001zPzGVmwtGjkJEBZcuCry+UKVOw63z00UdERkYyduxYevbsWfjgIlJiUlNTGTRoEEePHiU2NpZWrVqZjuSUVHylRGZmJoGBgcTGxnL33W3YuBFmzICEBPj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XxGXdcsstbN++neDgYG6++Wbmz5+v0Z+UmPnz53PPPfcwfvx4RowYodJzIhrxiVvYvn07ERERNGjQgDfffJMqVaqYjiQuKjs7m2HDhvH++++zbNkygoODTUeSP9GPIOIWmjVrxq5du/D39yc4OJglS5aYjiQu6KeffuLf//43W7duZdu2bSo9J6URn7idTZs20bNnT5o1a8akSZO0GbAUif3799OxY0fatGnDa6+9ptdoOTGN+MTthIWFsWfPHqpUqUJQUBAfffSR6UhSyq1cuZKWLVvy9NNP88Ybb6j0nJxGfOLWPv/8c3r16kWrVq14/fXXqVSpkulIUopYlsXYsWN54403WLhwIWFhYaYjSR5oxCdurVWrViQmJlKhQgWCgoKIj483HUlKifPnz/PQQw+xaNEitm7dqtIrRVR84vYqVqzIlClTiIuL49FHH6Vfv36cOXPGdCxxYt988w0tW7bE09OT9evXa4egUkbFJ/Kzu+66i8TERLKysggODmbt2rWmI4kTSkhI4NZbb6V79+7Mnj2bChUqmI4k+aR7fCJ/YeXKlfTt25fOnTsTExODj4+P6UjiBKZNm8YLL7zA7Nmzadu2rek4UkAa8Yn8hfbt25OUlMTJkye55ZZb2Lhxo+lIYlBGRgYDBw7k9ddfJyEhQaVXymnEJ/IPli1bxsCBA+nevTsvvfSSprbczLFjx7j//vupVKkSc+fO5corrzQdSQpJIz6Rf9CpUycSExP59ttvady4MVu3bjUdSUrInj17aNasGbfddhvLli1T6bkIjfhE8mHBggU8/vjjREZGMnz4cMqVK2c6khSTBQsWEBUVxeTJk+nSpYvpOFKEVHwi+XT06FH69evHoUOHmDVrFo0bNzYdSYpQTk4OL7zwAu+++y5Lly7llltuMR1JipiKT6QALMti3rx5DB48mIEDB/L8889rmyoX8NNPP9GjRw/OnDnDwoUL9RYPF6V7fCIF4HA46NGjB7t372bbtm2EhoaSlJRkOpYUwoEDB7j11lupUaMGn3zyiUrPhan4RArh+uuvZ8WKFTz22GPccccdxMTEkJWVZTqW5NPq1atp2bIlgwcPJjY2VqN3F6epTpEi8s0339C7d29Onz7NzJkzCQgIMB1J/oFlWbz22muMHz+ehQsXEh4ebjqSlACN+ESKyI033kh8fDw9e/akZcuWvPbaa2RnZ5uOJZdx4cIFHn74YebPn8/WrVtVem5ExSdShBwOBwMGDGDbtm18+OGHtGrVioMHD5qOJX+Snp5Oy5YtsSyLDRs2cMMNN5iOJCVIxSdSDPz9/VmzZg1dunShefPmTJo0iZycHNOxBNi4cSOhoaE8+OCDzJ07VzvxuCHd4xMpZgcOHKBnz56UL1+euLg4atasaTqS23r77bd57rnnmDVrFu3atTMdRwzRiE+kmNWtW5cNGzbQrl07mjVrxrRp09DPmyUrMzOTqKgoXn31VRISElR6bk4jPpESlJKSQkREBNdccw1vv/227i2VgB9//JEuXbrg4+PDvHnzqFSpkulIYphGfCIlqEGDBmzevJmWLVvSpEkTZs6cqdFfMdq7dy/NmjWjefPmLF++XKUngEZ8Isbs3buXiIgIbrjhBqZNm8Z1111nOpJLWbRoEQMGDCA2NpYHH3zQdBxxIhrxiRhy8803s23bNho1asQtt9zCu+++q9FfEfhlk+knn3ySjz/+WKUnuWjEJ+IEduzYQUREBPXr1+fNN9+katWqpiOVSqdPn+bhhx/m5MmTLFq0SP8d5S9pxCfiBJo2bcrOnTupU6cOwcHBLFq0yHSkUufLL7+kefPmVK9enU8//VSlJ5elEZ+Ik9myZQsRERE0btyY2NhYrr32WtORnF58fDwPP/wwI0aMoH///qbjiJPTiE/Eydx6663s3r2b6667jqCgID744APTkZyWZVlMmDCBnj17smjRIpWe5IlGfCJObP369fTq1YsWLVowceJErrrqKtORnMbFixfp168fSUlJLFu2jBtvvNF0JCklNOITcWK33XYbe/fupWLFigQFBbF69WrTkZzCd999x2233calS5dISEhQ6Um+qPhEnFzFihWZPHkyM2fOpH///vTt25fTp0+bjmXM5s2bCQkJoXPnzrz33nt4e3ubjiSljIpPpJS48847SUxMxLIsgoODWbNmjelIJW7GjBl07NiRadOmMWTIEBwOh+lIUgrpHp9IKbRq1Sr69u1Lx44dGTNmDD4+PqYjFausrC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FPn5vbwgLAzWrfv7FZ8ixUkjPhH51c6dAVhWo2IpPbDvFe7caS92ETFFIz4RAexHFGrXtp/PK27+/vDllxr1iRka8YkIYD+c/sMP+TmiNVAeqPjzR708H3n0KGzalJ9riRQdFZ+IAPaOLPlf0BILnP35Y3+ejzp/HuLi8nstkaKh4hMRwH5ur6RufPyy/ZmICSo+ESEzs6D39oYClYFwYF2+jkxLK9jG1iKFpeITEY4etTeczp8xQBrwHdAX+BdwKM9HlyljX1ekpKn4RISMDPstC/kTClwBlAMisEd9K/N8tIeHfV2RkqbiExHKlrVfLVQ4DiDvNwlzcuzripQ0FZ+I4Oub3/ttp4CPgYtAFjAPWA/ck+czZGba1xUpaSo+EaFMGfslsnmXCQwDqmAvbpkELAPq5vkM/v4Fua8oUnhepgOIiHNo0QIOHszrIw1VgO0FvpbDYb+hXcQEjfhEBIBevew3p5cEb2+IjCyZa4n8mfbqFBFAe3WK+9CIT0QAu4RGjAAfn+K9jo+PfR2VnpiiEZ+I/MqyoHVrewPprKyiP7+Xl31vb+1aFZ+Yo+ITkT9IT4cGDeDMmaI/9xVXQGoqXH990Z9bJK801Skif+DnB6tWFf1CF29v+7wqPTFNxSciuYSHQ3y8PULzKuRDT15e9nni4/UIgzgHFZ+I/KXwcEhJgbCwgi948fH57TwqPXEWKj4RuSw/P1i3Dt56y34EwcfnnxelOBz25/n728etXWufR8RZaHGLiOSJZdmrPePi7JfIpqXZW455eNgbTmdm2mUXHm4/nB4WppWb4pxUfCJSIJmZ9vv0MjLstyz4+mrvTSkdVHwiIuJWdI9PRETciopPRETciopPRETciopPRETciopPRETciopPRETciopPRETciopPRETciopPRETciopPRETciopPRETciopPRETciopPRETciopPRETciopPRETcyv8DgR53ae4z3pUAAAAASUVORK5CYII=\n" + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{1, 5}\n", + "{1, 5}\n", + "{1, 5}\n" + ] + } + ], + "source": [ + "import networkx as nx\n", + "import matplotlib.pyplot as plt\n", + "\n", + "G = nx.Graph(incoming_graph_data=[(1, 2), (1, 3), (2, 3), (2, 4), (3, 5), (4, 5)])\n", + "\n", + "nx.draw(G=G, with_labels=True, node_color='b', node_size=800)\n", + "\n", + "plt.show()\n", + "\n", + "print(nx.approximation.maximum_independent_set(G=G))\n", + "print(nx.approximation.maximum_independent_set(G=G))\n", + "print(nx.approximation.maximum_independent_set(G=G))" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 8, + "outputs": [ + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAb4AAAEuCAYAAADx63eqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAyWElEQVR4nO3deXhV5bn+8e8OSSQJFAQkAhEFkVHGQIIEC4QZRKZstQZbEdtLq+eox3PUVlvEY4+1P7XaoxVHoBCl7gCCaCQi4DEhgRBGCQgxDIYhASFAJrKTrN8fS3bdKphh76w93J/ryqVN2Ws9Trl53/dZ67EZhmEgIiISJEKsLkBERKQpKfhERCSoKPhERCSoKPhERCSoKPhERCSoKPhERCSoKPhERCSoKPhERCSoKPhERCSoKPhERCSoKPhERCSoKPhERCSoKPhERCSoKPhERCSoKPhERCSoKPhERCSohFpdgMgFTicUFUFVFYSHQ3Q0hIVZXZWIBBoFn1jGMCAzExYsgIwMOHDADLqQEKitNYOwSxcYPhxmz4aEBLDZrK5aRPydzTAMw+oiJLgYBixZAnPnQnExlJeb37sYmw0iI6F9e5g3D2bNUgCKSMMp+KRJFRZCcjLk5kJZWf0/HxUFsbGQkgIxMZ6vT0QCn4JPmkxGBkyaBBUVUF3d8OuEhkJEBKSlmdufIiL1oeCTJpGRAePHm9uanhIZCenpCj8RqR8Fn3hdYSH07g3nznn+2i1bQl6et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KPhERCSoKPhERCSoKPhERCSoKPhERCSr/HwzetobGwvNvAAAAAElFTkSuQmCC\n" + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{1, 5}\n", + "{1, 5}\n", + "[3, 4]\n", + "[1, 5]\n" + ] + } + ], + "source": [ + "import networkx as nx\n", + "import matplotlib.pyplot as plt\n", + "\n", + "G = nx.Graph(incoming_graph_data=[(1, 2), (1, 3), (2, 3), (2, 4), (3, 5), (4, 5)])\n", + "\n", + "nx.draw(G=G, with_labels=True, node_color='b', node_size=800)\n", + "\n", + "plt.show()\n", + "\n", + "print(nx.approximation.maximum_independent_set(G=G))\n", + "print(nx.approximation.maximum_independent_set(G=G))\n", + "print(nx.maximal_independent_set(G=G))\n", + "print(nx.maximal_independent_set(G=G))" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "markdown", + "source": [ + "A maximal independent set is an independent set such that it is not possible to add a new node and still get an independent set.[2]\n", + "\n", + "Reference:\n", + "2. https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.mis.maximal_independent_set.html" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%% md\n" + } + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/NetworkX Altas/Independent set & bipartite graphs/Independent set.py b/NetworkX Altas/Independent set & bipartite graphs/Independent set.py new file mode 100644 index 00000000..84fcd30c --- /dev/null +++ b/NetworkX Altas/Independent set & bipartite graphs/Independent set.py @@ -0,0 +1,21 @@ +import networkx as nx +import matplotlib.pyplot as plt + +G = nx.path_graph(n=5) + +nx.draw(G=G, with_labels=True, node_color='y', node_size=800) + +plt.show() + +print(nx.maximal_independent_set(G=G)) +print(nx.maximal_independent_set(G=G)) +print(nx.maximal_independent_set(G=G)) +print(nx.maximal_independent_set(G=G)) +print(nx.maximal_independent_set(G=G, nodes=[0])) +print(nx.maximal_independent_set(G=G, nodes=[1])) +print(nx.maximal_independent_set(G=G, nodes=[2])) +print(nx.maximal_independent_set(G=G, nodes=[3])) +print(nx.maximal_independent_set(G=G, nodes=[4])) + +# Reference: +# https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.mis.maximal_independent_set.html#networkx.algorithms.mis.maximal_independent_set diff --git a/NetworkX Altas/Independent set & bipartite graphs/Matching & independent set.py b/NetworkX Altas/Independent set & bipartite graphs/Matching & independent set.py new file mode 100644 index 00000000..15c44c30 --- /dev/null +++ b/NetworkX Altas/Independent set & bipartite graphs/Matching & independent set.py @@ -0,0 +1,13 @@ +import networkx as nx +import matplotlib.pyplot as plt + +G = nx.Graph(incoming_graph_data=[(1, 2), (1, 3), (2, 3), (2, 4), (3, 5), (4, 5)]) + +nx.draw(G=G, with_labels=True, node_color='y', node_size=800) + +plt.show() + +print(nx.maximal_matching(G=G)) + +print(nx.is_matching(G=G, matching={(2, 4), (3, 5)})) +print(nx.maximal_independent_set(G=G)) \ No newline at end of file diff --git a/NetworkX Altas/Independent set & bipartite graphs/Matching.py b/NetworkX Altas/Independent set & bipartite graphs/Matching.py new file mode 100644 index 00000000..9bad4e0e --- /dev/null +++ b/NetworkX Altas/Independent set & bipartite graphs/Matching.py @@ -0,0 +1,14 @@ +import networkx as nx +import matplotlib.pyplot as plt + +G = nx.Graph(incoming_graph_data=[(1, 2), (1, 3), (2, 3), (2, 4), (3, 5), (4, 5)]) + +nx.draw(G=G, with_labels=True, node_color='y', node_size=800) + +plt.show() + +print(nx.maximal_matching(G=G)) + +# Reference: +# https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.matching.maximal_matching.html + diff --git a/NetworkX Altas/Independent set & bipartite graphs/__init__.py b/NetworkX Altas/Independent set & bipartite graphs/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/NetworkX Altas/Independent set & bipartite graphs/is_matching().py b/NetworkX Altas/Independent set & bipartite graphs/is_matching().py new file mode 100644 index 00000000..261c51a4 --- /dev/null +++ b/NetworkX Altas/Independent set & bipartite graphs/is_matching().py @@ -0,0 +1,15 @@ +import networkx as nx +import matplotlib.pyplot as plt + +G = nx.Graph(incoming_graph_data=[(1, 2), (1, 3), (2, 3), (2, 4), (3, 5), (4, 5)]) + +nx.draw(G=G, with_labels=True, node_color='y', node_size=800) + +plt.show() + +print(nx.maximal_matching(G=G)) + +print(nx.is_matching(G=G, matching={(2, 4), (3, 5)})) + +# Reference: +# https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.matching.is_matching.html#networkx.algorithms.matching.is_matching diff --git a/NetworkX Altas/Independent set & bipartite graphs/min_max_matching().py b/NetworkX Altas/Independent set & bipartite graphs/min_max_matching().py new file mode 100644 index 00000000..15e8bde5 --- /dev/null +++ b/NetworkX Altas/Independent set & bipartite graphs/min_max_matching().py @@ -0,0 +1,20 @@ +import networkx as nx +import matplotlib.pyplot as plt + +G = nx.Graph(incoming_graph_data=[(1, 2), (1, 3), (2, 3), (2, 4), (3, 5), (4, 5)]) + +nx.draw(G=G, with_labels=True, node_color='y', node_size=800) + +plt.show() + +print(nx.maximal_matching(G=G)) + +print(nx.is_matching(G=G, matching={(2, 4), (3, 5)})) +print(nx.maximal_independent_set(G=G)) + +# Returns the minimum maximal matching of G. +# That is, out of all maximal matchings of the graph G, the smallest is returned. +print(nx.algorithms.approximation.min_maximal_matching(G=G)) + +# Reference: +# https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.approximation.matching.min_maximal_matching.html#networkx.algorithms.approximation.matching.min_maximal_matching diff --git a/NetworkX Altas/Kernighan Partition.py b/NetworkX Altas/Kernighan Partition.py new file mode 100644 index 00000000..3ea08405 --- /dev/null +++ b/NetworkX Altas/Kernighan Partition.py @@ -0,0 +1,22 @@ +import matplotlib.pyplot as plt +import networkx as nx + +graph = nx.Graph() + +edge = [('0', '1', 2.02), ('0', '3', 4.45), + ('0', '10', 6.2), ('1', '4', 1.7), + ('4', '5', 3.28), ('5', '7', 4.28), + ('1', '10', 5.8), ('5', '12', 3.3), + ('10', '11', 1.67), ('11', '12', 2.16), + ('9', '10', 2.32), ('3', '9', 5.02), + ] + +graph.add_weighted_edges_from(edge) + +result = nx.algorithms.community.kernighan_lin_bisection(G=graph) + +print(result) + +nx.draw_planar(G=graph, with_labels=True, node_color='g', node_size=800, font_size=14, width=0.8) + +plt.show() diff --git a/NetworkX Altas/Minimum cut.py b/NetworkX Altas/Minimum cut.py new file mode 100644 index 00000000..fedba8c3 --- /dev/null +++ b/NetworkX Altas/Minimum cut.py @@ -0,0 +1,16 @@ +import networkx as nx +import matplotlib.pyplot as plt + +G = nx.DiGraph() +G.add_edge("x", "a", capacity=3.0) +G.add_edge("x", "b", capacity=1.0) +G.add_edge("a", "c", capacity=3.0) +G.add_edge("b", "c", capacity=5.0) +G.add_edge("b", "d", capacity=4.0) +G.add_edge("d", "e", capacity=2.0) +G.add_edge("c", "y", capacity=2.0) +G.add_edge("e", "y", capacity=3.0) + +nx.draw_planar(G=G, with_labels=True, node_color='g', node_size=800, font_size=14, width=0.8) + +plt.show() diff --git a/NetworkX Altas/Page209.py b/NetworkX Altas/Page209.py new file mode 100644 index 00000000..f5c8fa64 --- /dev/null +++ b/NetworkX Altas/Page209.py @@ -0,0 +1,17 @@ +import networkx as nx +import matplotlib.pyplot as plt + +vertices = ['A', 'B', 'C', 'D', 'E'] + +edges = [('A', 'B'), ('B', 'C'), ('B', 'D'), ('C', 'E'), ('E', 'D'), ('D', 'C')] + +directed_graph = nx.DiGraph() + +directed_graph.add_nodes_from(vertices) +directed_graph.add_edges_from(edges) + +nx.draw(G=directed_graph) + +nx.draw_planar(G=directed_graph) + +plt.show() diff --git a/NetworkX Altas/Prim's algorithm.py b/NetworkX Altas/Prim's algorithm.py new file mode 100644 index 00000000..fe76716e --- /dev/null +++ b/NetworkX Altas/Prim's algorithm.py @@ -0,0 +1,19 @@ +from networkx.algorithms import tree +import networkx as nx +import matplotlib.pyplot as plt + +G = nx.cycle_graph(4) +G.add_edge(0, 3, weight=2) + +nx.draw_planar(G=G, with_labels=True, node_color='g', node_size=800, font_size=14, width=0.8) + +plt.show() + +mst = tree.minimum_spanning_edges(G, algorithm="prim", data=False) + +edgelist = list(mst) + +print(sorted(sorted(e) for e in edgelist)) + +# Reference: +# https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.tree.mst.minimum_spanning_edges.html diff --git a/NetworkX Altas/Primary_input_output.py b/NetworkX Altas/Primary_input_output.py new file mode 100644 index 00000000..157f3a90 --- /dev/null +++ b/NetworkX Altas/Primary_input_output.py @@ -0,0 +1,116 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="PO1", layer=3) +circuit.add_node(14, label="PO2", layer=3) + + +circuit.add_edge(9, 13) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +print(nx.algorithms.tree.is_tree(G=circuit)) +print(nx.algorithms.tree.is_forest(G=circuit)) diff --git a/NetworkX Altas/Primary_input_output_(bipartie).py b/NetworkX Altas/Primary_input_output_(bipartie).py new file mode 100644 index 00000000..1a119d77 --- /dev/null +++ b/NetworkX Altas/Primary_input_output_(bipartie).py @@ -0,0 +1,115 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="PO1", layer=3) +circuit.add_node(14, label="PO2", layer=3) + + +circuit.add_edge(9, 13) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +print(nx.is_bipartite(G=circuit)) diff --git a/NetworkX Altas/Primary_input_output_(component).py b/NetworkX Altas/Primary_input_output_(component).py new file mode 100644 index 00000000..be88c766 --- /dev/null +++ b/NetworkX Altas/Primary_input_output_(component).py @@ -0,0 +1,123 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="PO1", layer=3) +circuit.add_node(14, label="PO2", layer=3) + + +circuit.add_edge(9, 13) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +print(list(nx.strongly_connected_components(G=circuit))) +print(list(nx.weakly_connected_components(G=circuit))) +# print(list(nx.connected_components(G=circuit))) +# print(nx.number_of_cliques(G=circuit)) +# print(nx.number_connected_components(G=circuit)) +print(nx.number_strongly_connected_components(G=circuit)) +print(nx.number_weakly_connected_components(G=circuit)) +print(nx.number_of_isolates(G=circuit)) + diff --git a/NetworkX Altas/Primary_input_output_(eccentricity).py b/NetworkX Altas/Primary_input_output_(eccentricity).py new file mode 100644 index 00000000..2976368d --- /dev/null +++ b/NetworkX Altas/Primary_input_output_(eccentricity).py @@ -0,0 +1,119 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="PO1", layer=3) +circuit.add_node(14, label="PO2", layer=3) + + +circuit.add_edge(9, 13) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +print(nx.algorithms.tree.is_tree(G=circuit)) +print(nx.algorithms.tree.is_forest(G=circuit)) + +ecc = nx.eccentricity(G=circuit, v=13) +print(ecc) diff --git a/NetworkX Altas/Primary_input_output_(isolation).py b/NetworkX Altas/Primary_input_output_(isolation).py new file mode 100644 index 00000000..7382a4b5 --- /dev/null +++ b/NetworkX Altas/Primary_input_output_(isolation).py @@ -0,0 +1,118 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="PO1", layer=3) +circuit.add_node(14, label="PO2", layer=3) + + +circuit.add_edge(9, 13) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +print(nx.isolates(G=circuit)) + +isolations = nx.isolates(G=circuit) +print(isolations) diff --git a/NetworkX Altas/Primary_input_output_(length).py b/NetworkX Altas/Primary_input_output_(length).py new file mode 100644 index 00000000..7737acdb --- /dev/null +++ b/NetworkX Altas/Primary_input_output_(length).py @@ -0,0 +1,118 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="PO1", layer=3) +circuit.add_node(14, label="PO2", layer=3) + + +circuit.add_edge(9, 13) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +print(len(circuit)) +print(circuit.size()) +print(circuit.number_of_edges()) +print(circuit.number_of_nodes()) diff --git a/NetworkX Altas/Primary_input_output_(predecessor).py b/NetworkX Altas/Primary_input_output_(predecessor).py new file mode 100644 index 00000000..b753a919 --- /dev/null +++ b/NetworkX Altas/Primary_input_output_(predecessor).py @@ -0,0 +1,121 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="PO1", layer=3) +circuit.add_node(14, label="PO2", layer=3) + + +circuit.add_edge(9, 13) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +# print(circuit.predecessors(n=8)) +print(list(circuit.predecessors(n=8))) # [1] +print(list(circuit.predecessors(n=10))) +print(list(circuit.predecessors(n=14))) + +# References: +# 1. https://stackoverflow.com/a/47161556 diff --git a/NetworkX Altas/Primary_input_output_(predecessors)2.py b/NetworkX Altas/Primary_input_output_(predecessors)2.py new file mode 100644 index 00000000..2a3e10ff --- /dev/null +++ b/NetworkX Altas/Primary_input_output_(predecessors)2.py @@ -0,0 +1,118 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="PO1", layer=3) +circuit.add_node(14, label="PO2", layer=3) + + +circuit.add_edge(9, 13) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +print(nx.predecessor(G=circuit, source=0, target=14)) +print(nx.predecessor(G=circuit, source=1, target=14)) +print(nx.predecessor(circuit, 10)) +print(nx.predecessor(circuit, 8)) diff --git a/NetworkX Altas/Primary_input_output_(shortest_paths).py b/NetworkX Altas/Primary_input_output_(shortest_paths).py new file mode 100644 index 00000000..0bc000b9 --- /dev/null +++ b/NetworkX Altas/Primary_input_output_(shortest_paths).py @@ -0,0 +1,120 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="PO1", layer=3) +circuit.add_node(14, label="PO2", layer=3) + + +circuit.add_edge(9, 13) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +print(nx.algorithms.tree.is_tree(G=circuit)) +print(nx.algorithms.tree.is_forest(G=circuit)) + +path = nx.shortest_simple_paths(G=circuit, source=3, target=14) +print(next(path)) +print(next(path)) diff --git a/NetworkX Altas/Primary_input_output_(successor).py b/NetworkX Altas/Primary_input_output_(successor).py new file mode 100644 index 00000000..adc2171e --- /dev/null +++ b/NetworkX Altas/Primary_input_output_(successor).py @@ -0,0 +1,119 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="PO1", layer=3) +circuit.add_node(14, label="PO2", layer=3) + + +circuit.add_edge(9, 13) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +# print(circuit.successors(n=8)) +print(list(circuit.successors(n=8))) # [1] + +# References: +# 1. https://stackoverflow.com/a/47161556 diff --git a/NetworkX Altas/Primary_input_output_(successors)2.py b/NetworkX Altas/Primary_input_output_(successors)2.py new file mode 100644 index 00000000..3de21eb0 --- /dev/null +++ b/NetworkX Altas/Primary_input_output_(successors)2.py @@ -0,0 +1,116 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="PO1", layer=3) +circuit.add_node(14, label="PO2", layer=3) + + +circuit.add_edge(9, 13) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +print(nx.bfs_successors(G=circuit, source=0)) +print(nx.dfs_successors(G=circuit, source=0)) diff --git a/NetworkX Altas/Primary_input_output_(successors)3.py b/NetworkX Altas/Primary_input_output_(successors)3.py new file mode 100644 index 00000000..ffe3f429 --- /dev/null +++ b/NetworkX Altas/Primary_input_output_(successors)3.py @@ -0,0 +1,123 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="I", layer=3) +circuit.add_node(14, label="J", layer=3) + +circuit.add_edge(9, 13) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +# Layer 4 (Primary outputs) +circuit.add_node(15, label="PO1", layer=4) +circuit.add_node(16, label="PO2", layer=4) + +circuit.add_edge(13, 15) +circuit.add_edge(14, 16) + + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +print(nx.bfs_successors(G=circuit, source=0)) +print(nx.dfs_successors(G=circuit, source=0)) diff --git a/NetworkX Altas/Primary_input_output_(successors)4.py b/NetworkX Altas/Primary_input_output_(successors)4.py new file mode 100644 index 00000000..5737913b --- /dev/null +++ b/NetworkX Altas/Primary_input_output_(successors)4.py @@ -0,0 +1,104 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) + +# Layer 1 +circuit.add_node(4, label="m", layer=1) +circuit.add_node(5, label="o", layer=1) +circuit.add_node(6, label="p", layer=1) + +circuit.add_edge(0, 4) +circuit.add_edge(0, 5) +circuit.add_edge(1, 4) +circuit.add_edge(2, 5) +circuit.add_edge(2, 6) +circuit.add_edge(3, 6) + +# Layer 2 +circuit.add_node(7, label="n", layer=2) + +circuit.add_edge(5, 7) +circuit.add_edge(6, 7) + +# Layer 3 +circuit.add_node(8, label="x", layer=3) + +circuit.add_edge(4, 8) +circuit.add_edge(7, 8) + +# Layer 4 (Primary outputs) +circuit.add_node(9, label="PO1", layer=4) + +circuit.add_edge(8, 9) + + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +print(nx.bfs_successors(G=circuit, source=0)) +print(nx.dfs_successors(G=circuit, source=0)) diff --git a/NetworkX Altas/Primary_input_output_(successors)5.py b/NetworkX Altas/Primary_input_output_(successors)5.py new file mode 100644 index 00000000..52c15a14 --- /dev/null +++ b/NetworkX Altas/Primary_input_output_(successors)5.py @@ -0,0 +1,104 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) + +# Layer 1 +circuit.add_node(4, label="m", layer=1) +circuit.add_node(5, label="o", layer=1) +circuit.add_node(6, label="p", layer=1) + +circuit.add_edge(0, 4) +circuit.add_edge(0, 5) +circuit.add_edge(1, 4) +circuit.add_edge(2, 5) +circuit.add_edge(2, 6) +circuit.add_edge(3, 6) + +# Layer 2 +circuit.add_node(7, label="n", layer=2) + +circuit.add_edge(5, 7) +circuit.add_edge(6, 7) + +# Layer 3 +circuit.add_node(8, label="x", layer=3) + +circuit.add_edge(4, 8) +circuit.add_edge(7, 8) + +# Layer 4 (Primary outputs) +# circuit.add_node(9, label="PO1", layer=4) + +# circuit.add_edge(8, 9) + + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +print(nx.bfs_successors(G=circuit, source=0)) +print(nx.dfs_successors(G=circuit, source=0)) diff --git a/NetworkX Altas/Undirected graph.py b/NetworkX Altas/Undirected graph.py new file mode 100644 index 00000000..fc22cba8 --- /dev/null +++ b/NetworkX Altas/Undirected graph.py @@ -0,0 +1,15 @@ +import networkx as nx +import matplotlib.pyplot as plt + +vertices = range(1, 13) + +edges = [(2, 8), (2, 3), (2, 6), (3, 0), (3, 9), (0, 1), (0, 10), (9, 10), (1, 4), (10, 11), (4, 5), + (11, 12), (12, 5), (5, 7)] + +directed_acyclic_graph = nx.Graph() +directed_acyclic_graph.add_nodes_from(vertices) +directed_acyclic_graph.add_edges_from(edges) + +nx.draw(G=directed_acyclic_graph, with_labels=True, node_color='y', node_size=800) + +plt.show() diff --git a/NetworkX Altas/__init__.py b/NetworkX Altas/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/NetworkX Altas/cosine.py b/NetworkX Altas/cosine.py new file mode 100644 index 00000000..8aebfb62 --- /dev/null +++ b/NetworkX Altas/cosine.py @@ -0,0 +1,13 @@ +import math + +import matplotlib.pyplot as plt +import networkx as nx + +graph = nx.Graph() + +graph.add_edge('y', 'x', function=math.cos) +graph.add_node(math.cos) + +nx.draw_planar(G=graph) + +plt.show() diff --git a/NetworkX Altas/cut_size_example.py b/NetworkX Altas/cut_size_example.py new file mode 100644 index 00000000..2c11eab3 --- /dev/null +++ b/NetworkX Altas/cut_size_example.py @@ -0,0 +1,15 @@ +import networkx as nx +import matplotlib.pyplot as plt + +graph = nx.barbell_graph(m1=3, m2=0) + +nx.draw_planar(G=graph, with_labels=True, node_color='g', node_size=800, font_size=14, width=0.8) + +plt.show() + +print(nx.algorithms.is_directed_acyclic_graph(graph)) + +print(nx.cut_size(graph, {0, 1, 2}, {3, 4, 5})) + +# Reference: +# https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.cuts.cut_size.html#networkx.algorithms.cuts.cut_size diff --git a/NetworkX Altas/cut_size_example2.py b/NetworkX Altas/cut_size_example2.py new file mode 100644 index 00000000..cb5b3b8e --- /dev/null +++ b/NetworkX Altas/cut_size_example2.py @@ -0,0 +1,12 @@ +import networkx as nx +import matplotlib.pyplot as plt + +graph = nx.MultiGraph(["ab", "ab"]) +S = {"a"} +T = {"b"} + +nx.draw_planar(G=graph, with_labels=True, node_color='g', node_size=800, font_size=14, width=0.8) + +plt.show() + +print(nx.cut_size(graph, {"a"}, {"b"})) diff --git a/NetworkX Altas/isolates().ipynb b/NetworkX Altas/isolates().ipynb new file mode 100644 index 00000000..ddc61f83 --- /dev/null +++ b/NetworkX Altas/isolates().ipynb @@ -0,0 +1,63 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": true, + "pycharm": { + "name": "#%%\n" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + ". at 0x0000019DF5AB6EC8>\n" + ] + }, + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAb4AAAEuCAYAAADx63eqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKZklEQVR4nO3dMUtceRfA4TM64gSSQdgVEjCwhaxTbSBptotprd1uP4H7Eaz9CMkn2NLaNqbbJoGkySRYLGQgAROQieAMM3rfQlwSXsbdOHe8kznP0+r9ewrlh3rvPbWiKIoAgCTmqh4AAK6T8AGQivABkIrwAZCK8AGQivABkIrwAZCK8AGQivABkIrwAZBKveoBoAofj/ux+7wT7Q/d6PaG0WzUo3W7Gb89WIkfbi5WPR4wQTXv6iSTl++O4vH+QTx7exgREf3h2T8fa9TnooiI9bXl2Hq4GvfuLlUzJDBRwkcaf/71d+zstaM3PI3LvutrtYhGfT62N1rx+68/Xdt8wPXwp05SOI/e6zgZnP3r5xZFxMngNHb2XkdEiB/MGDe3MPNevjuKnb32f4rel04GZ7Gz145XnaPJDAZUQviYeY/3D6I3PL3Stb3haTzZPyh5IqBKwsdM+3jcj2dvDy/9n95liiLi6ZvD+HTcL3cwoDLCx0zbfd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AV4QMgFeEDIBXhAyAV4QMgFeEDIBXhAyAV4QMgFeEDIBXhAyAV4QMgFeEDIBXhAyAV4QMgFeEDIBXhAyAV4QMgFeEDIBXhAyAV4QMgFeEDIBXhAyAV4QMgFeEDIBXhAyAV4QMgFeEDIBXhAyAV4QMgFeEDIJV61QMA/+/jcT92n3ei/aEb3d4wmo16tG4347cHK/HDzcWqx4PvWq0oiqLqIYBzL98dxeP9g3j29jAiIvrDs38+1qjPRRER62vLsfVwNe7dXapmSPjOCR9MiT//+jt29trRG57GZT+VtVpEoz4f2xut+P3Xn65tPpgV/tQJU+A8eq/jZHD2r59bFBEng9PY2XsdESF+8I3c3AIVe/nuKHb22v8pel86GZzFzl47XnWOJjMYzCjhg4o93j+I3vD0Stf2hqfxZP+g5IlgtgkfVOjjcT+evT289H96lymKiKdvDuPTcb/cwWCGCR9UaPd5Z+wzahGx+2L8cyAL4YMKtT90v3pk4Sp6w7Nov/9c0kQw+4QPKtTtDUs6Z1DKOZCB8EGFmo1ynihqNhZKOQcyED6oUOt2Mxbr4/0YNupz0bpzq6SJYPYJH1Ro88HK2GcUEbF5f/xzIAvhgwr9eHMxHv68HLXa1a6v1SIerS17cTV8A+GDiv2xvhqN+vyVrm3U52NrfbXkiWC2CR9U7N7dpdjeaMWNhW/7cbyxMBfbG634ZWVpMoPBjPKSapgCFy+atp0BJs9aIpgirzpH8WT/IJ6+OYxanD+cfuFiH9+jteXYWl/1mx5ckfDBFPp03I/dF51ov/8c3d4gmo2FaN25FZv3bWCHcQkfAKm4uQWAVIQPgFSED4BUhA+AVIQPgFSED4BUhA+AVIQPgFSED4BU/gf/5sPR2Gq7owAAAABJRU5ErkJggg==\n" + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "import networkx as nx\n", + "import matplotlib as plt\n", + "\n", + "G = nx.Graph()\n", + "G.add_nodes_from(\"ABCD\") # No edges -- all nodes are isolated\n", + "my_isolations = nx.isolates(G)\n", + "\n", + "nx.draw(G=G)\n", + "print(my_isolations)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/NetworkX Altas/predecessors of a node in a path.py b/NetworkX Altas/predecessors of a node in a path.py new file mode 100644 index 00000000..246e6616 --- /dev/null +++ b/NetworkX Altas/predecessors of a node in a path.py @@ -0,0 +1,15 @@ +import networkx as nx +import matplotlib.pyplot as plt + +G = nx.path_graph(n=7) + +nx.draw(G=G, with_labels=True, node_color='y', node_size=800) + +plt.show() + +print(nx.predecessor(G=G, source=0, target=6)) +print(nx.predecessor(G=G, source=1, target=4)) +print(nx.predecessor(G=G, source=2, target=5)) + +# Reference: +# 1. https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.shortest_paths.unweighted.predecessor.html diff --git a/NetworkX Altas/predecessors_of_a_path.py b/NetworkX Altas/predecessors_of_a_path.py new file mode 100644 index 00000000..9334b46d --- /dev/null +++ b/NetworkX Altas/predecessors_of_a_path.py @@ -0,0 +1,15 @@ +import networkx as nx +import matplotlib.pyplot as plt + +G = nx.path_graph(n=4) + +nx.draw(G=G, with_labels=True, node_color='y', node_size=800) + +plt.show() + +print(nx.predecessor(G=G, source=0, target=3)) +print(nx.predecessor(G=G, source=0, target=4)) +print(nx.predecessor(G=G, source=0, target=2)) + +# Reference: +# 1. https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.shortest_paths.unweighted.predecessor.html diff --git a/NetworkX Altas/topological sort 2.py b/NetworkX Altas/topological sort 2.py new file mode 100644 index 00000000..8933c3ea --- /dev/null +++ b/NetworkX Altas/topological sort 2.py @@ -0,0 +1,117 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="0", layer=0) +circuit.add_node(1, label="1", layer=0) +circuit.add_node(2, label="2", layer=0) +circuit.add_node(3, label="3", layer=0) +circuit.add_node(4, label="4", layer=0) + +# Layer 1 +circuit.add_node(5, label="5", layer=1) +circuit.add_node(6, label="6", layer=1) +circuit.add_node(7, label="7", layer=1) +circuit.add_node(8, label="8", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="9", layer=2) +circuit.add_node(10, label="10", layer=2) +circuit.add_node(11, label="11", layer=2) +circuit.add_node(12, label="12", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="13", layer=3) +circuit.add_node(14, label="14", layer=3) + + +circuit.add_edge(9, 13) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +print(list(nx.topological_sort(G=circuit))) +print(list(nx.topological_sort(G=circuit))) +print(list(nx.topological_sort(G=circuit))) diff --git a/NetworkX Altas/topological sort.py b/NetworkX Altas/topological sort.py new file mode 100644 index 00000000..17908161 --- /dev/null +++ b/NetworkX Altas/topological sort.py @@ -0,0 +1,117 @@ +import matplotlib.pyplot as plt +import networkx as nx +import networkx.algorithms.approximation as approximate + + +def circuit_to_formula(circuit): + # Convert the circuit to an equivalent formula. + formula = nx.dag_to_branching(circuit) + # Transfer the operator or variable labels for each node from the + # circuit to the formula. + for v in formula: + source = formula.nodes[v]["source"] + formula.nodes[v]["label"] = circuit.nodes[source]["label"] + return formula + + +def formula_to_string(formula): + def _to_string(formula, root): + # If there are no children, this is a variable node. + label = formula.nodes[root]["label"] + if not formula[root]: + return label + # Otherwise, this is an operator. + children = formula[root] + # If one child, the label must be a NOT operator. + if len(children) == 1: + child = nx.utils.arbitrary_element(children) + return f"{label}({_to_string(formula, child)})" + # NB "left" and "right" here are a little misleading: there is + # no order on the children of a node. That's okay because the + # Boolean AND and OR operators are symmetric. It just means that + # the order of the operands cannot be predicted and hence the + # function does not necessarily behave the same way on every + # invocation. + left, right = formula[root] + left_subformula = _to_string(formula, left) + right_subformula = _to_string(formula, right) + return f"({left_subformula} {label} {right_subformula})" + + root = next(v for v, d in formula.in_degree() if d == 0) + return _to_string(formula, root) + + +circuit = nx.DiGraph() +# Layer 0 +circuit.add_node(0, label="PI1", layer=0) +circuit.add_node(1, label="PI2", layer=0) +circuit.add_node(2, label="PI3", layer=0) +circuit.add_node(3, label="PI4", layer=0) +circuit.add_node(4, label="PI5", layer=0) + +# Layer 1 +circuit.add_node(5, label="A", layer=1) +circuit.add_node(6, label="B", layer=1) +circuit.add_node(7, label="C", layer=1) +circuit.add_node(8, label="D", layer=1) + +circuit.add_edge(0, 5) +circuit.add_edge(1, 5) +circuit.add_edge(1, 6) +circuit.add_edge(2, 6) +circuit.add_edge(2, 7) +circuit.add_edge(3, 7) +circuit.add_edge(3, 8) +circuit.add_edge(4, 8) + +# Layer 2 +circuit.add_node(9, label="E", layer=2) +circuit.add_node(10, label="F", layer=2) +circuit.add_node(11, label="G", layer=2) +circuit.add_node(12, label="H", layer=2) + +circuit.add_edge(4, 12) + +circuit.add_edge(5, 9) +circuit.add_edge(6, 9) +circuit.add_edge(6, 10) +circuit.add_edge(7, 10) +circuit.add_edge(7, 11) +circuit.add_edge(8, 11) + +# Layer 3 +circuit.add_node(13, label="PO1", layer=3) +circuit.add_node(14, label="PO2", layer=3) + + +circuit.add_edge(9, 13) +circuit.add_edge(10, 13) +circuit.add_edge(11, 13) +circuit.add_edge(11, 14) +circuit.add_edge(12, 14) + +# Convert the circuit to an equivalent formula. +formula = circuit_to_formula(circuit) +print(formula_to_string(formula)) + +labels = nx.get_node_attributes(circuit, "label") + +options = { + "node_size": 600, + "alpha": 0.5, + "node_color": "aqua", + "labels": labels, + "font_size": 22, +} + +plt.figure(figsize=(8, 8)) +pos = nx.multipartite_layout(circuit, subset_key="layer") +nx.draw_networkx(circuit, pos, **options) +# plt.title(formula_to_string(formula)) +plt.title(r'G = ($\nu_g \cup \nu_{io}$, $\mathit{E}$)') +plt.axis("equal") +plt.show() + +print(list(nx.topological_sort(G=circuit))) +print(list(nx.topological_sort(G=circuit))) +print(list(nx.topological_sort(G=circuit))) diff --git a/Pandas User Guide/Transpose().py b/Pandas User Guide/Transpose().py new file mode 100644 index 00000000..ad2a4494 --- /dev/null +++ b/Pandas User Guide/Transpose().py @@ -0,0 +1,11 @@ +import pandas as pd + +d1 = {'col1': [1, 2], 'col2': [3, 4]} +df1 = pd.DataFrame(data=d1) +print(df1) + +df1_transposed = df1.transpose() # or df1.T +print(df1_transposed) + +# Reference: +# https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.transpose.html diff --git a/Programming for Computations - Python/Chapter7 - Solving Nonlinear Algebraic Equations/Using_sympy_to_find_the_derivative.py b/Programming for Computations - Python/Chapter7 - Solving Nonlinear Algebraic Equations/Using_sympy_to_find_the_derivative.py new file mode 100644 index 00000000..3a7eacd1 --- /dev/null +++ b/Programming for Computations - Python/Chapter7 - Solving Nonlinear Algebraic Equations/Using_sympy_to_find_the_derivative.py @@ -0,0 +1,11 @@ +import sympy as sym + +x = sym.symbols('x') +f_expression = x**2 - 9 # symbolic expression for f(x) +dfdx_expression = sym.diff(f_expression, x) # compute f'(x) symbolically + +# turn f_expression and dfdx_expression into plan Python functions +f = sym.lambdify([x], f_expression) +dfdx = sym.lambdify([x], dfdx_expression) + +print(f(3), dfdx(3)) diff --git a/Programming for Computations - Python/Chapter7 - Solving Nonlinear Algebraic Equations/Using_sympy_to_find_the_derivative2.py b/Programming for Computations - Python/Chapter7 - Solving Nonlinear Algebraic Equations/Using_sympy_to_find_the_derivative2.py new file mode 100644 index 00000000..1a5bb324 --- /dev/null +++ b/Programming for Computations - Python/Chapter7 - Solving Nonlinear Algebraic Equations/Using_sympy_to_find_the_derivative2.py @@ -0,0 +1,11 @@ +import sympy as sym + +x = sym.symbols('x') +f_expression = x**2 - 9 # symbolic expression for f(x) +dfdx_expression = sym.diff(f_expression, x) # compute f'(x) symbolically + +# turn f_expression and dfdx_expression into plan Python functions +f = sym.lambdify(x, f_expression) +dfdx = sym.lambdify(x, dfdx_expression) + +print(f(3), dfdx(3)) diff --git a/Programming for Computations - Python/Chapter7 - Solving Nonlinear Algebraic Equations/Using_sympy_to_find_the_derivative3.py b/Programming for Computations - Python/Chapter7 - Solving Nonlinear Algebraic Equations/Using_sympy_to_find_the_derivative3.py new file mode 100644 index 00000000..e67fe147 --- /dev/null +++ b/Programming for Computations - Python/Chapter7 - Solving Nonlinear Algebraic Equations/Using_sympy_to_find_the_derivative3.py @@ -0,0 +1,11 @@ +import sympy as sym + +x = sym.symbols('x') +f_expression = x**2 - 9 # symbolic expression for f(x) +dfdx_expression = sym.diff(f_expression, x) # compute f'(x) symbolically + +# turn f_expression and dfdx_expression into plan Python functions +f = sym.lambdify(y, f_expression) +dfdx = sym.lambdify(y, dfdx_expression) + +print(f(3), dfdx(3)) diff --git a/Programming for Computations - Python/Chapter7 - Solving Nonlinear Algebraic Equations/__init__.py b/Programming for Computations - Python/Chapter7 - Solving Nonlinear Algebraic Equations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Programming for Computations - Python/__init__.py b/Programming for Computations - Python/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Python Algorithms/Chapter 3 - Counting 101/Recursion & Recurrences 2.py b/Python Algorithms/Chapter 3 - Counting 101/Recursion & Recurrences 2.py new file mode 100644 index 00000000..30fa69be --- /dev/null +++ b/Python Algorithms/Chapter 3 - Counting 101/Recursion & Recurrences 2.py @@ -0,0 +1,12 @@ +def T(seq, i=0): + if i == len(seq): + return 1 + + return T(seq, i+1) + 1 + + +sequence = "valiant" + +print(len(sequence)) + +print(T(sequence)) diff --git a/Python Algorithms/Chapter 3 - Counting 101/Recursion & Recurrences.ipynb b/Python Algorithms/Chapter 3 - Counting 101/Recursion & Recurrences.ipynb new file mode 100644 index 00000000..9e60cbbd --- /dev/null +++ b/Python Algorithms/Chapter 3 - Counting 101/Recursion & Recurrences.ipynb @@ -0,0 +1,34 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Python Algorithms/Chapter 3 - Counting 101/Recursion & Recurrences.py b/Python Algorithms/Chapter 3 - Counting 101/Recursion & Recurrences.py new file mode 100644 index 00000000..e2360ce8 --- /dev/null +++ b/Python Algorithms/Chapter 3 - Counting 101/Recursion & Recurrences.py @@ -0,0 +1,13 @@ +def S(seq, i=0): + if i == len(seq): + return 0 + return S(seq, i + 1) + seq[i] + + +sequence = "valiant" + +print(len(sequence)) + +print(S(seq=sequence, i=7)) + +print(S(sequence)) \ No newline at end of file diff --git a/Python Algorithms/Chapter 3 - Counting 101/__init__.py b/Python Algorithms/Chapter 3 - Counting 101/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Python Algorithms/Chapter 4 - Induction & Recursion/Oh, that's easy!.py b/Python Algorithms/Chapter 4 - Induction & Recursion/Oh, that's easy!.py new file mode 100644 index 00000000..5c088cd1 --- /dev/null +++ b/Python Algorithms/Chapter 4 - Induction & Recursion/Oh, that's easy!.py @@ -0,0 +1,22 @@ +from random import randrange + +sequence = [randrange(10**10) for i in range(100)] + +dd = float("inf") + +for x in sequence: + for y in sequence: + + if x == y: + continue + + d = abs(x - y) + + if d < dd: + xx, yy, dd = x, y, d + + print(xx, yy) + + + + diff --git a/Python Algorithms/Chapter 4 - Induction & Recursion/__init__.py b/Python Algorithms/Chapter 4 - Induction & Recursion/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Python Algorithms/__init__.py b/Python Algorithms/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Python Machine Learning For Beginners/Chapter5/Script1.py b/Python Machine Learning For Beginners/Chapter5/Script1.py new file mode 100644 index 00000000..ab1048fa --- /dev/null +++ b/Python Machine Learning For Beginners/Chapter5/Script1.py @@ -0,0 +1,9 @@ +import matplotlib.pyplot as plt +import numpy as np +import math + +x_vals = np.linspace(0, 20, 20) +y_vals = [math.sqrt(i) for i in x_vals] + +plt.plot(x_vals, y_vals) +plt.show() diff --git a/Python Machine Learning For Beginners/Chapter5/Script2.py b/Python Machine Learning For Beginners/Chapter5/Script2.py new file mode 100644 index 00000000..d7680b31 --- /dev/null +++ b/Python Machine Learning For Beginners/Chapter5/Script2.py @@ -0,0 +1,12 @@ +import matplotlib.pyplot as plt +import numpy as np +import math + +x_vals = np.linspace(0, 20, 20) +y_vals = [math.sqrt(i) for i in x_vals] + +fig = plt.figure() +ax = plt.axes() +ax.plot(x_vals, y_vals) + +plt.show() diff --git a/Python Machine Learning For Beginners/Chapter5/Script3.py b/Python Machine Learning For Beginners/Chapter5/Script3.py new file mode 100644 index 00000000..ca7f0999 --- /dev/null +++ b/Python Machine Learning For Beginners/Chapter5/Script3.py @@ -0,0 +1,13 @@ +import matplotlib.pyplot as plt +import numpy as np +import math + +# Set the plot size 8 inches wide and 6 inches tall. +plt.rcParams["figure.figsize"] = [8, 6] + +x_vals = np.linspace(0, 20, 20) +y_vals = [math.sqrt(i) for i in x_vals] + +plt.plot(x_vals, y_vals) + +plt.show() diff --git a/Python Machine Learning For Beginners/Chapter8 - Unsupervised Learning/Hierachical_clustering_on_dummy_data.py b/Python Machine Learning For Beginners/Chapter8 - Unsupervised Learning/Hierachical_clustering_on_dummy_data.py new file mode 100644 index 00000000..74d14f7e --- /dev/null +++ b/Python Machine Learning For Beginners/Chapter8 - Unsupervised Learning/Hierachical_clustering_on_dummy_data.py @@ -0,0 +1,19 @@ +import numpy as np +import pandas as pd +from sklearn.datasets._samples_generator import make_blobs +from matplotlib import pyplot as plt + +# generating dummy data of 10 records with 2 clusters. +features, labels = make_blobs(n_samples=10, centers=2, cluster_std=2.00) + +# plotting the dummy data +plt.scatter(x=features[:, 0], y=features[:, 1], color='r') + +# adding numbers to data points +annots = range(1, 11) + +for label, x, y in zip(annots, features[:, 0], features[:, 1]): + plt.annotate(text=label, xy=(x, y), xytext=(-3, 3), textcoords='offset points', ha='right', va='bottom') + + +plt.show() diff --git a/Python Machine Learning For Beginners/Chapter8 - Unsupervised Learning/Hierachical_clustering_on_dummy_data_2.py b/Python Machine Learning For Beginners/Chapter8 - Unsupervised Learning/Hierachical_clustering_on_dummy_data_2.py new file mode 100644 index 00000000..0ffa9c83 --- /dev/null +++ b/Python Machine Learning For Beginners/Chapter8 - Unsupervised Learning/Hierachical_clustering_on_dummy_data_2.py @@ -0,0 +1,27 @@ +import numpy as np +import pandas as pd +from sklearn.datasets._samples_generator import make_blobs +from matplotlib import pyplot as plt +from scipy.cluster.hierarchy import linkage, dendrogram + +# generating dummy data of 10 records with 2 clusters. +features, labels = make_blobs(n_samples=10, centers=2, cluster_std=2.00) + +# plotting the dummy data +plt.scatter(x=features[:, 0], y=features[:, 1], color='r') + +# adding numbers to data points +annots = np.arange(1, 11) + +for label, x, y in zip(annots, features[:, 0], features[:, 1]): + plt.annotate(text=label, xy=(x, y), xytext=(-3, 3), textcoords='offset points', ha='right', va='bottom') + + +plt.show() + +# Pass features to the constructor of linkage class. +dendros = linkage(y=features, method='single') + +dendrogram(Z=dendros, orientation='top', labels=annots, distance_sort='descending', show_leaf_counts=True) + +plt.show() diff --git a/Python Machine Learning by Example/Chapter14 - Reinforcement Learning/FrozenLake.py b/Python Machine Learning by Example/Chapter14 - Reinforcement Learning/FrozenLake.py new file mode 100644 index 00000000..02e8548d --- /dev/null +++ b/Python Machine Learning by Example/Chapter14 - Reinforcement Learning/FrozenLake.py @@ -0,0 +1,36 @@ +import gym + +environment = gym.make("FrozenLake-v1") + +number_of_state = environment.observation_space.n + +print(number_of_state) + +number_of_action = environment.action_space.n +print(number_of_action) + +environment.reset() + +environment.render() + +# Take a right action +new_state, reward, is_done, info = environment.step(2) +environment.render() + +print(new_state) +print(reward) +print(is_done) +print(info) + +def run_episode(environment, policy): + state = environment.reset() + total_reward = 0 + is_done = False + + while not is_done: + action = policy[state].item() + state, reward, is_done, info = environment.step(action) + total_reward += reward + if is_done: + break + return total_reward diff --git a/Python Machine Learning by Example/Chapter14 - Reinforcement Learning/FrozenLake_example_code.py b/Python Machine Learning by Example/Chapter14 - Reinforcement Learning/FrozenLake_example_code.py new file mode 100644 index 00000000..7e5c8631 --- /dev/null +++ b/Python Machine Learning by Example/Chapter14 - Reinforcement Learning/FrozenLake_example_code.py @@ -0,0 +1,22 @@ +import gym + +env = gym.make("FrozenLake-v1") + +n_state = env.observation_space.n +print(n_state) +n_action = env.action_space.n +print(n_action) + + +env.reset() + +env.render() + +# Source: https://github.com/PacktPublishing/Python-Machine-Learning-By-Example-Third-Edition/blob/master/chapter14/simulate_frozenlake.py + +new_state, reward, is_done, info = env.step(2) +env.render() +print(new_state) +print(reward) +print(is_done) +print(info) \ No newline at end of file diff --git a/Python Machine Learning by Example/Chapter14 - Reinforcement Learning/__init__.py b/Python Machine Learning by Example/Chapter14 - Reinforcement Learning/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Python equivalent for Cpp/Passing Objects to Functions.py b/Python equivalent for Cpp/Passing Objects to Functions.py new file mode 100644 index 00000000..e521377a --- /dev/null +++ b/Python equivalent for Cpp/Passing Objects to Functions.py @@ -0,0 +1,24 @@ +class MyClass: + + def __int__(self, value): + self.value = value + + def get_value(self): + return self.value + + def set_value(self, value): + self.value = value + + @staticmethod + def display(ob): + print(ob.get_value()) + print("\n") + @staticmethod + def change(ob): + ob.set_value(100) + print("Value of ob inside: ") + MyClass.display(ob) + + + + diff --git a/Python equivalent for Cpp/__init__.py b/Python equivalent for Cpp/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/Dictionary.ipynb b/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/Dictionary.ipynb new file mode 100644 index 00000000..f5746948 --- /dev/null +++ b/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/Dictionary.ipynb @@ -0,0 +1,36 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/Dictionary.py b/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/Dictionary.py new file mode 100644 index 00000000..c3916ebb --- /dev/null +++ b/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/Dictionary.py @@ -0,0 +1,18 @@ +from collections import defaultdict + +words = ['apple', 'bat', 'bar', 'atom', 'book'] + +by_letter = defaultdict(list) + +print(by_letter) + +for word in words: + by_letter[word[0]].append(word) + + +print(by_letter) +print('\n') +print(words) + +print(by_letter[0]) +print(by_letter[1]) diff --git a/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/Hashability.py b/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/Hashability.py new file mode 100644 index 00000000..b0408119 --- /dev/null +++ b/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/Hashability.py @@ -0,0 +1,15 @@ +print(hash('string')) + +print(hash((1, 2, (2, 3)))) + +try: + print(hash([1, 2])) # Fails because list is mutable. + +except TypeError: + print("TypeError: unhashable type: 'list'") + +try: + print(hash((1, 2, [2, 3]))) # fails because the third element of the tuple is mutable. + +except TypeError: + print("TypeError: unhashable type: 'list'") diff --git a/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/List.py b/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/List.py new file mode 100644 index 00000000..cb9f061f --- /dev/null +++ b/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/List.py @@ -0,0 +1,10 @@ +a = [7, 2, 5, 1, 3] + +a.sort() + +print(a) + +b = ['saw', 'small', 'He', 'foxes', 'six'] +b.sort(key=len) + +print(b) diff --git a/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/Set.ipynb b/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/Set.ipynb new file mode 100644 index 00000000..b6ab3249 --- /dev/null +++ b/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/Set.ipynb @@ -0,0 +1,132 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{1, 2, 3}\n" + ] + } + ], + "source": [ + "settler = [2, 2, 2, 1, 3, 3]\n", + "settler = set(settler)\n", + "print(settler)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{1, 2, 3}\n" + ] + } + ], + "source": [ + "settle = {2, 2, 2, 1, 3, 3}\n", + "print(settle)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{1, 2, 3, 4, 5, 6, 7, 8}\n", + "{1, 2, 3, 4, 5, 6, 7, 8}\n" + ] + } + ], + "source": [ + "a = {1, 2, 3, 4, 5}\n", + "b = {3, 4, 5, 6, 7, 8}\n", + "\n", + "print(a.union(b))\n", + "print(a | b)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 5, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{3, 4, 5}\n", + "{3, 4, 5}\n" + ] + } + ], + "source": [ + "print(a.intersection(b))\n", + "print(a & b)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/Tuple.ipynb b/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/Tuple.ipynb new file mode 100644 index 00000000..860b62e5 --- /dev/null +++ b/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/Tuple.ipynb @@ -0,0 +1,364 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(4, 5, 6)\n" + ] + } + ], + "source": [ + "tup = 4, 5, 6\n", + "print(tup)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "((4, 5, 6), (7, 8))\n" + ] + } + ], + "source": [ + "nested_tup = (4, 5, 6), (7, 8)\n", + "print(nested_tup)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 3, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(4, 0, 2)\n" + ] + } + ], + "source": [ + "print(tuple([4, 0, 2]))" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 4, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "('s', 't', 'r', 'i', 'n', 'g')\n" + ] + } + ], + "source": [ + "iterator = tuple('string')\n", + "print(iterator)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 5, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "('s', 't', 'r', 'i', 'n', 'g')\n" + ] + } + ], + "source": [ + "iterator2 = tuple(\"string\")\n", + "print(iterator2)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 6, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "s\n" + ] + } + ], + "source": [ + "print(iterator[0])" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 7, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "t\n" + ] + } + ], + "source": [ + "print(iterator2[1])" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 8, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "('foo', [1, 2], True)\n" + ] + } + ], + "source": [ + "immutable = tuple(['foo', [1, 2], True])\n", + "print(immutable)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 14, + "outputs": [ + { + "ename": "TypeError", + "evalue": "'tuple' object does not support item assignment", + "output_type": "error", + "traceback": [ + "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[1;31mTypeError\u001B[0m Traceback (most recent call last)", + "\u001B[1;32m~\\AppData\\Local\\Temp\\ipykernel_27468\\1483395061.py\u001B[0m in \u001B[0;36m\u001B[1;34m\u001B[0m\n\u001B[1;32m----> 1\u001B[1;33m \u001B[0mimmutable\u001B[0m\u001B[1;33m[\u001B[0m\u001B[1;36m2\u001B[0m\u001B[1;33m]\u001B[0m \u001B[1;33m=\u001B[0m \u001B[1;32mFalse\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m 2\u001B[0m \u001B[0mprint\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mimmutable\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n", + "\u001B[1;31mTypeError\u001B[0m: 'tuple' object does not support item assignment" + ] + } + ], + "source": [ + "immutable[2] = False\n", + "print(immutable)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 16, + "outputs": [ + { + "ename": "TypeError", + "evalue": "'tuple' object does not support item assignment", + "output_type": "error", + "traceback": [ + "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[1;31mTypeError\u001B[0m Traceback (most recent call last)", + "\u001B[1;32m~\\AppData\\Local\\Temp\\ipykernel_27468\\232738141.py\u001B[0m in \u001B[0;36m\u001B[1;34m\u001B[0m\n\u001B[1;32m----> 1\u001B[1;33m \u001B[0mimmutable\u001B[0m\u001B[1;33m[\u001B[0m\u001B[1;36m1\u001B[0m\u001B[1;33m]\u001B[0m \u001B[1;33m=\u001B[0m \u001B[1;33m[\u001B[0m\u001B[1;36m1\u001B[0m\u001B[1;33m,\u001B[0m \u001B[1;36m2\u001B[0m\u001B[1;33m,\u001B[0m \u001B[1;36m3\u001B[0m\u001B[1;33m]\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m 2\u001B[0m \u001B[0mprint\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mimmutable\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n", + "\u001B[1;31mTypeError\u001B[0m: 'tuple' object does not support item assignment" + ] + } + ], + "source": [ + "immutable[1] = [1, 2, 3]\n", + "print(immutable)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 11, + "outputs": [ + { + "ename": "TypeError", + "evalue": "'tuple' object does not support item assignment", + "output_type": "error", + "traceback": [ + "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[1;31mTypeError\u001B[0m Traceback (most recent call last)", + "\u001B[1;32m~\\AppData\\Local\\Temp\\ipykernel_27468\\3407988625.py\u001B[0m in \u001B[0;36m\u001B[1;34m\u001B[0m\n\u001B[1;32m----> 1\u001B[1;33m \u001B[0mimmutable\u001B[0m\u001B[1;33m[\u001B[0m\u001B[1;36m1\u001B[0m\u001B[1;33m]\u001B[0m \u001B[1;33m=\u001B[0m \u001B[0mimmutable\u001B[0m\u001B[1;33m[\u001B[0m\u001B[1;36m1\u001B[0m\u001B[1;33m]\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mappend\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;36m3\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m 2\u001B[0m \u001B[0mprint\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mimmutable\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n", + "\u001B[1;31mTypeError\u001B[0m: 'tuple' object does not support item assignment" + ] + } + ], + "source": [ + "immutable[1] = immutable[1].append(3)\n", + "print(immutable)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 13, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "('foo', [1, 2, 3, 3], True)\n" + ] + } + ], + "source": [ + "print(immutable)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 12, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "('foo', [1, 2, 3, 3], True)\n" + ] + } + ], + "source": [ + "immutable[1].append(3)\n", + "print(immutable)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 17, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(4, None, 'foo', 6, 0, 'bar')\n" + ] + } + ], + "source": [ + "immutability = (4, None, 'foo') + (6, 0) + ('bar', )\n", + "print(immutability)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/Tuple.py b/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/Tuple.py new file mode 100644 index 00000000..ced4c1e6 --- /dev/null +++ b/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/Tuple.py @@ -0,0 +1,10 @@ +immutable = tuple(['foo', [1, 2], True]) +print(immutable) + +# immutable[1] = [1, 2, 3] + +# immutable[1] = immutable[1].append(3) + +immutable[1].append(3) + +print(immutable) diff --git a/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/__init__.py b/Python for Data Analysis/Chapter3 - Built-in Data Structures & Functions/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Color, Markers, and Line Styles.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Color, Markers, and Line Styles.py new file mode 100644 index 00000000..7440bbd3 --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Color, Markers, and Line Styles.py @@ -0,0 +1,7 @@ +import matplotlib.pyplot as plt +import numpy as np +from numpy.random import randn + +plt.plot(randn(30).cumsum(), linestyle='--', color='k', marker='o') + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots.py new file mode 100644 index 00000000..ea425404 --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots.py @@ -0,0 +1,11 @@ +import matplotlib.pyplot as plt +import numpy as np + +fig = plt.figure() + +ax1 = fig.add_subplot(2, 2, 1) +ax2 = fig.add_subplot(2, 2, 2) +ax3 = fig.add_subplot(2, 2, 3) + +plt.show() + diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots10.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots10.py new file mode 100644 index 00000000..8b2a7de5 --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots10.py @@ -0,0 +1,11 @@ +import matplotlib.pyplot as plt +import numpy as np + +figure, axes = plt.subplots(nrows=2, ncols=3, figsize=(10, 6)) + +axes[0, 0].hist(np.random.randn(100), bins=20, color='k', alpha=0.3) +axes[0, 1].scatter(np.arange(30), np.arange(30) + 3 * np.random.randn(30)) +axes[0, 2].plot(np.random.randn(50).cumsum(), linestyle='--', color='k') +axes[1, 0].plot([1.5, 3.5, -2, 1.6]) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots11.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots11.py new file mode 100644 index 00000000..6e29fa59 --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots11.py @@ -0,0 +1,11 @@ +import matplotlib.pyplot as plt +import numpy as np + +figure, axes = plt.subplots(nrows=2, ncols=3, figsize=(10, 6), sharex=True, sharey=True) + +axes[0, 0].hist(np.random.randn(100), bins=20, color='k', alpha=0.3) +axes[0, 1].scatter(np.arange(30), np.arange(30) + 3 * np.random.randn(30)) +axes[0, 2].plot(np.random.randn(50).cumsum(), linestyle='--', color='k') +axes[1, 0].plot([1.5, 3.5, -2, 1.6]) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots12.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots12.py new file mode 100644 index 00000000..280b0c96 --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots12.py @@ -0,0 +1,12 @@ +import matplotlib.pyplot as plt +import numpy as np + +fig, axes = plt.subplots(nrows=2, ncols=2, sharex='True', sharey='True') + +for i in range(2): + for j in range(2): + axes[i, j].hist(np.random.randn(500), bins=50, color='k', alpha=0.5) + +plt.subplots_adjust(wspace=0, hspace=0) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots13.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots13.py new file mode 100644 index 00000000..4267ff5a --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots13.py @@ -0,0 +1,12 @@ +import matplotlib.pyplot as plt +import numpy as np + +fig, axes = plt.subplots(nrows=2, ncols=2, sharex=True, sharey=True) + +for i in range(2): + for j in range(2): + axes[i, j].hist(np.random.randn(500), bins=50, color='k', alpha=0.5) + +plt.subplots_adjust(wspace=0, hspace=0) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots14.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots14.py new file mode 100644 index 00000000..9aa1019a --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots14.py @@ -0,0 +1,12 @@ +import matplotlib.pyplot as plt +import numpy as np + +fig, axes = plt.subplots(nrows=2, ncols=2, sharex='row', sharey='col') + +for i in range(2): + for j in range(2): + axes[i, j].hist(np.random.randn(500), bins=50, color='k', alpha=0.5) + +plt.subplots_adjust(wspace=0, hspace=0) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots2.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots2.py new file mode 100644 index 00000000..be3a6cc7 --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots2.py @@ -0,0 +1,10 @@ +import matplotlib.pyplot as plt +import numpy as np + +figure = plt.figure() + +axes1 = figure.add_subplot(2, 2, 1) +axes2 = figure.add_subplot(2, 2, 2) +axes3 = figure.add_subplot(2, 2, 3) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots3.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots3.py new file mode 100644 index 00000000..e7d10234 --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots3.py @@ -0,0 +1,12 @@ +import matplotlib.pyplot as plt +import numpy as np + +figure = plt.figure() + +axes1 = figure.add_subplot(2, 2, 1) +axes2 = figure.add_subplot(2, 2, 2) +axes3 = figure.add_subplot(2, 2, 3) + +plt.plot(np.random.randn(50).cumsum(), 'k--') + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots4.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots4.py new file mode 100644 index 00000000..c964af58 --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots4.py @@ -0,0 +1,8 @@ +import matplotlib.pyplot as plt + +# When you directly issue a plotting command like the following: +plt.plot([1.5, 3.5, -2, 1.6]) +# matplotlib draws on the last figure and subplot used (automatically creating one if necessary), +# thus skipping the need for you to create the figure and subplot. + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots5.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots5.py new file mode 100644 index 00000000..40e88c52 --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots5.py @@ -0,0 +1,14 @@ +import matplotlib.pyplot as plt +import numpy as np + +figure = plt.figure() + +axes1 = figure.add_subplot(2, 2, 1) +axes2 = figure.add_subplot(2, 2, 2) +axes3 = figure.add_subplot(2, 2, 3) + +axes1.hist(np.random.randn(100), bins=20, color='k', alpha=0.3) +axes2.scatter(np.arange(30), np.arange(30) + 3 * np.random.randn(30)) +axes3.plot([1.5, 3.5, -2, 1.6]) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots6.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots6.py new file mode 100644 index 00000000..e1ec875a --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots6.py @@ -0,0 +1,13 @@ +import matplotlib.pyplot as plt +import numpy as np + +figure = plt.figure() +axes1 = figure.add_subplot(2, 2, 1) +axes2 = figure.add_subplot(2, 2, 2) +axes3 = figure.add_subplot(2, 2, 3) + +axes3.plot(np.random.randn(50).cumsum(), linestyle='--', color='k') +axes2.scatter(np.arange(30), np.arange(30) + 3 * np.random.randn(30)) +axes1.hist(np.random.randn(100), bins=20, color='k', alpha=0.3) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots7.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots7.py new file mode 100644 index 00000000..4f1ca357 --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots7.py @@ -0,0 +1,11 @@ +import matplotlib.pyplot as plt +import numpy as np + +figure, axes = plt.subplots(nrows=2, ncols=3, figsize=(8, 6)) + +axes[1, 1].hist(np.random.randn(100), bins=20, color='k', alpha=0.3) +axes[1, 2].scatter(np.arange(30), np.arange(30) + 3 * np.random.randn(30)) +axes[1, 3].plot(np.random.randn(50).cumsum(), linestyle='--', color='k') +axes[2, 1].plot([1.5, 3.5, -2, 1.6]) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots8.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots8.py new file mode 100644 index 00000000..ad0eb5aa --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots8.py @@ -0,0 +1,11 @@ +import matplotlib.pyplot as plt +import numpy as np + +figure, axes = plt.subplots(nrows=2, ncols=3, figsize=(8, 6)) + +axes[1, 0].hist(np.random.randn(100), bins=20, color='k', alpha=0.3) +axes[1, 1].scatter(np.arange(30), np.arange(30) + 3 * np.random.randn(30)) +axes[1, 2].plot(np.random.randn(50).cumsum(), linestyle='--', color='k') +axes[2, 1].plot([1.5, 3.5, -2, 1.6]) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots9.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots9.py new file mode 100644 index 00000000..830d4246 --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Figures and Subplots9.py @@ -0,0 +1,11 @@ +import matplotlib.pyplot as plt +import numpy as np + +figure, axes = plt.subplots(nrows=2, ncols=3, figsize=(8, 6)) + +axes[0, 0].hist(np.random.randn(100), bins=20, color='k', alpha=0.3) +axes[0, 1].scatter(np.arange(30), np.arange(30) + 3 * np.random.randn(30)) +axes[0, 2].plot(np.random.randn(50).cumsum(), linestyle='--', color='k') +axes[1, 0].plot([1.5, 3.5, -2, 1.6]) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Primer.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Primer.py new file mode 100644 index 00000000..a6f9a366 --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Primer.py @@ -0,0 +1,9 @@ +import matplotlib.pyplot as plt +import numpy as np + +data = np.arange(10) +print(data) + +plt.plot(data) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Setting the title, axis labels, ticks and ticklabels.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Setting the title, axis labels, ticks and ticklabels.py new file mode 100644 index 00000000..70b12e93 --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Setting the title, axis labels, ticks and ticklabels.py @@ -0,0 +1,8 @@ +import matplotlib.pyplot as plt +import numpy as np + +fig = plt.figure() + +ax = fig.add_subplot(1, 1, 1) + +ax.plot(np.random.randn(1000).cumsum()) diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Steps-post.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Steps-post.py new file mode 100644 index 00000000..1b5696fd --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Steps-post.py @@ -0,0 +1,13 @@ +import matplotlib.pyplot as plt +import numpy as np +from numpy.random import randn + +data = np.random.randn(30).cumsum() + +plt.plot(data, color='k', linestyle='--', label='default') + +plt.plot(data, color='k', linestyle='--', drawstyle='steps-post', label='steps-post') + +plt.legend(loc='best') + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label.py new file mode 100644 index 00000000..266cea75 --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label.py @@ -0,0 +1,8 @@ +import matplotlib.pyplot as plt +import numpy as np + +figure, axes = plt.subplots(nrows=1, ncols=1, figsize=(8, 6)) + +axes[0, 0].plot(np.random.randn(1000).cumsum()) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label2.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label2.py new file mode 100644 index 00000000..0f4c1cdc --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label2.py @@ -0,0 +1,11 @@ +import matplotlib.pyplot as plt +import numpy as np + +# There is no need to follow figure, axes = plt.subplots() +# if you are not planning to plot multiple subplots in the same figure. + +plt.rcParams["figure.figsize"] = [8, 6] + +plt.plot(np.random.randn(1000).cumsum()) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label_.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label_.py new file mode 100644 index 00000000..c93aac46 --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label_.py @@ -0,0 +1,10 @@ +import matplotlib.pyplot as plt +import numpy as np + +figure = plt.figure() + +ax = figure.add_subplot(1, 1, 1) + +ax.plot(np.random.randn(1000).cumsum()) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label_2.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label_2.py new file mode 100644 index 00000000..672e0b34 --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label_2.py @@ -0,0 +1,10 @@ +import matplotlib.pyplot as plt +import numpy as np + +figure = plt.figure() + +axes1 = figure.add_subplot(1, 1, 1) + +axes1.plot(np.random.randn(1000).cumsum()) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label_3.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label_3.py new file mode 100644 index 00000000..3a01fffe --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label_3.py @@ -0,0 +1,13 @@ +import matplotlib.pyplot as plt +import numpy as np + +# Call the figure() method via the plt module, which draws an empty figure. +figure = plt.figure() + +# Next, call the axes() method, which returns an axes object. +axes = plt.axes() + +# You can then call the plot() method from the axes object to create a plot. +axes.plot(np.random.randn(1000).cumsum()) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label_4.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label_4.py new file mode 100644 index 00000000..be550ce1 --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label_4.py @@ -0,0 +1,9 @@ +import matplotlib.pyplot as plt +import numpy as np + +figure = plt.figure(figsize=(8, 6)) +axes = plt.axes() + +axes.plot(np.random.randn(1000).cumsum()) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label_5.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label_5.py new file mode 100644 index 00000000..6a10c6d0 --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label_5.py @@ -0,0 +1,14 @@ +import matplotlib.pyplot as plt +import numpy as np + +figure = plt.figure(figsize=(8, 6)) +axes = plt.axes() +axes.plot(np.random.randn(1000).cumsum()) + +ticks = axes.set_xticks([0, 250, 500, 750, 1000]) +labels = axes.set_xticklabels(['one', 'two', 'three', 'four', 'five'], rotation=30, fontsize='small') + +axes.set_title('My first matplotlib plot') +axes.set_xlabel('Stages') + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label_6.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label_6.py new file mode 100644 index 00000000..08763f9e --- /dev/null +++ b/Python for Data Analysis/Chapter9 - Plotting and Visualization/Tick_and_tick_label_6.py @@ -0,0 +1,14 @@ +import matplotlib.pyplot as plt +import numpy as np + +figure = plt.figure(num=1, figsize=(8, 6),) +axes = plt.axes() +axes.plot(np.random.randn(1000).cumsum()) + +axes.set_xticks([0, 250, 500, 750, 1000]) +axes.set_xticklabels(['one', 'two', 'three', 'four', 'five'], rotation=30, fontsize='small') + +axes.set_yticks([0, 10, 20, 30, 40, 50, 60]) +axes.set_yticklabels(['0.0', '10.0', '20.0', '30.0', '40.0', '50.0', '60.0']) + +plt.show() diff --git a/Python for Data Analysis/Chapter9 - Plotting and Visualization/__init__.py b/Python for Data Analysis/Chapter9 - Plotting and Visualization/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Python for Excel/Chapter5 - Data Analysis with pandas/Applying a function.py b/Python for Excel/Chapter5 - Data Analysis with pandas/Applying a function.py new file mode 100644 index 00000000..33e01cab --- /dev/null +++ b/Python for Excel/Chapter5 - Data Analysis with pandas/Applying a function.py @@ -0,0 +1,16 @@ +import pandas as pd + +rainfall = pd.DataFrame(data=[[300.1, 400.1, 1000.5], + [100.2, 300.4, 1100.6]], + columns=["City 1", "City 2", "City 3"]) + +print(rainfall) + +def format_string(x): + return f"{x:,.2f}" + + +# Note that we pass in the function without calling it. +rainfall.applymap(format_string) + +print(rainfall) diff --git a/Python for Excel/Chapter5 - Data Analysis with pandas/Applying a function2.py b/Python for Excel/Chapter5 - Data Analysis with pandas/Applying a function2.py new file mode 100644 index 00000000..f89371d3 --- /dev/null +++ b/Python for Excel/Chapter5 - Data Analysis with pandas/Applying a function2.py @@ -0,0 +1,11 @@ +import pandas as pd + +rainfall = pd.DataFrame(data=[[300.1, 400.1, 1000.5], + [100.2, 300.4, 1100.6]], + columns=["City 1", "City 2", "City 3"]) + +print(rainfall) + +rainfall.applymap(lambda x: f"{x:,.2f}") + +print(rainfall) diff --git a/Python for Excel/Chapter5 - Data Analysis with pandas/Arithmetic Operations.py b/Python for Excel/Chapter5 - Data Analysis with pandas/Arithmetic Operations.py new file mode 100644 index 00000000..9f3f517e --- /dev/null +++ b/Python for Excel/Chapter5 - Data Analysis with pandas/Arithmetic Operations.py @@ -0,0 +1,26 @@ +import pandas as pd + +rainfall = pd.DataFrame(data=[[300.1, 400.3, 1000.5], + [100.2, 300.4, 1100.6]], + columns=["City1", "City2", "City3"]) + +print(rainfall) + +rainfall_plus = rainfall + 100 + +print(rainfall_plus) + +more_rainfall = pd.DataFrame(data=[[100, 200], + [300, 400]], index=[1, 2], columns=["City 1", "City 4"]) + +print(more_rainfall) + +more_rainfall_plus = rainfall + more_rainfall + +print(more_rainfall_plus) + +summation = rainfall.loc[1, :] + rainfall +print(summation) + +summation2 = rainfall.add(rainfall.loc[:, "City2"], axis=0) +print(summation2) diff --git a/Python for Excel/Chapter5 - Data Analysis with pandas/Concatenation.py b/Python for Excel/Chapter5 - Data Analysis with pandas/Concatenation.py new file mode 100644 index 00000000..68e13af3 --- /dev/null +++ b/Python for Excel/Chapter5 - Data Analysis with pandas/Concatenation.py @@ -0,0 +1,23 @@ +import pandas as pd + +more_users = pd.DataFrame(data=[[15, "France", 4.1, "Becky"], + [44, "Canada", 6.1, "Leanne"]], + columns=['age', 'country', 'score', 'name'], + index=[1000, 1011]) + +print(more_users) + +data = [["Mark", 55, "Italy", 4.5, "Europe"], + ["John", 33, "USA", 6.7, "America"], + ["Tim", 41, "USA", 3.9, "America"], + ["Jenny", 12, "Germany", 9.0, "Europe"] + ] + +df = pd.DataFrame(data=data, columns=["name", "age", "country", "score", "continent"], + index=[1001, 1000, 1002, 1003]) + +glue = pd.concat([df, more_users], axis=0) +print(glue) + +glue2 = pd.concat([df, more_users], axis=1) +print(glue2) diff --git a/Python for Excel/Chapter5 - Data Analysis with pandas/Joining.py b/Python for Excel/Chapter5 - Data Analysis with pandas/Joining.py new file mode 100644 index 00000000..75b02844 --- /dev/null +++ b/Python for Excel/Chapter5 - Data Analysis with pandas/Joining.py @@ -0,0 +1,3 @@ +import pandas as pd + + diff --git a/Python.iml b/Python.iml index 798190b0..4fd3ff0d 100644 --- a/Python.iml +++ b/Python.iml @@ -2,8 +2,10 @@ - - + + + + diff --git a/Supplementary materials/Algorithms/Binary_Search_Tree.py b/Supplementary materials/Algorithms/Binary_Search_Tree.py new file mode 100644 index 00000000..0f3fcfe9 --- /dev/null +++ b/Supplementary materials/Algorithms/Binary_Search_Tree.py @@ -0,0 +1,21 @@ +class binaryTree: + + # Constructor + def __init__(self, nodeData, left=None, right=None): + self.nodeData = nodeData + self.left = left + self.right = right + + def __str__(self): + return str(self.nodeData) + + +root_node = binaryTree("Root") +branch_A = binaryTree(nodeData="Branch A", left=leaf_C, right=leaf_D) +leaf_C = binaryTree(nodeData="Leaf C", left=None, right=None) +leaf_D = binaryTree(nodeData="Leaf D", left=None, right=None) +branch_B = binaryTree(nodeData="Branch B", left=Leaf_E, right=Leaf_F) +leaf_E = binaryTree(nodeData="Leaf E", left=None, right=None) + + + diff --git a/Supplementary materials/Algorithms/__init__.py b/Supplementary materials/Algorithms/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Supplementary materials/Matplotlib/Display the value of bar on each bar.py b/Supplementary materials/Matplotlib/Display the value of bar on each bar.py new file mode 100644 index 00000000..70559d62 --- /dev/null +++ b/Supplementary materials/Matplotlib/Display the value of bar on each bar.py @@ -0,0 +1,18 @@ +import numpy as np +import matplotlib.pyplot as plt + +x = [u'INFO', u'CUISINE', u'TYPE_OF_PLACE', u'DRINK', u'PLACE', u'MEAL_TIME', u'DISH', u'NEIGHBOURHOOD'] +y = [160, 167, 137, 18, 120, 36, 155, 130] +ind = np.arange(len(y)) + +fig, ax = plt.subplots() +ax.barh(ind, y) +ax.set_yticks(ind) +ax.set_yticklabels(x) + +# new helper method to auto-label bars +ax.bar_label(ax.containers[0]) + +plt.show() + +# Source: https://stackoverflow.com/a/68107816/14900011 diff --git a/Supplementary materials/Matplotlib/Stacked Bar chart using dataframe plot.ipynb b/Supplementary materials/Matplotlib/Stacked Bar chart using dataframe plot.ipynb new file mode 100644 index 00000000..89badd58 --- /dev/null +++ b/Supplementary materials/Matplotlib/Stacked Bar chart using dataframe plot.ipynb @@ -0,0 +1,134 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Team Round 1 Round 2 Round 3 Round 4\n", + "0 A 10 20 10 26\n", + "1 B 20 25 15 21\n", + "2 C 12 15 19 6\n", + "3 D 10 18 11 19\n" + ] + }, + { + "data": { + "text/plain": "" + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAEUCAYAAAAyfG1zAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAd30lEQVR4nO3dfbxVZZ338c9XHjzgEwhHJBHBxJQEYToqaLdRSLfmnaIh2G2FjQ6vcqxsyrS6S2ycGX3dNZGO2VAqZKYoClhND97kQzojCYqggEoKeBhAQPFZR/R3/7Gug3s2+3D2OWfvs8/ifN+v136d9Xit31pn79++9rXWupYiAjMzy589ah2AmZm1jRO4mVlOOYGbmeWUE7iZWU45gZuZ5ZQTuJlZTjmBdxGSZkm6ogLlnCvpgUrElBeShkgKSd3LXL4ix7qZsu+VdH6Vyu4l6VeSXpJ0ezW2YZXlBF5jkj4s6d/Th+YFSQ9KOibNy1WyLEh0r6bXJkk/ltSjwtsZJulWSZslvSzpaUnXSBpUye3knaQ1kk5qxSqTgAFAv4g4q0phWQU5gdeQpH2BXwPXAPsDBwGXA2/VMq4K6BMRewMjgLHA37alkFI1XkmHAYuA/wRGR8S+wAnAX4APl1uOlXQI8FREbC8108ex83ECr63DASLiloh4JyLeiIg/RMQySUcCPwHGptrsNgBJp0p6NNU8n5M0vbDAghr9tjT/3OKNStpH0j2SrlbmCEl3p18AT0qaXLBsP0l3pe39GXh/uTsXEc8DdwPDC8q7VNJfJL0iaYWkMwrmnZt+gfxQ0lZg+s6lMh14MCL+LiIam7YTETMi4tZUzjhJjZIukbQRuFFSX0m/TrX2F9P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I0TUNMGckPR0Rw5qZtzoiDuvomPJM0qPAhIjYUjS9HvhDHt+fXboGDpwJbADukfRTSeMB/9xvu+4R8YeIuB3YGBEPAUSEm6PaZrGkvymeKOl8YEkN4sm7HsXJGyAiNgM9ahBPu1W9M6vOLCLmA/Ml7UXWFe5FwAGSrgPmRcQfahheHr1bMPxG0byu+1Ov7S4C5kk6h/cSdgPQEzijVkHl2H+1cV6n1aWbUEqR1Bc4C5gSEeNrHU+eSHoHeI3sV0wv4PWmWUBdROSyllNrkj4KHJVGn4iIP9YynrwqeH/uNIucvj+dwM3Mcqqrt4GbmeWWE7iZWU516ZOYtnuS1A9YmEYPBN4BNqfxY9MzXM1yz23gtluTNB14NSK+X+tYzCrNTSjWJUj6kKT7JC2R9HtJA9P0v5H0sKTHJN0hqXeaPkvSdZIekvSMpHGSbpC0UtKsmu6MWeIEbl2ByLpKmBQRHwJuAP4hzbszIo6JiKOBlcB5Bev1BcaS3YJ9F/BD4IPACEmjOih2s2a5Ddy6gj3JrqO+O/Wr1Y3sDlyAoyRdAfQB9iZ7RGCTX0VESFoObGrql0TSE2R9kSztiODNmuMEbl2ByG6AGVti3ixgYkQ8JulcYFzBvLfS33cLhpvG/dmxmnMTinUFbwH1ksYCSOoh6YNp3j7ABkk9gHNqFaBZWziBW1fwLjAJuErSY2RNH8ened8BFgEP4j7gLWd8GaGZWU65Bm5mllNO4GZmOeUEbmaWU07gZmY55QRuZpZTTuBmZjnlBG5mllNO4GZmOfX/ATd9+OvZDQa5AAAAAElFTkSuQmCC\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Team Round 1 Round 2 Round 3 Round 4\n", + "0 A 10 20 10 26\n", + "1 B 20 25 15 21\n", + "2 C 12 15 19 6\n", + "3 D 10 18 11 19\n" + ] + }, + { + "data": { + "text/plain": "" + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "text/plain": "
", + "image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QEzijVkHl2H+1cV6n1aWbUEqR1Bc4C5gSEeNrHU+eSHoHeI3sV0wv4PWmWUBdROSyllNrkj4KHJVGn4iIP9YynrwqeH/uNIucvj+dwM3Mcqqrt4GbmeWWE7iZWU516ZOYtnuS1A9YmEYPBN4BNqfxY9MzXM1yz23gtluTNB14NSK+X+tYzCrNTSjWJUj6kKT7JC2R9HtJA9P0v5H0sKTHJN0hqXeaPkvSdZIekvSMpHGSbpC0UtKsmu6MWeIEbl2ByLpKmBQRHwJuAP4hzbszIo6JiKOBlcB5Bev1BcaS3YJ9F/BD4IPACEmjOih2s2a5Ddy6gj3JrqO+O/Wr1Y3sDlyAoyRdAfQB9iZ7RGCTX0VESFoObGrql0TSE2R9kSztiODNmuMEbl2ByG6AGVti3ixgYkQ8JulcYFzBvLfS33cLhpvG/dmxmnMTinUFbwH1ksYCSOoh6YNp3j7ABkk9gHNqFaBZWziBW1fwLjAJuErSY2RNH8ened8BFgEP4j7gLWd8GaGZWU65Bm5mllNO4GZmOeUEbmaWU07gZmY55QRuZpZTTuBmZjnlBG5mllNO4GZmOfX/ATd9+OvZDQa5AAAAAElFTkSuQmCC\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Team Round 1 Round 2 Round 3 Round 4\n", + "0 A 10 20 10 26\n", + "1 B 20 25 15 21\n", + "2 C 12 15 19 6\n", + "3 D 10 18 11 19\n" + ] + }, + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAEUCAYAAAAyfG1zAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAd30lEQVR4nO3dfbxVZZ338c9XHjzgEwhHJBHBxJQEYToqaLdRSLfmnaIh2G2FjQ6vcqxsyrS6S2ycGX3dNZGO2VAq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pKmBQRHwJuAP4hzbszIo6JiKOBlcB5Bev1BcaS3YJ9F/BD4IPACEmjOih2s2a5Ddy6gj3JrqO+O/Wr1Y3sDlyAoyRdAfQB9iZ7RGCTX0VESFoObGrql0TSE2R9kSztiODNmuMEbl2ByG6AGVti3ixgYkQ8JulcYFzBvLfS33cLhpvG/dmxmnMTinUFbwH1ksYCSOoh6YNp3j7ABkk9gHNqFaBZWziBW1fwLjAJuErSY2RNH8ened8BFgEP4j7gLWd8GaGZWU65Bm5mllNO4GZmOeUEbmaWU07gZmY55QRuZpZTTuBmZjnlBG5mllNO4GZmOfX/ATd9+OvZDQa5AAAAAElFTkSuQmCC\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "# importing package\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "import pandas as pd\n", + "\n", + "# create data\n", + "df = pd.DataFrame([['A', 10, 20, 10, 26], ['B', 20, 25, 15, 21], ['C', 12, 15, 19, 6],\n", + " ['D', 10, 18, 11, 19]],\n", + " columns=['Team', 'Round 1', 'Round 2', 'Round 3', 'Round 4'])\n", + "# view data\n", + "print(df)\n", + "\n", + "# plot data in stack manner of bar type\n", + "df.plot(x='Team', kind='bar', stacked=True,\n", + " title='Stacked Bar Graph by dataframe')\n", + "\n", + "plt.show()\n", + "\n", + "# Source: https://www.geeksforgeeks.org/create-a-stacked-bar-plot-in-matplotlib/" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/Supplementary materials/Matplotlib/Stacked Bar chart using dataframe plot.py b/Supplementary materials/Matplotlib/Stacked Bar chart using dataframe plot.py new file mode 100644 index 00000000..66a3edd3 --- /dev/null +++ b/Supplementary materials/Matplotlib/Stacked Bar chart using dataframe plot.py @@ -0,0 +1,19 @@ +# importing package +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +# create data +df = pd.DataFrame([['A', 10, 20, 10, 26], ['B', 20, 25, 15, 21], ['C', 12, 15, 19, 6], + ['D', 10, 18, 11, 19]], + columns=['Team', 'Round 1', 'Round 2', 'Round 3', 'Round 4']) +# view data +print(df) + +# plot data in stack manner of bar type +df.plot(x='Team', kind='bar', stacked=True, + title='Stacked Bar Graph by dataframe') + +plt.show() + +# Source: https://www.geeksforgeeks.org/create-a-stacked-bar-plot-in-matplotlib/ diff --git a/Supplementary materials/Matplotlib/Stacked bar chart with more than 2 data.py b/Supplementary materials/Matplotlib/Stacked bar chart with more than 2 data.py new file mode 100644 index 00000000..8dc7e331 --- /dev/null +++ b/Supplementary materials/Matplotlib/Stacked bar chart with more than 2 data.py @@ -0,0 +1,23 @@ +# importing package +import matplotlib.pyplot as plt +import numpy as np + +# create data +x = ['A', 'B', 'C', 'D'] +y1 = np.array([10, 20, 10, 30]) +y2 = np.array([20, 25, 15, 25]) +y3 = np.array([12, 15, 19, 6]) +y4 = np.array([10, 29, 13, 19]) + +# plot bars in stack manner +plt.bar(x, y1, color='r') +plt.bar(x, y2, bottom=y1, color='b') +plt.bar(x, y3, bottom=y1+y2, color='y') +plt.bar(x, y4, bottom=y1+y2+y3, color='g') +plt.xlabel("Teams") +plt.ylabel("Score") +plt.legend(["Round 1", "Round 2", "Round 3", "Round 4"]) +plt.title("Scores by Teams in 4 Rounds") +plt.show() + +# Source: https://www.geeksforgeeks.org/create-a-stacked-bar-plot-in-matplotlib/ diff --git a/Supplementary materials/Matplotlib/bar plot with percentage.py b/Supplementary materials/Matplotlib/bar plot with percentage.py new file mode 100644 index 00000000..5ad665c8 --- /dev/null +++ b/Supplementary materials/Matplotlib/bar plot with percentage.py @@ -0,0 +1,33 @@ +import pandas as pd +import numpy as np +import matplotlib.pyplot as plt + +# create sample data as shown in the OP +np.random.seed(365) +people = ('A','B','C','D','E','F','G','H') +bottomdata = 3 + 10 * np.random.rand(len(people)) +topdata = 3 + 10 * np.random.rand(len(people)) + +# create the dataframe +df = pd.DataFrame({'Female': bottomdata, 'Male': topdata}, index=people) + +ax = df.plot(kind='barh', stacked=True, figsize=(8, 6)) + +for c in ax.containers: + + # customize the label to account for cases when there might not be a bar section + labels = [f'{w:.2f}%' if (w := v.get_width()) > 0 else '' for v in c ] + + # set the bar label + ax.bar_label(c, labels=labels, label_type='center') + + # uncomment and use the next line if there are no nan or 0 length sections; just use fmt to add a % (the previous two lines of code are not needed, in this case) +# ax.bar_label(c, fmt='%.2f%%', label_type='center') + +# move the legend +ax.legend(bbox_to_anchor=(1.025, 1), loc='upper left', borderaxespad=0.) + +# add labels +ax.set_ylabel("People", fontsize=18) +ax.set_xlabel("Percent", fontsize=18) +plt.show() diff --git a/Supplementary materials/Matplotlib/bar plot with percentage2.py b/Supplementary materials/Matplotlib/bar plot with percentage2.py new file mode 100644 index 00000000..fa7f0cec --- /dev/null +++ b/Supplementary materials/Matplotlib/bar plot with percentage2.py @@ -0,0 +1,50 @@ +import pandas as pd +import numpy as np +import matplotlib.pyplot as plt + +# create sample data as shown in the OP +np.random.seed(365) +people = ('A','B','C','D','E','F','G','H') +bottomdata = 3 + 10 * np.random.rand(len(people)) +topdata = 3 + 10 * np.random.rand(len(people)) + +# create the dataframe +df = pd.DataFrame({'Female': bottomdata, 'Male': topdata}, index=people) + +ax = df.plot(kind='barh', stacked=True, figsize=(8, 6)) + +for c in ax.containers: + + # customize the label to account for cases when there might not be a bar section + + labels = [] + for v in c: + w = v.get_width() + if w > 0: + labels.append(f'{w:.2f}%') + else: + labels.append('') + +# labels = [f'{w:.2f}%' if (w := v.get_width()) > 0 else '' for v in c ] + + # set the bar label + ax.bar_label(c, labels=labels, label_type='center') + + # uncomment and use the next line if there are no nan or 0 length sections; just use fmt to add a % (the previous two lines of code are not needed, in this case) +# ax.bar_label(c, fmt='%.2f%%', label_type='center') + +# move the legend +ax.legend(bbox_to_anchor=(1.025, 1), loc='upper left', borderaxespad=0.) + +# add labels +ax.set_ylabel("People", fontsize=18) +ax.set_xlabel("Percent", fontsize=18) +plt.show() + +# Source: https://stackoverflow.com/a/64202669/14900011 +# References: +# 1. https://www.google.com/search?q=python+3.8+vs+3.7 +# 2. https://docs.python.org/3/whatsnew/3.8.html +# 3. https://www.google.com/search?q=walrus+operator +# 4. https://towardsdatascience.com/the-walrus-operator-7971cd339d7d +# 5. https://www.geeksforgeeks.org/display-percentage-above-bar-chart-in-matplotlib/ diff --git a/Supplementary materials/Robotics/Rotation Matrices.py b/Supplementary materials/Robotics/Rotation Matrices.py new file mode 100644 index 00000000..176438c6 --- /dev/null +++ b/Supplementary materials/Robotics/Rotation Matrices.py @@ -0,0 +1,20 @@ +import numpy as np + +theta1 = 0 # Theta 1 angle in degree +theta2 = 0 # Theta 2 angle in degree + +# Convert these two angles from degrees to radians +theta1 = (theta1 / 180.0) * np.pi +theta2 = (theta2 / 180.0) * np.pi + +rotation_matrix_0_1 = [[np.cos(theta1), - np.sin(theta1), 0], + [np.sin(theta1), np.cos(theta1), 0], + [0, 0, 1]] + +rotation_matrix_1_2 = [[np.cos(theta2), - np.sin(theta2), 0], + [np.sin(theta2), np.cos(theta2), 0], + [0, 0, 1]] + +rotation_matrix_0_2 = np.dot(rotation_matrix_0_1, rotation_matrix_1_2) + +print(rotation_matrix_0_2) diff --git a/Supplementary materials/Robotics/Rotation Matrices2.py b/Supplementary materials/Robotics/Rotation Matrices2.py new file mode 100644 index 00000000..58ef55f3 --- /dev/null +++ b/Supplementary materials/Robotics/Rotation Matrices2.py @@ -0,0 +1,20 @@ +import numpy as np + +theta1 = 90 # Theta 1 angle in degree +theta2 = 0 # Theta 2 angle in degree + +# Convert these two angles from degrees to radians +theta1 = (theta1 / 180.0) * np.pi +theta2 = (theta2 / 180.0) * np.pi + +rotation_matrix_0_1 = [[np.cos(theta1), - np.sin(theta1), 0], + [np.sin(theta1), np.cos(theta1), 0], + [0, 0, 1]] + +rotation_matrix_1_2 = [[np.cos(theta2), - np.sin(theta2), 0], + [np.sin(theta2), np.cos(theta2), 0], + [0, 0, 1]] + +rotation_matrix_0_2 = np.dot(rotation_matrix_0_1, rotation_matrix_1_2) + +print(rotation_matrix_0_2) diff --git a/Supplementary materials/Robotics/Rotation Matrices3.py b/Supplementary materials/Robotics/Rotation Matrices3.py new file mode 100644 index 00000000..e70c1d67 --- /dev/null +++ b/Supplementary materials/Robotics/Rotation Matrices3.py @@ -0,0 +1,20 @@ +import numpy as np + +theta1 = 0 # Theta 1 angle in degree +theta2 = 90 # Theta 2 angle in degree + +# Convert these two angles from degrees to radians +theta1 = (theta1 / 180.0) * np.pi +theta2 = (theta2 / 180.0) * np.pi + +rotation_matrix_0_1 = [[np.cos(theta1), - np.sin(theta1), 0], + [np.sin(theta1), np.cos(theta1), 0], + [0, 0, 1]] + +rotation_matrix_1_2 = [[np.cos(theta2), - np.sin(theta2), 0], + [np.sin(theta2), np.cos(theta2), 0], + [0, 0, 1]] + +rotation_matrix_0_2 = np.dot(rotation_matrix_0_1, rotation_matrix_1_2) + +print(rotation_matrix_0_2) diff --git a/Supplementary materials/Robotics/Rotation Matrices4.py b/Supplementary materials/Robotics/Rotation Matrices4.py new file mode 100644 index 00000000..4ee821ac --- /dev/null +++ b/Supplementary materials/Robotics/Rotation Matrices4.py @@ -0,0 +1,20 @@ +import numpy as np + +theta1 = 30 # Theta 1 angle in degree +theta2 = 60 # Theta 2 angle in degree + +# Convert these two angles from degrees to radians +theta1 = (theta1 / 180.0) * np.pi +theta2 = (theta2 / 180.0) * np.pi + +rotation_matrix_0_1 = [[np.cos(theta1), - np.sin(theta1), 0], + [np.sin(theta1), np.cos(theta1), 0], + [0, 0, 1]] + +rotation_matrix_1_2 = [[np.cos(theta2), - np.sin(theta2), 0], + [np.sin(theta2), np.cos(theta2), 0], + [0, 0, 1]] + +rotation_matrix_0_2 = np.dot(rotation_matrix_0_1, rotation_matrix_1_2) + +print(rotation_matrix_0_2) diff --git a/Supplementary materials/Robotics/Trigonometric.py b/Supplementary materials/Robotics/Trigonometric.py new file mode 100644 index 00000000..71cb5877 --- /dev/null +++ b/Supplementary materials/Robotics/Trigonometric.py @@ -0,0 +1,5 @@ +import numpy as np + +theta = np.arccos(32/40) + +print(theta) diff --git a/Supplementary materials/TensorFlow/Back_propagate.py b/Supplementary materials/TensorFlow/Back_propagate.py new file mode 100644 index 00000000..7a3b45ff --- /dev/null +++ b/Supplementary materials/TensorFlow/Back_propagate.py @@ -0,0 +1,63 @@ +import numpy as np +import tensorflow as tf +import matplotlib.pyplot as plt + +np.random.seed(0) + +# Sample random numbers from a normal distribution with mean 1 and standard deviation of 0.1. +x_values = np.random.normal(1, 0.1, 100).astype(np.float32) + +print("x_values: ", x_values) + +y_values = (x_values * (np.random.normal(loc=1, scale=0.05, size=100) - 0.5)).astype(np.float) + +print("y_values: ", y_values) + +# In order to get assurance that the target and input have a good correlation, plot a scatter plot +# of the two variables: +plt.scatter(x=x_values, y=y_values) +plt.show() + + +def my_output(X, weights, biases): + return tf.add(tf.multiply(x=X, y=weights), biases) + + +def loss_function(y_true, y_prediction): + return tf.reduce_mean(tf.square(y_prediction - y_true)) + + +my_optimization_algorithm = tf.optimizers.SGD(learning_rate=0.02) + +tf.random.set_seed(1) + +weights = tf.Variable(tf.random.normal(shape=[1])) +biases = tf.Variable(tf.random.normal(shape=[1])) +history = list() + +for i in range(100): + random_index = np.random.choice(100) + rand_x = [x_values[random_index]] + rand_y = [y_values[random_index]] + + with tf.GradientTape() as tape: + predictions = my_output(X=rand_x, weights=weights, biases=biases) + loss = loss_function(y_true=rand_y, y_prediction=predictions) + + history.append(loss.numpy()) + gradients = tape.gradient(target=loss, sources=[weights, biases]) + + my_optimization_algorithm.apply_gradients(zip(gradients, [weights, biases])) + if(i + 1) % 2 == 0: + print(f'Step {i+1} Weights: {weights.numpy()} Biases: {biases.numpy()}') + print(f'Loss = {loss.numpy()}') + + +plt.plot(history) +plt.xlabel('iterations') +plt.ylabel('loss') +plt.show() + +# Source: https://github.com/PacktPublishing/Machine-Learning-Using-TensorFlow-Cookbook/blob/master/ch2/2.%20The%20TensorFlow%20Way.ipynb +# Reference: https://www.tensorflow.org/guide/autodiff + diff --git a/Supplementary materials/gym/__init__.py b/Supplementary materials/gym/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Supplementary materials/gym/a bare minimum example of getting something running.ipynb b/Supplementary materials/gym/a bare minimum example of getting something running.ipynb new file mode 100644 index 00000000..d459931f --- /dev/null +++ b/Supplementary materials/gym/a bare minimum example of getting something running.ipynb @@ -0,0 +1,69 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "c:\\program files (x86)\\microsoft visual studio\\shared\\python37_64\\lib\\site-packages\\gym\\envs\\classic_control\\cartpole.py:151: UserWarning: \u001B[33mWARN: You are calling 'step()' even though this environment has already returned done = True. You should always call 'reset()' once you receive 'done = True' -- any further steps are undefined behavior.\u001B[0m\n", + " \"You are calling 'step()' even though this \"\n" + ] + } + ], + "source": [ + "import gym\n", + "\n", + "env = gym.make('CartPole-v0')\n", + "\n", + "env.reset()\n", + "\n", + "for _ in range(1000):\n", + " env.render()\n", + " env.step(env.action_space.sample()) # take a random action\n", + "\n", + "env.close()\n", + "\n", + "# Source: https://gym.openai.com/docs/" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/Supplementary materials/gym/a bare minimum example of getting something running.py b/Supplementary materials/gym/a bare minimum example of getting something running.py new file mode 100644 index 00000000..cc015976 --- /dev/null +++ b/Supplementary materials/gym/a bare minimum example of getting something running.py @@ -0,0 +1,13 @@ +import gym + +env = gym.make('CartPole-v0') + +env.reset() + +for _ in range(1000): + env.render() + env.step(env.action_space.sample()) # take a random action + +env.close() + +# Source: https://gym.openai.com/docs/ diff --git a/Supplementary materials/pandas/Excel_sheet_shape.py b/Supplementary materials/pandas/Excel_sheet_shape.py new file mode 100644 index 00000000..3c4b6e4f --- /dev/null +++ b/Supplementary materials/pandas/Excel_sheet_shape.py @@ -0,0 +1,10 @@ +import pandas as pd + +df = pd.read_csv("trace.txt", delimiter="\t") + +print(df.shape) + +# Reference: +# 1. https://stackoverflow.com/a/51067912/ +# 2. https://www.adamsmith.haus/python/answers/how-to-find-the-total-number-of-rows-and-columns-of-an-excel-spreadsheet-in-python +# 3. https://www.google.com/search?q=find+total+number+of+columns+in+excel+with+python diff --git a/Supplementary materials/pandas/apply().py b/Supplementary materials/pandas/apply().py new file mode 100644 index 00000000..b47c04e5 --- /dev/null +++ b/Supplementary materials/pandas/apply().py @@ -0,0 +1,21 @@ +import pandas as pd +import numpy as np + +frame = pd.DataFrame(np.random.randn(4, 3), + columns=list('bde'), index=['Utah', 'Ohio', 'Texas', 'Oregon']) + +print(frame) + +def f(x): + return x.max() - x.min() + + +frame.apply(f) + +print(frame) + +frame2 = frame.apply(f) +print(frame2) + +# Reference: +# 1. https://stackoverflow.com/a/19798528/14900011 diff --git a/Supplementary materials/pandas/trace.txt b/Supplementary materials/pandas/trace.txt new file mode 100644 index 00000000..67ba0f2e --- /dev/null +++ b/Supplementary materials/pandas/trace.txt @@ -0,0 +1,5003 @@ +0x011C8272 +0x011C8272 +0x18F0B218 +0x18F0B220 +0x18F0B228 +0x06DE4DC0 +0x06DE4DC8 +0x1B6436C8 +0x1B6436C8 +0x1057A0A8 +0x1057A0A8 +0x1586AB00 +0x1586AB08 +0x1586AB10 +0x1586AB18 +0x1586AB20 +0x1586AB28 +0x1586AB30 +0x1586AB38 +0x1586AB40 +0x1DAB3B60 +0x1DAB3B68 +0x1DAB3B70 +0x1DAB3B78 +0x1DAB3B80 +0x1DAB3B88 +0x1DAB3B90 +0x1DAB3B98 +0x13C367B8 +0x13C367C0 +0x13C367C8 +0x0F169E30 +0x0F169E38 +0x0F169E40 +0x0F169E48 +0x0F169E50 +0x1817F038 +0x1817F040 +0x1817F048 +0x1817F050 +0x1817F058 +0x1817F060 +0x1817F068 +0x186D7108 +0x186D7110 +0x186D7118 +0x186D7120 +0x186D7128 +0x186D7130 +0x1A6FB500 +0x1A6FB508 +0x1A6FB510 +0x1A6FB518 +0x1A6FB520 +0x1A6FB528 +0x1A6FB530 +0x1A6FB538 +0x148AA970 +0x148AA978 +0x148AA980 +0x148AA988 +0x16496CA0 +0x16496CA8 +0x16496CB0 +0x07298E60 +0x07298E60 +0x1AB5F588 +0x1AB5F590 +0x1AB5F598 +0x1AB5F5A0 +0x1AB5F5A8 +0x1CEFFA00 +0x1CEFFA08 +0x1CEFFA10 +0x1CEFFA18 +0x1CEFFA20 +0x03D247BC +0x03D247C4 +0x03D247CC +0x03D247D4 +0x03D247DC +0x03D247E4 +0x03D247EC +0x06628CC8 +0x06628CD0 +0x0F579ED0 +0x0F579ED0 +0x1C84F938 +0x1C84F938 +0x0CFB9A30 +0x0CFB9A30 +0x09FD1458 +0x09FD1458 +0x17ACAF80 +0x17ACAF88 +0x17ACAF90 +0x17ACAF98 +0x17ACAFA0 +0x17ACAFA8 +0x17ACAFB0 +0x176C6EE0 +0x176C6EE8 +0x013942BA +0x0F395E70 +0x0F395E78 +0x0F395E80 +0x0F395E88 +0x146BA900 +0x146BA908 +0x146BA910 +0x146BA918 +0x146BA920 +0x01068256 +0x0106825E +0x01068266 +0x1DC13B80 +0x1DC13B88 +0x1DC13B90 +0x1DC13B98 +0x1DC13BA0 +0x002B808F +0x002B8097 +0x002B809F +0x002B80A7 +0x002B80AF +0x002B80B7 +0x049E8940 +0x049E8948 +0x049E8950 +0x07B34F88 +0x07B34F90 +0x07B34F98 +0x07B34FA0 +0x07B34FA8 +0x08B951A8 +0x08B951B0 +0x08B951B8 +0x0A2A5450 +0x0A2A5458 +0x0A2A5460 +0x0A2A5468 +0x0A2A5470 +0x0A2A5478 +0x0911D238 +0x0911D240 +0x0911D248 +0x0911D250 +0x0911D258 +0x0911D260 +0x0911D268 +0x0911D270 +0x1FB9BFC8 +0x1FB9BFC8 +0x0C255878 +0x0C255880 +0x0C255888 +0x0C255890 +0x0C255898 +0x0DA5DB50 +0x0DA5DB58 +0x0DA5DB60 +0x1E883D80 +0x1E883D80 +0x1E63FD00 +0x1E63FD08 +0x1E63FD10 +0x1E63FD18 +0x1E63FD20 +0x1E63FD28 +0x175B2EC0 +0x05D6CBB0 +0x05D6CBB0 +0x13BD67C8 +0x13BD67D0 +0x13BD67D8 +0x1332E660 +0x1332E668 +0x1332E670 +0x1332E678 +0x1347E6A0 +0x1347E6A0 +0x09DC13C8 +0x09DC13D0 +0x09DC13D8 +0x09DC13E0 +0x09DC13E8 +0x09DC13F0 +0x09DC13F8 +0x09DC1400 +0x146D6920 +0x146D6920 +0x141F28A0 +0x141F28A8 +0x0B2B5650 +0x0B2B5658 +0x0B2B5660 +0x0E919D70 +0x0E919D78 +0x0E919D80 +0x0E919D88 +0x09185230 +0x09185238 +0x150E2A48 +0x150E2A48 +0x079CCF40 +0x079CCF40 +0x11B0E390 +0x11B0E398 +0x11B0E3A0 +0x11B0E3A8 +0x11B0E3B0 +0x11B0E3B8 +0x11B0E3C0 +0x11B0E3C8 +0x0B4696C0 +0x0B4696C8 +0x0B4696D0 +0x0B4696D8 +0x0B4696E0 +0x07150E70 +0x07150E70 +0x1A3AB480 +0x1A3AB488 +0x1A3AB490 +0x1A3AB498 +0x1A3AB4A0 +0x1A3AB4A8 +0x1A3AB4B0 +0x17ACAF90 +0x17ACAF90 +0x112F2298 +0x112F22A0 +0x112F22A8 +0x112F22B0 +0x112F22B8 +0x112F22C0 +0x03E6C7CC +0x03E6C7CC +0x0F7DDF58 +0x1AAB7560 +0x1AAB7568 +0x1AAB7570 +0x1AAB7578 +0x14996948 +0x14996950 +0x14996958 +0x14996960 +0x14996968 +0x14996970 +0x1087E108 +0x1087E110 +0x1087E118 +0x1087E120 +0x1087E128 +0x1087E130 +0x1087E138 +0x1087E140 +0x1087E148 +0x09C6D398 +0x09C6D398 +0x13A32758 +0x13A32760 +0x13A32768 +0x13A32770 +0x13A32778 +0x13A32780 +0x13A32788 +0x01EE43DC +0x01EE43E4 +0x12D3A5E0 +0x12D3A5E0 +0x13B1A7A0 +0x13B1A7A8 +0x1E5AFCC0 +0x1E5AFCC8 +0x1E5AFCD0 +0x048F4988 +0x048F4988 +0x15A96BB0 +0x15A96BB0 +0x08071050 +0x08071058 +0x08071060 +0x08071068 +0x1F52BEA0 +0x1F52BEA8 +0x1F52BEB0 +0x1F52BEB8 +0x1F8ABF68 +0x1F8ABF68 +0x116522C8 +0x116522D0 +0x116522D8 +0x116522E0 +0x116522E8 +0x116522F0 +0x01A2038C +0x01A2038C +0x00C401E0 +0x00C401E8 +0x122C2460 +0x122C2468 +0x122C2470 +0x122C2478 +0x122C2480 +0x122C2488 +0x0C361888 +0x0C361888 +0x1D6B3B40 +0x18B33160 +0x18B33168 +0x18B33170 +0x18B33178 +0x18B33180 +0x18B33188 +0x0041C0C3 +0x0041C0CB +0x0041C0D3 +0x0041C0DB +0x0041C0E3 +0x05FB0BF8 +0x05FB0C00 +0x05FB0C08 +0x05FB0C10 +0x15822B38 +0x15822B38 +0x1A84F510 +0x1A84F518 +0x1A84F520 +0x1A84F528 +0x1A84F530 +0x1A84F538 +0x1A84F540 +0x1A84F548 +0x1A84F550 +0x1B3476B0 +0x0295C52C +0x0295C534 +0x0295C53C +0x0295C544 +0x0295C54C +0x0295C554 +0x0295C55C +0x0295C564 +0x16342C60 +0x16342C68 +0x16342C70 +0x16342C78 +0x16342C80 +0x16342C88 +0x16342C90 +0x16342C98 +0x16342CA0 +0x03DA87B4 +0x03DA87BC +0x03DA87C4 +0x03DA87CC +0x03DA87D4 +0x03DA87DC +0x03DA87E4 +0x03DA87EC +0x0A185448 +0x0A185448 +0x1A227480 +0x1A227488 +0x1A227490 +0x1A227498 +0x14282860 +0x1697AD58 +0x1697AD60 +0x1697AD68 +0x1697AD70 +0x1697AD78 +0x1697AD80 +0x08EE91E0 +0x08EE91E8 +0x1833B0B8 +0x1833B0B8 +0x0A19D450 +0x0A19D450 +0x17DB7008 +0x1F61FEC0 +0x1F61FEC8 +0x1F61FED0 +0x1F61FED8 +0x1F61FEE0 +0x01180278 +0x01180280 +0x0B60D6C0 +0x0B60D6C8 +0x0B60D6D0 +0x121FA488 +0x121FA488 +0x0C4E98C0 +0x0C4E98C0 +0x16992D58 +0x16992D60 +0x16992D68 +0x16992D70 +0x16992D78 +0x05770B30 +0x05770B38 +0x05770B40 +0x05770B48 +0x05770B50 +0x05770B58 +0x1CC6B980 +0x1B00F658 +0x10262040 +0x10262048 +0x10262050 +0x10262058 +0x10262060 +0x10262068 +0x10262070 +0x19F17418 +0x19F17420 +0x19F17428 +0x19F17430 +0x19F17438 +0x1063E0C0 +0x1063E0C8 +0x1063E0D0 +0x1063E0D8 +0x08A51180 +0x08A51180 +0x1EDB3DF8 +0x1EDB3E00 +0x1EDB3E08 +0x1EDB3E10 +0x1EDB3E18 +0x1ED4FDB8 +0x1ED4FDC0 +0x1ED4FDC8 +0x1ED4FDD0 +0x1ED4FDD8 +0x1ED4FDE0 +0x1ED4FDE8 +0x17C9EFE8 +0x17C9EFF0 +0x17C9EFF8 +0x17C9F000 +0x0AFB55F0 +0x0AFB55F8 +0x0AFB5600 +0x0AFB5608 +0x0AFB5610 +0x0BED97E8 +0x0BED97F0 +0x0BED97F8 +0x0BED9800 +0x0BED9808 +0x1B5676B8 +0x1B5676C0 +0x1B5676C8 +0x1B5676D0 +0x1B5676D8 +0x02838558 +0x15E9ABE0 +0x15E9ABE8 +0x15E9ABF0 +0x15E9ABF8 +0x15E9AC00 +0x15E9AC08 +0x15E9AC10 +0x15E9AC18 +0x06C54DC8 +0x06C54DD0 +0x046FC8E0 +0x046FC8E8 +0x046FC8F0 +0x046FC8F8 +0x046FC900 +0x1B0A3648 +0x1B0A3650 +0x1B0A3658 +0x1B0A3660 +0x1B0A3668 +0x1B0A3670 +0x1B0A3678 +0x1B0A3680 +0x15F16C38 +0x15F16C40 +0x15F16C48 +0x006DC0DB +0x006DC0E3 +0x006DC0EB +0x006DC0F3 +0x006DC0FB +0x006DC103 +0x1EBAFDB0 +0x1EBAFDB0 +0x0D375A88 +0x0D375A88 +0x127EE528 +0x127EE528 +0x1E5ABCD8 +0x1E5ABCD8 +0x07AE8F68 +0x07AE8F68 +0x085A50C0 +0x085A50C8 +0x085A50D0 +0x085A50D8 +0x085A50E0 +0x085A50E8 +0x085A50F0 +0x1D6AFB00 +0x1D6AFB08 +0x1D6AFB10 +0x1D6AFB18 +0x1D6AFB20 +0x1D803B08 +0x1D803B10 +0x1D803B18 +0x1D803B20 +0x1D803B28 +0x1D803B30 +0x1389E720 +0x1389E728 +0x1389E730 +0x1389E738 +0x1389E740 +0x1389E748 +0x1389E750 +0x1389E758 +0x1389E760 +0x02DC05C8 +0x02DC05D0 +0x02DC05D8 +0x02DC05E0 +0x02DC05E8 +0x02DC05F0 +0x02DC05F8 +0x0B60D728 +0x17DB2FC0 +0x17DB2FC8 +0x17DB2FD0 +0x17DB2FD8 +0x17DB2FE0 +0x17DB2FE8 +0x17DB2FF0 +0x13BD67C8 +0x13BD67C8 +0x1A7FF508 +0x1A7FF510 +0x1A7FF518 +0x1A7FF520 +0x1A7FF528 +0x1A7FF530 +0x0C21D8A0 +0x0C21D8A8 +0x1BA17740 +0x1BA17748 +0x1BA17750 +0x1BA17758 +0x1BA17760 +0x1BA17768 +0x1BA17770 +0x099B5378 +0x099B5378 +0x013E4284 +0x013E4284 +0x03E4C820 +0x03E4C828 +0x13BD6780 +0x13BD6788 +0x13BD6790 +0x13BD6798 +0x092B9260 +0x092B9260 +0x03F30810 +0x03F30810 +0x02D9C60C +0x02D9C60C +0x1433A868 +0x1433A870 +0x1433A878 +0x1433A880 +0x1433A888 +0x1433A890 +0x1433A898 +0x1433A8A0 +0x1433A8A8 +0x00DF01F6 +0x00DF01FE +0x00DF0206 +0x00DF020E +0x00DF0216 +0x1D8E7B48 +0x1D8E7B50 +0x1D8E7B58 +0x1D8E7B60 +0x1D8E7B68 +0x1D8E7B70 +0x11DDE3D8 +0x11DDE3E0 +0x11DDE3E8 +0x11DDE3F0 +0x11DDE3F8 +0x11DDE400 +0x0C18D838 +0x0C18D840 +0x0C18D848 +0x0C18D850 +0x0C18D858 +0x0C18D860 +0x05FFCC08 +0x05FFCC10 +0x05FFCC18 +0x05FFCC20 +0x05FFCC28 +0x05FFCC30 +0x05FFCC38 +0x05FFCC40 +0x05FFCC48 +0x0F375EA8 +0x0F375EB0 +0x0F375EB8 +0x0F375EC0 +0x1C1EF840 +0x1C1EF848 +0x1C1EF850 +0x02C145BC +0x02C145BC +0x15DFEBF8 +0x15DFEC00 +0x15DFEC08 +0x15DFEC10 +0x006C00D8 +0x006C00E0 +0x006C00E8 +0x006C00F0 +0x08D311B0 +0x08D311B0 +0x05D30BF0 +0x05D30BF8 +0x05D30C00 +0x05D30C08 +0x03F547EC +0x0F491ED0 +0x0F491ED0 +0x0E689D18 +0x0E689D20 +0x1C927920 +0x1C927928 +0x1C927930 +0x1C927938 +0x16332C68 +0x16332C68 +0x062CCC78 +0x062CCC80 +0x062CCC88 +0x062CCC90 +0x062CCC98 +0x0C215850 +0x0C215850 +0x0939D2A0 +0x0939D2A8 +0x0939D2B0 +0x0939D2B8 +0x1827F040 +0x1827F048 +0x1827F050 +0x1827F058 +0x1827F060 +0x06768D00 +0x06768D00 +0x0C20D868 +0x0C20D870 +0x0C20D878 +0x0C20D880 +0x0C20D888 +0x0C20D890 +0x061E8C40 +0x061E8C48 +0x10876110 +0x10876118 +0x10876120 +0x10876128 +0x10876130 +0x10876138 +0x10876140 +0x10876148 +0x1B9A3780 +0x1B9A3788 +0x1B9A3790 +0x1B9A3798 +0x1B9A37A0 +0x1B9A37A8 +0x16CC6DA0 +0x16CC6DA8 +0x1354E6D8 +0x1354E6D8 +0x17F17008 +0x17F17010 +0x17F17018 +0x17F17020 +0x17F17028 +0x17F17030 +0x17F17038 +0x17F17040 +0x17F17048 +0x005700B6 +0x005700BE +0x005700C6 +0x005700CE +0x005700D6 +0x005700DE +0x005700E6 +0x005700EE +0x015182DC +0x015182DC +0x0F5CDF18 +0x0F5CDF18 +0x1386A758 +0x06B5CD68 +0x06B5CD70 +0x06B5CD78 +0x06B5CD80 +0x06B5CD88 +0x06B5CD90 +0x06B5CD98 +0x042F4888 +0x042F4888 +0x033DC6C4 +0x033DC6C4 +0x05680AF8 +0x05680AF8 +0x0F90DF80 +0x0F90DF88 +0x0A319460 +0x0A319468 +0x0A319470 +0x0A319478 +0x0A319480 +0x0FD69FB8 +0x0FD69FB8 +0x197DB310 +0x197DB310 +0x0A2A5450 +0x0A2A5458 +0x0A2A5460 +0x0A2A5468 +0x0A2A5470 +0x0A2A5478 +0x0A2A5480 +0x099C9390 +0x099C9398 +0x099C93A0 +0x02D3C5A8 +0x02D3C5B0 +0x02D3C5B8 +0x1BB9B7C8 +0x1BB9B7C8 +0x088A9128 +0x088A9130 +0x088A9138 +0x088A9140 +0x088A9148 +0x088A9150 +0x088A9158 +0x088A9160 +0x088A9168 +0x0026C06D +0x0026C06D +0x1217E470 +0x1217E478 +0x1217E480 +0x18BB7180 +0x18BB7188 +0x18BB7190 +0x18BB7198 +0x0EF09E08 +0x0EF09E10 +0x0EF09E18 +0x0EF09E20 +0x0EF09E28 +0x0EF09E30 +0x0EF09E38 +0x0EF09E40 +0x06A00D90 +0x06A00D98 +0x044BC898 +0x044BC8A0 +0x044BC8A8 +0x044BC8B0 +0x044BC8B8 +0x044BC8C0 +0x0D119A58 +0x0D119A60 +0x0D119A68 +0x0D119A70 +0x0D119A78 +0x0D119A80 +0x16D46DB8 +0x16D46DC0 +0x16D46DC8 +0x16D46DD0 +0x16D46DD8 +0x16D46DE0 +0x16D46DE8 +0x16D46DF0 +0x16D46DF8 +0x116CA2F0 +0x116CA2F0 +0x10996170 +0x10996170 +0x11F72420 +0x11F72420 +0x0C21D848 +0x0C21D850 +0x0C21D858 +0x0C21D860 +0x0C21D868 +0x0C21D870 +0x0C21D878 +0x04200870 +0x04200870 +0x10CEA1F8 +0x10CEA1F8 +0x10E0E218 +0x1765AEC0 +0x1765AEC8 +0x1765AED0 +0x1765AED8 +0x1765AEE0 +0x1765AEE8 +0x1765AEF0 +0x1765AEF8 +0x09CF13F0 +0x09CF13F8 +0x09CF1400 +0x09CF1408 +0x0E7CDD00 +0x0E7CDD08 +0x03734728 +0x03734728 +0x181B3070 +0x181B3078 +0x181B3080 +0x181B3088 +0x181B3090 +0x181B3098 +0x181B30A0 +0x181B30A8 +0x197D3318 +0x197D3320 +0x197D3328 +0x197D3330 +0x197D3338 +0x197D3340 +0x197D3348 +0x08F451F0 +0x1074A128 +0x1074A130 +0x1074A138 +0x1074A140 +0x1074A148 +0x10A0E140 +0x0298C550 +0x0298C550 +0x0A9A9540 +0x0A9A9548 +0x0A9A9550 +0x0A9A9558 +0x0A9A9560 +0x0A9A9568 +0x0A9A9570 +0x0A9A9578 +0x0A9A9580 +0x152F2A80 +0x152F2A88 +0x152F2A90 +0x152F2A98 +0x152F2AA0 +0x152F2AA8 +0x19423290 +0x19423290 +0x0FEC5FE8 +0x0FEC5FF0 +0x0FEC5FF8 +0x0FEC6000 +0x0FEC6008 +0x0FEC6010 +0x0FEC6018 +0x0FEC6020 +0x0FEC6028 +0x16686D18 +0x16686D20 +0x16686D28 +0x16686D30 +0x07AE8F60 +0x0C0C9848 +0x0C0C9850 +0x0C0C9858 +0x0C0C9860 +0x0C0C9868 +0x0C0C9870 +0x165CED20 +0x165CED20 +0x063ECCC8 +0x063ECCD0 +0x063ECCD8 +0x12CBE5A0 +0x12CBE5A8 +0x003580BB +0x0E4C5CA0 +0x0E4C5CA8 +0x0E4C5CB0 +0x0E4C5CB8 +0x1C7D3928 +0x1C7D3930 +0x1C7D3938 +0x1C7D3940 +0x1C7D3948 +0x1C7D3950 +0x1C7D3958 +0x1C7D3960 +0x1C7D3968 +0x1C24F870 +0x1C24F878 +0x1C24F880 +0x1C24F888 +0x1C24F890 +0x1C24F898 +0x1C24F8A0 +0x0FC55F98 +0x0FC55FA0 +0x0FC55FA8 +0x0FC55FB0 +0x0FC55FB8 +0x0FC55FC0 +0x0FC55FC8 +0x0D175A40 +0x0D175A48 +0x0D175A50 +0x0D175A58 +0x0D175A60 +0x01CE83C6 +0x01CE83C6 +0x193A7298 +0x193A72A0 +0x193A72A8 +0x193A72B0 +0x193A72B8 +0x193A72C0 +0x193A72C8 +0x177AEF18 +0x177AEF20 +0x177AEF28 +0x177AEF30 +0x177AEF38 +0x177AEF40 +0x177AEF48 +0x177AEF50 +0x0B9B1778 +0x0B9B1778 +0x05830B20 +0x05830B28 +0x05830B30 +0x05830B38 +0x05830B40 +0x05830B48 +0x0A32D4B8 +0x0A32D4B8 +0x14C02988 +0x14C02990 +0x14C02998 +0x14C029A0 +0x14C029A8 +0x14C029B0 +0x14C029B8 +0x14C029C0 +0x14C029C8 +0x14BA69B8 +0x14BA69C0 +0x14BA69C8 +0x14BA69D0 +0x14BA69D8 +0x1BD737A0 +0x1BD737A8 +0x1F537EC8 +0x1F537ED0 +0x1F537ED8 +0x1F537EE0 +0x1F537EE8 +0x1608EC20 +0x1608EC28 +0x069C0D80 +0x0DDF5BC0 +0x0DDF5BC8 +0x0DDF5BD0 +0x0DDF5BD8 +0x0DDF5BE0 +0x0DDF5BE8 +0x1F32FEB0 +0x1F32FEB0 +0x0063C0C7 +0x0063C0C7 +0x1A377498 +0x1A377498 +0x18ECF1F8 +0x18ECF1F8 +0x1A82F500 +0x1A82F508 +0x1A82F510 +0x1A82F518 +0x1A82F520 +0x1A82F528 +0x1A82F530 +0x1A82F538 +0x1A82F540 +0x04124858 +0x04124858 +0x12B5E590 +0x12B5E590 +0x0DB11B88 +0x0DB11B88 +0x0828D080 +0x0828D088 +0x0828D090 +0x0828D098 +0x02BAC574 +0x02BAC57C +0x02BAC584 +0x02BAC58C +0x07DA0FD8 +0x07DA0FE0 +0x07DA0FE8 +0x07DA0FF0 +0x07DA0FF8 +0x07DA1000 +0x07DA1008 +0x07DA1010 +0x07DA1018 +0x04AA8998 +0x04AA89A0 +0x04AA89A8 +0x164CECA0 +0x164CECA8 +0x167AED20 +0x167AED28 +0x167AED30 +0x167AED38 +0x167AED40 +0x167AED48 +0x167AED50 +0x017102EA +0x017102EA +0x00F041F1 +0x00F041F1 +0x066DCD28 +0x066DCD28 +0x0FF32028 +0x0FF32030 +0x0FF32038 +0x176F6EE0 +0x176F6EE8 +0x176F6EF0 +0x176F6EF8 +0x176F6F00 +0x15D96BF8 +0x15D96BF8 +0x1E95BD20 +0x1E95BD20 +0x015182BC +0x015182BC +0x0A549510 +0x0A549510 +0x18833128 +0x18833130 +0x18833138 +0x18833140 +0x18833148 +0x18833150 +0x10E66208 +0x10E66208 +0x11F02410 +0x11F02418 +0x11F02420 +0x11F02428 +0x11F02430 +0x00CBC198 +0x00CBC1A0 +0x00CBC1A8 +0x00CBC1B0 +0x1D29FA90 +0x1D29FA98 +0x1D29FAA0 +0x1D29FAA8 +0x1D29FAB0 +0x1D29FAB8 +0x06B84D70 +0x06B84D78 +0x06B84D80 +0x13DB27C8 +0x13DB27D0 +0x13DB27D8 +0x13DB27E0 +0x13DB27E8 +0x13DB27F0 +0x060ACC60 +0x060ACC68 +0x060ACC70 +0x060ACC78 +0x060ACC80 +0x065ECCC0 +0x065ECCC8 +0x065ECCD0 +0x0DC19BB8 +0x0DC19BC0 +0x0DC19BC8 +0x0B231640 +0x0B231648 +0x0B231650 +0x0B231658 +0x0CED19E8 +0x0CED19F0 +0x0CED19F8 +0x0CED1A00 +0x0CED1A08 +0x0CED1A10 +0x0CED1A18 +0x0CED1A20 +0x0CED1A28 +0x0CF89A20 +0x0CF89A28 +0x0CF89A30 +0x0CF89A38 +0x183FB080 +0x1F35BE60 +0x1F35BE60 +0x1B7C7710 +0x1B7C7710 +0x134A66A0 +0x134A66A8 +0x134A66B0 +0x134A66B8 +0x134A66C0 +0x134A66C8 +0x0F7B1F48 +0x0F7B1F48 +0x1EF1FE00 +0x1EF1FE08 +0x1EF1FE10 +0x1EF1FE18 +0x1EF1FE20 +0x1EF1FE28 +0x1EF1FE30 +0x0A6B1508 +0x0A6B1510 +0x0A6B1518 +0x0A6B1520 +0x0A6B1528 +0x12BB2598 +0x12BB25A0 +0x12BB25A8 +0x12BB25B0 +0x12BB25B8 +0x03E8C7F0 +0x03E8C7F0 +0x0685CD18 +0x0685CD18 +0x01ED840C +0x01ED8414 +0x01ED841C +0x01ED8424 +0x1771EEE0 +0x08BED1D0 +0x08BED1D8 +0x081DD040 +0x081DD048 +0x081DD050 +0x081DD058 +0x148BE920 +0x148BE920 +0x1299A560 +0x1299A560 +0x0D7CDB08 +0x0D7CDB08 +0x1272A538 +0x1272A538 +0x02A5457C +0x02A54584 +0x02A5458C +0x02A54594 +0x02A5459C +0x02A545A4 +0x02A545AC +0x02A545B4 +0x1524AA70 +0x1524AA70 +0x1D323A78 +0x1D323A78 +0x17C9EFA0 +0x17C9EFA0 +0x119FA360 +0x119FA360 +0x09E39428 +0x09E39428 +0x12A72560 +0x12A72568 +0x12A72570 +0x12A72578 +0x12A72580 +0x1195E330 +0x1195E330 +0x0A0C9428 +0x0A0C9430 +0x0A0C9438 +0x0A0C9440 +0x0A0C9448 +0x0A0C9450 +0x0A0C9458 +0x06714D38 +0x06714D40 +0x1B6436C0 +0x1B6436C8 +0x1B6436D0 +0x1B6436D8 +0x1B6436E0 +0x1B6436E8 +0x1B6436F0 +0x0026C04D +0x0026C055 +0x0026C05D +0x0026C065 +0x0026C06D +0x0026C075 +0x0026C07D +0x084210D0 +0x084210D8 +0x084210E0 +0x10FE6200 +0x10FE6208 +0x10FE6210 +0x037C0740 +0x037C0748 +0x037C0750 +0x037C0758 +0x037C0760 +0x149D2988 +0x149D2988 +0x18633108 +0x18633110 +0x18633118 +0x11926320 +0x11926328 +0x08111038 +0x08111040 +0x08111048 +0x08111050 +0x08111058 +0x0A7D9550 +0x0A7D9558 +0x09B75370 +0x09B75378 +0x09B75380 +0x09B75388 +0x06D20DC0 +0x06D20DC0 +0x1DBDFBD0 +0x1DBDFBD0 +0x18CFB1D0 +0x18CFB1D0 +0x0DE15BF8 +0x0DE15BF8 +0x1803F038 +0x1803F040 +0x1803F048 +0x1803F050 +0x1803F058 +0x1803F060 +0x013A8276 +0x0FA89F70 +0x0FA89F70 +0x14EB6A48 +0x1F0DFE20 +0x1F0DFE28 +0x1F0DFE30 +0x1F0DFE38 +0x1F0DFE40 +0x1F0DFE48 +0x1F0DFE50 +0x11A8A370 +0x11A8A378 +0x11A8A380 +0x11A8A388 +0x11A8A390 +0x11A8A398 +0x160EEC30 +0x160EEC30 +0x0F4D9F00 +0x0F4D9F00 +0x1D137A48 +0x1D137A50 +0x1D137A58 +0x1D137A60 +0x1D137A68 +0x1D137A70 +0x1D137A78 +0x11BAE380 +0x11BAE388 +0x0FD91FD8 +0x0FD91FD8 +0x091F9278 +0x091F9278 +0x05B90B78 +0x05B90B78 +0x0B6CD728 +0x0B6CD730 +0x0B6CD738 +0x0B6CD740 +0x0B6CD748 +0x08839100 +0x08839108 +0x08839110 +0x13B1A760 +0x13B1A768 +0x13B1A770 +0x13B1A778 +0x13B1A780 +0x13B1A788 +0x13B1A790 +0x13B1A798 +0x13B1A7A0 +0x036686DC +0x036686E4 +0x036686EC +0x036686F4 +0x036686FC +0x183FF0D0 +0x183FF0D0 +0x11A26358 +0x11A26358 +0x05100A58 +0x05100A60 +0x05100A68 +0x05100A70 +0x0CED19E0 +0x0CED19E8 +0x0CED19F0 +0x09CF1400 +0x09CF1408 +0x0E7CDD00 +0x0E7CDD08 +0x0E7CDD10 +0x0E7CDD18 +0x0E7CDD20 +0x0E7CDD28 +0x0E7CDD30 +0x0118C262 +0x0118C26A +0x0118C272 +0x0118C27A +0x0118C282 +0x0118C28A +0x0118C292 +0x0214C490 +0x0214C490 +0x11A8A398 +0x11A8A3A0 +0x11A8A3A8 +0x11A8A3B0 +0x0A19D430 +0x0A19D438 +0x0A19D440 +0x0A19D448 +0x158AAB28 +0x158AAB30 +0x158AAB38 +0x158AAB40 +0x158AAB48 +0x158AAB50 +0x158AAB58 +0x05F48C00 +0x05F48C00 +0x0FB71F98 +0x0FB71F98 +0x03D687B4 +0x03D687BC +0x03D687C4 +0x03D687CC +0x03D687D4 +0x03D687DC +0x1A873550 +0x1A873550 +0x0F1B9E60 +0x0F1B9E60 +0x0A37D4B0 +0x0A37D4B0 +0x1F0E3E20 +0x1F0E3E20 +0x1A623518 +0x1A623520 +0x0C869910 +0x0C869918 +0x0C869920 +0x0C869928 +0x0C869930 +0x0C869938 +0x19083220 +0x19083228 +0x19083230 +0x19083238 +0x19083240 +0x083B1078 +0x083B1080 +0x083B1088 +0x083B1090 +0x083B1098 +0x083B10A0 +0x083B10A8 +0x083B10B0 +0x083B10B8 +0x0958D2E0 +0x0958D2E0 +0x12FD2600 +0x12FD2600 +0x05100A50 +0x05100A58 +0x05100A60 +0x05100A68 +0x05100A70 +0x0CED19E0 +0x1210E428 +0x1210E430 +0x1210E438 +0x1210E440 +0x1210E448 +0x09CB13B0 +0x09CB13B0 +0x16DF6DE0 +0x16DF6DE8 +0x16DF6DF0 +0x16DF6DF8 +0x16DF6E00 +0x16DF6E08 +0x1EDEFE08 +0x1EDEFE10 +0x1EDEFE18 +0x0CB25960 +0x0CB25968 +0x0CB25970 +0x0CB25978 +0x0CB25980 +0x0F2E1EA8 +0x0F2E1EA8 +0x0E55DCB0 +0x0E55DCB0 +0x0C231880 +0x0C231888 +0x0C231890 +0x0C231898 +0x08875110 +0x08875118 +0x08875120 +0x08875128 +0x03E4C7E8 +0x03E4C7E8 +0x040DC820 +0x040DC828 +0x040DC830 +0x040DC838 +0x040DC840 +0x040DC848 +0x040DC850 +0x165A2CC0 +0x165A2CC0 +0x07AE8F68 +0x07AE8F68 +0x0DCB1BD8 +0x0DCB1BD8 +0x06CDCD98 +0x06CDCD98 +0x18383080 +0x18383088 +0x18383090 +0x18383098 +0x183830A0 +0x183830A8 +0x183830B0 +0x183830B8 +0x183830C0 +0x1C973970 +0x1C973978 +0x0E291C50 +0x0E291C58 +0x0E291C60 +0x0E291C68 +0x0E291C70 +0x0E291C78 +0x17452EB0 +0x17452EB0 +0x00E401F8 +0x00E40200 +0x00E40208 +0x00E40210 +0x00E40218 +0x01F6042C +0x01F6042C +0x1739EEB0 +0x1739EEB0 +0x1622AC70 +0x1622AC78 +0x1622AC80 +0x1622AC88 +0x1622AC90 +0x1622AC98 +0x1622ACA0 +0x1622ACA8 +0x11A8A360 +0x17196E70 +0x17196E70 +0x092952A0 +0x092952A0 +0x021D444C +0x021D4454 +0x021D445C +0x021D4464 +0x021D446C +0x021D4474 +0x021D447C +0x021D4484 +0x021D448C +0x10D221E8 +0x10D221E8 +0x05FB0C48 +0x05FB0C48 +0x1D41FA88 +0x1D41FA90 +0x1D41FA98 +0x1D41FAA0 +0x1D41FAA8 +0x1D41FAB0 +0x027D4554 +0x027D4554 +0x06164C68 +0x06164C68 +0x1ADC7608 +0x1ADC7610 +0x10002000 +0x10002008 +0x10002010 +0x10002018 +0x10002020 +0x18E8F228 +0x18E8F230 +0x063B4C78 +0x063B4C80 +0x063B4C88 +0x063B4C90 +0x063B4C98 +0x063B4CA0 +0x063B4CA8 +0x119FA3A0 +0x119FA3A8 +0x0EE35DC0 +0x0EE35DC8 +0x0EE35DD0 +0x0EE35DD8 +0x0B1B1658 +0x0B1B1658 +0x18ECF240 +0x18ECF240 +0x1195E368 +0x1195E370 +0x0AC65590 +0x0AC65598 +0x0AC655A0 +0x0AC655A8 +0x0AC655B0 +0x0AC655B8 +0x0AC655C0 +0x136CE6F8 +0x136CE700 +0x136CE708 +0x136CE710 +0x136CE718 +0x17556EF8 +0x17556F00 +0x17556F08 +0x1ACAB5A0 +0x1ACAB5A8 +0x1ACAB5B0 +0x1ACAB5B8 +0x1ACAB5C0 +0x04CE09A0 +0x04CE09A0 +0x06BF8DC0 +0x06BF8DC8 +0x06BF8DD0 +0x06BF8DD8 +0x06BF8DE0 +0x06BF8DE8 +0x0C6798D0 +0x0C6798D8 +0x02BAC594 +0x02BAC59C +0x02BAC5A4 +0x02BAC5AC +0x02BAC5B4 +0x02BAC5BC +0x1D027A00 +0x1D027A08 +0x1D027A10 +0x1414E860 +0x1414E868 +0x120D6420 +0x120D6428 +0x120D6430 +0x120D6438 +0x120D6440 +0x120D6448 +0x120D6450 +0x10FE6268 +0x10FE6268 +0x10FD6250 +0x14452880 +0x14452888 +0x14452890 +0x14452898 +0x144528A0 +0x1D7B7B30 +0x1D7B7B38 +0x1D7B7B40 +0x1D7B7B48 +0x1D7B7B50 +0x1D7B7B58 +0x06A3CD70 +0x06A3CD78 +0x06A3CD80 +0x06A3CD88 +0x06A3CD90 +0x06A3CD98 +0x06A3CDA0 +0x10F7E1E0 +0x1D757AF8 +0x1D757AF8 +0x0C975970 +0x0C975978 +0x0C975980 +0x0C975988 +0x0C975990 +0x0F8B9F78 +0x0F8B9F78 +0x19887340 +0x19887348 +0x19887350 +0x19887358 +0x19887360 +0x19887368 +0x19887370 +0x19887378 +0x1AC3B5D0 +0x1AC3B5D0 +0x1E333C78 +0x1E333C78 +0x0DA69B78 +0x0DA69B80 +0x0DA69B88 +0x0DA69B90 +0x0DA69B98 +0x1B64B6C0 +0x1B64B6C8 +0x014DC2BC +0x014DC2C4 +0x014DC2CC +0x014DC2D4 +0x014DC2DC +0x15DD2BF0 +0x15DD2BF8 +0x15DD2C00 +0x15DD2C08 +0x15DD2C10 +0x15DD2C18 +0x15DD2C20 +0x15DD2C28 +0x163EAC80 +0x1868B128 +0x1868B128 +0x014B02F6 +0x014B02F6 +0x0B5816D0 +0x0B5816D0 +0x190E7260 +0x190E7260 +0x0ED0DDC8 +0x0ED0DDC8 +0x1A377460 +0x1A377468 +0x1A377470 +0x1A377478 +0x1A377480 +0x1A377488 +0x1A377490 +0x1A377498 +0x107DE150 +0x107DE158 +0x107DE160 +0x135F66C0 +0x135F66C8 +0x135F66D0 +0x135F66D8 +0x13CFE7F0 +0x13CFE7F8 +0x13CFE800 +0x1794EF20 +0x1794EF28 +0x1794EF30 +0x1794EF38 +0x1794EF40 +0x1C237890 +0x1C237890 +0x17D8EFD8 +0x17D8EFE0 +0x17D8EFE8 +0x17D8EFF0 +0x17D8EFF8 +0x17D8F000 +0x1D4FBAC8 +0x1D4FBAD0 +0x1D4FBAD8 +0x1D4FBAE0 +0x1D4FBAE8 +0x0B3A56A0 +0x0B3A56A8 +0x0B3A56B0 +0x0B3A56B8 +0x0B3A56C0 +0x0B3A56C8 +0x0F409E80 +0x03AAC76C +0x03AAC774 +0x03AAC77C +0x03AAC784 +0x03AAC78C +0x03AAC794 +0x03AAC79C +0x03AAC7A4 +0x13086630 +0x13086630 +0x0EE39E28 +0x0EE39E28 +0x044BC8E8 +0x044BC8E8 +0x182F7088 +0x182F7088 +0x0BE157F0 +0x0BE157F0 +0x1D987B58 +0x1D987B60 +0x1D987B68 +0x1D987B70 +0x1D987B78 +0x1D987B80 +0x0FCA9F90 +0x0FCA9F98 +0x0FCA9FA0 +0x0FCA9FA8 +0x0FCA9FB0 +0x003C8079 +0x003C8081 +0x003C8089 +0x003C8091 +0x003C8099 +0x1DFD3C00 +0x1DFD3C08 +0x1DFD3C10 +0x1DFD3C18 +0x1DFD3C20 +0x1DFD3C28 +0x0C15D840 +0x0C15D840 +0x0E55DCD0 +0x0E55DCD0 +0x19BC33D8 +0x19BC33D8 +0x19FE3450 +0x19FE3450 +0x08B5D1A0 +0x08B5D1A8 +0x08B5D1B0 +0x08B5D1B8 +0x08B5D1C0 +0x08B5D1C8 +0x08B5D1D0 +0x08DFD1C0 +0x1E823D40 +0x1E823D40 +0x16B3ED70 +0x16B3ED70 +0x0A3954A8 +0x0A3954B0 +0x0A3954B8 +0x0A3954C0 +0x0A3954C8 +0x013B42CE +0x013B42D6 +0x013B42DE +0x1B283660 +0x1B283668 +0x1B283670 +0x1B283678 +0x1B283680 +0x0FE5A000 +0x0FE5A008 +0x0FE5A010 +0x0FE5A018 +0x0FE5A020 +0x0FE5A028 +0x09CE53A0 +0x192F3268 +0x192F3268 +0x1210E440 +0x1210E440 +0x14282888 +0x14282890 +0x14282898 +0x142828A0 +0x142828A8 +0x142828B0 +0x142828B8 +0x0EC3DDB8 +0x0EC3DDB8 +0x0B401690 +0x0B401690 +0x1D10FA60 +0x1D10FA60 +0x195BF2F0 +0x195BF2F8 +0x195BF300 +0x195BF308 +0x09D653B0 +0x09D653B8 +0x09D653C0 +0x09D653C8 +0x08B851B8 +0x08B851B8 +0x129B2578 +0x129B2578 +0x1DF2FC30 +0x1DF2FC30 +0x0CAF5990 +0x0CAF5998 +0x0CAF59A0 +0x0CAF59A8 +0x0CAF59B0 +0x0106820E +0x18E231D0 +0x18E231D8 +0x18E231E0 +0x18E231E8 +0x18E231F0 +0x18E231F8 +0x1E90FD48 +0x1E90FD50 +0x1E90FD58 +0x1E90FD60 +0x1E90FD68 +0x1E90FD70 +0x1E90FD78 +0x0C6098C0 +0x0C6098C8 +0x1CB7B978 +0x1CB7B980 +0x1CB7B988 +0x1CB7B990 +0x1CB7B998 +0x1CB7B9A0 +0x1CB7B9A8 +0x1CB7B9B0 +0x1CB7B9B8 +0x1F747EF0 +0x1F747EF8 +0x1F747F00 +0x1F747F08 +0x1F747F10 +0x04ED89E0 +0x04ED89E0 +0x0AE455D0 +0x0AE455D0 +0x11706348 +0x16F4EDE0 +0x16F4EDE8 +0x16F4EDF0 +0x16F4EDF8 +0x16F4EE00 +0x16F4EE08 +0x16F4EE10 +0x12F8E600 +0x12F8E600 +0x1EFABE08 +0x1EFABE10 +0x1EFABE18 +0x1EFABE20 +0x1EFABE28 +0x0C041820 +0x0C041828 +0x0C041830 +0x0C041838 +0x0C041840 +0x0C041848 +0x0C041850 +0x0E3EDCA0 +0x0E3EDCA0 +0x1D59BB10 +0x1D59BB18 +0x1D59BB20 +0x1493A920 +0x1493A928 +0x1C7B7930 +0x1C7B7938 +0x1C7B7940 +0x1C7B7948 +0x1C7B7950 +0x1C7B7958 +0x14ADA960 +0x14ADA968 +0x1157E2E0 +0x1157E2E0 +0x0F5CDF18 +0x0F5CDF20 +0x1C84F900 +0x1C84F908 +0x1C84F910 +0x10B2A178 +0x10B2A178 +0x19F2B418 +0x19F2B418 +0x1D237A90 +0x1D237A98 +0x1D237AA0 +0x1D237AA8 +0x05E40BC8 +0x0676CCF0 +0x0676CCF8 +0x0676CD00 +0x0676CD08 +0x0676CD10 +0x0676CD18 +0x0E869D28 +0x0E869D28 +0x13232650 +0x13232658 +0x13232660 +0x13232668 +0x13232670 +0x13232678 +0x13232680 +0x13232688 +0x05978B30 +0x05978B38 +0x05978B40 +0x05978B48 +0x05978B50 +0x033DC684 +0x033DC68C +0x033DC694 +0x033DC69C +0x033DC6A4 +0x033DC6AC +0x1D55FAA0 +0x1D55FAA8 +0x1D55FAB0 +0x1D55FAB8 +0x1D55FAC0 +0x1D55FAC8 +0x1D55FAD0 +0x0EEB5DE0 +0x0EEB5DE8 +0x0EEB5DF0 +0x0EEB5DF8 +0x0EEB5E00 +0x0EEB5E08 +0x0EEB5E10 +0x0EEB5E18 +0x0BAD5760 +0x142CE860 +0x142CE860 +0x06A7CD58 +0x06A7CD60 +0x06A7CD68 +0x06A7CD70 +0x06A7CD78 +0x06A7CD80 +0x06A7CD88 +0x06A7CD90 +0x06A7CD98 +0x1FA77F88 +0x1FA77F90 +0x1FA77F98 +0x1FA77FA0 +0x1FA77FA8 +0x0E805D00 +0x0E805D08 +0x0E805D10 +0x0E805D18 +0x1833B0B0 +0x1833B0B0 +0x1F84BF48 +0x1F84BF48 +0x1FBE3FC0 +0x1FBE3FC8 +0x1FBE3FD0 +0x13812700 +0x13812708 +0x13812710 +0x13812718 +0x0B43D6C8 +0x0B43D6D0 +0x0B43D6D8 +0x14C72980 +0x14C72988 +0x0C0C9840 +0x0C0C9840 +0x10C1A1C8 +0x085B50B0 +0x085B50B8 +0x085B50C0 +0x085B50C8 +0x1E823D28 +0x1E823D30 +0x1E823D38 +0x1E823D40 +0x1E823D48 +0x1E823D50 +0x18B4B188 +0x18B4B190 +0x18B4B198 +0x18B4B1A0 +0x18B4B1A8 +0x18B4B1B0 +0x18B4B1B8 +0x18B4B1C0 +0x03B507B4 +0x03B507B4 +0x063D8CB0 +0x063D8CB8 +0x063D8CC0 +0x063D8CC8 +0x1599AB40 +0x1E257C50 +0x1E257C58 +0x1E257C60 +0x1E257C68 +0x1E257C70 +0x1E257C78 +0x1E257C80 +0x1E257C88 +0x06D20DB0 +0x06D20DB8 +0x06D20DC0 +0x06D20DC8 +0x06D20DD0 +0x06D20DD8 +0x06D20DE0 +0x06D20DE8 +0x06D20DF0 +0x079A0F38 +0x079A0F40 +0x079A0F48 +0x079A0F50 +0x079A0F58 +0x136426F0 +0x136426F8 +0x13642700 +0x13642708 +0x0A76D4F0 +0x0A76D4F8 +0x0A76D500 +0x1445A8A0 +0x1445A8A8 +0x1445A8B0 +0x1445A8B8 +0x1445A8C0 +0x1445A8C8 +0x1D6B3AF8 +0x1D6B3AF8 +0x06B5CD78 +0x06B5CD80 +0x06B5CD88 +0x06B5CD90 +0x06B5CD98 +0x06B5CDA0 +0x06B5CDA8 +0x06B5CDB0 +0x06B5CDB8 +0x11866330 +0x11866338 +0x11866340 +0x11866348 +0x11866350 +0x1CFDFA00 +0x1CFDFA08 +0x1CFDFA10 +0x0E1ADC38 +0x0E1ADC38 +0x02EE45E4 +0x02EE45E4 +0x1B6276F0 +0x1B6276F0 +0x164BECE8 +0x03E2C7C4 +0x03E2C7CC +0x03E2C7D4 +0x03E2C7DC +0x19BC33D8 +0x19BC33D8 +0x00E741DF +0x00E741E7 +0x00E741EF +0x00E741F7 +0x00E741FF +0x00E74207 +0x00E7420F +0x00E74217 +0x00E7421F +0x1A887548 +0x1A887550 +0x1A887558 +0x1A887560 +0x1A887568 +0x1A887570 +0x1A887578 +0x1805B000 +0x0E62DCE0 +0x0E62DCE0 +0x08EE9228 +0x08EE9230 +0x08EE9238 +0x08EE9240 +0x01F983F4 +0x01F983FC +0x01F98404 +0x01F9840C +0x1E35BC78 +0x1E35BC80 +0x1E35BC88 +0x1E35BC90 +0x1E35BC98 +0x1E35BCA0 +0x02AA855C +0x02AA8564 +0x02AA856C +0x02AA8574 +0x02AA857C +0x02AA8584 +0x0532CA78 +0x0532CA80 +0x0532CA88 +0x0532CA90 +0x0532CA98 +0x0532CAA0 +0x0532CAA8 +0x0532CAB0 +0x0532CAB8 +0x14A4A968 +0x14A4A970 +0x14A4A978 +0x14A4A980 +0x14A4A988 +0x12B4E560 +0x12B4E568 +0x12B4E570 +0x0F849F48 +0x0F849F50 +0x0F849F58 +0x0F849F60 +0x0F849F68 +0x186D70E8 +0x186D70F0 +0x186D70F8 +0x186D7100 +0x186D7108 +0x186D7110 +0x186D7118 +0x12FD2638 +0x12FD2638 +0x1765AEE8 +0x1765AEE8 +0x16086C60 +0x16086C68 +0x16086C70 +0x16086C78 +0x0CD5D9B0 +0x0CD5D9B8 +0x0CD5D9C0 +0x0CD5D9C8 +0x0F491E90 +0x0F491E90 +0x0D135A40 +0x0D135A48 +0x0D135A50 +0x0D135A58 +0x0D135A60 +0x0D6B5AF0 +0x0D6B5AF8 +0x0D6B5B00 +0x0D6B5B08 +0x0D6B5B10 +0x0D6B5B18 +0x0D6B5B20 +0x1524AA78 +0x1524AA78 +0x1B62F718 +0x1B62F718 +0x098E9370 +0x098E9370 +0x029A058C +0x029A058C +0x1386A710 +0x1386A710 +0x09EE13E8 +0x09EE13E8 +0x0797CF78 +0x0797CF80 +0x0797CF88 +0x0007C00F +0x0007C017 +0x023684C4 +0x1C3CB880 +0x1C3CB888 +0x1C3CB890 +0x1C3CB898 +0x1C3CB8A0 +0x1C3CB8A8 +0x1C3CB8B0 +0x0A47D4C8 +0x0A47D4D0 +0x0A47D4D8 +0x17A66F40 +0x17A66F48 +0x17A66F50 +0x17A66F58 +0x17A66F60 +0x17A66F68 +0x05190A70 +0x05190A78 +0x05190A80 +0x05190A88 +0x05190A90 +0x05190A98 +0x0B5A16B0 +0x17666EF0 +0x17666EF0 +0x15BF2BA8 +0x15BF2BB0 +0x15BF2BB8 +0x15BF2BC0 +0x15BF2BC8 +0x15BF2BD0 +0x0DC35B98 +0x0DC35BA0 +0x0DC35BA8 +0x0DC35BB0 +0x0DC35BB8 +0x0DC35BC0 +0x0DC35BC8 +0x0DC35BD0 +0x02E5C60C +0x02E5C614 +0x02E5C61C +0x03FB87F8 +0x03FB8800 +0x03FB8808 +0x05C60BC8 +0x05C60BC8 +0x16A56D80 +0x16A56D88 +0x16A56D90 +0x16A56D98 +0x00A10142 +0x05A64B80 +0x05A64B88 +0x05A64B90 +0x05A64B98 +0x05A64BA0 +0x05A64BA8 +0x0A32D460 +0x0A32D468 +0x0A32D470 +0x0B4C16A0 +0x0B4C16A8 +0x0B4C16B0 +0x0B4C16B8 +0x0B4C16C0 +0x0B4C16C8 +0x0B4C16D0 +0x0B4C16D8 +0x0B4C16E0 +0x1CEDBA28 +0x1CEDBA30 +0x0199C334 +0x0199C33C +0x0199C344 +0x1CC3F9B0 +0x1CC3F9B0 +0x01EB8408 +0x01EB8408 +0x15346A70 +0x15346A70 +0x14D1E9B8 +0x14D1E9B8 +0x05874B68 +0x05874B70 +0x1BD8F7C0 +0x1BD8F7C8 +0x1BD8F7D0 +0x1BD8F7D8 +0x107DE148 +0x107DE148 +0x1CAEF968 +0x1CAEF968 +0x0026C055 +0x0026C055 +0x11ACE3A0 +0x11ACE3A8 +0x050E0A20 +0x050E0A28 +0x050E0A30 +0x050E0A38 +0x050E0A40 +0x050E0A48 +0x050E0A50 +0x0CFB9A00 +0x0CFB9A00 +0x1E083C28 +0x1E083C30 +0x1E083C38 +0x1E083C40 +0x1E083C48 +0x1E083C50 +0x1E083C58 +0x1E083C60 +0x1E083C68 +0x1E32FCA8 +0x1E32FCA8 +0x034B86D8 +0x034B86E0 +0x034B86E8 +0x034B86F0 +0x034B86F8 +0x12BAE580 +0x12BAE588 +0x12BAE590 +0x12BAE598 +0x1DFB7C18 +0x1DFB7C20 +0x1DFB7C28 +0x1DFB7C30 +0x1DFB7C38 +0x190E7270 +0x0F581EB0 +0x0F581EB8 +0x0F581EC0 +0x0F581EC8 +0x06B6CD90 +0x06B6CD98 +0x06B6CDA0 +0x06B6CDA8 +0x06B6CDB0 +0x06B6CDB8 +0x025A0514 +0x025A0514 +0x10242088 +0x12D025A0 +0x12D025A8 +0x12D025B0 +0x12D025B8 +0x12D025C0 +0x12D025C8 +0x1BA8F780 +0x1BA8F780 +0x050E0A38 +0x050E0A38 +0x0BA95768 +0x0BA95770 +0x0BA95778 +0x0BA95780 +0x0BA95788 +0x0BA95790 +0x1032A0A0 +0x1032A0A0 +0x09EE1430 +0x09EE1430 +0x1E753D40 +0x13AAE760 +0x13AAE768 +0x13AAE770 +0x13AAE778 +0x13AAE780 +0x13AAE788 +0x1078E160 +0x1DE37BC0 +0x1DE37BC8 +0x1DE37BD0 +0x1DE37BD8 +0x06FB4DF8 +0x06FB4DF8 +0x06628CD8 +0x06628CD8 +0x1AA9B598 +0x1AA9B5A0 +0x1AA9B5A8 +0x1AA9B5B0 +0x0F4CDEA0 +0x0CB25960 +0x0CB25960 +0x10A5A160 +0x10A5A160 +0x1C6AB8E0 +0x1C6AB8E0 +0x1A043400 +0x1A043400 +0x1C0CB848 +0x1C0CB850 +0x1C0CB858 +0x1C0CB860 +0x1C0CB868 +0x1C0CB870 +0x1C0CB878 +0x1C0CB880 +0x077C0EF8 +0x00A7018E +0x00A7018E +0x007F412E +0x007F4136 +0x007F413E +0x007F4146 +0x007F414E +0x007F4156 +0x103620B0 +0x1BC4B780 +0x1BC4B788 +0x1BC4B790 +0x1BC4B798 +0x1BC4B7A0 +0x1BC4B7A8 +0x1BC4B7B0 +0x1BC4B7B8 +0x079CCF58 +0x079CCF60 +0x079CCF68 +0x079CCF70 +0x079CCF78 +0x079CCF80 +0x079CCF88 +0x0A37D498 +0x0A37D4A0 +0x0A37D4A8 +0x0A37D4B0 +0x0A37D4B8 +0x0A37D4C0 +0x1F36FE60 +0x1F36FE68 +0x1F36FE70 +0x12D025B8 +0x12D025C0 +0x12D025C8 +0x12D025D0 +0x12D025D8 +0x12D025E0 +0x13266678 +0x13266680 +0x13266688 +0x13266690 +0x0E165C30 +0x0E165C38 +0x0E165C40 +0x0E165C48 +0x1EEC3E10 +0x1EEC3E18 +0x1EEC3E20 +0x1EEC3E28 +0x1EEC3E30 +0x1FE33FC0 +0x1F61FED0 +0x1F61FED8 +0x1F61FEE0 +0x1F61FEE8 +0x1F61FEF0 +0x1F61FEF8 +0x1F61FF00 +0x1F61FF08 +0x1066A100 +0x1066A100 +0x15B6EB70 +0x15B6EB70 +0x15C56B98 +0x15C56BA0 +0x15C56BA8 +0x15C56BB0 +0x15C56BB8 +0x038D4754 +0x038D475C +0x038D4764 +0x038D476C +0x038D4774 +0x038D477C +0x02A08540 +0x02A08548 +0x1F88FF40 +0x1F88FF48 +0x1F88FF50 +0x1F88FF58 +0x1F88FF60 +0x017682EE +0x017682F6 +0x017682FE +0x01768306 +0x0176830E +0x1B5F3700 +0x1B5F3708 +0x1B5F3710 +0x1B5F3718 +0x0F1A1E30 +0x0F1A1E38 +0x0F1A1E40 +0x0F1A1E48 +0x0F1A1E50 +0x10996178 +0x10996178 +0x0275451C +0x02754524 +0x0275452C +0x02754534 +0x0275453C +0x02754544 +0x0275454C +0x14A9E960 +0x00FB421F +0x00FB4227 +0x00FB422F +0x00FB4237 +0x00FB423F +0x1C457888 +0x1C457888 +0x0D7CDB10 +0x0D7CDB10 +0x1544EAD0 +0x1EA33D40 +0x1EA33D48 +0x1EA33D50 +0x1EA33D58 +0x1EA33D60 +0x172CEE80 +0x172CEE88 +0x172CEE90 +0x172CEE98 +0x172CEEA0 +0x172CEEA8 +0x133C2690 +0x133C2690 +0x0A971578 +0x0A971578 +0x1BFC3860 +0x104B60A0 +0x104B60A8 +0x104B60B0 +0x104B60B8 +0x104B60C0 +0x104B60C8 +0x104B60D0 +0x086C1128 +0x086C1130 +0x086C1138 +0x0DC35B80 +0x0DC35B88 +0x0DC35B90 +0x0DC35B98 +0x08E491E8 +0x08E491F0 +0x08E491F8 +0x08E49200 +0x08E49208 +0x08E49210 +0x15A72B68 +0x15A72B70 +0x15A72B78 +0x15A72B80 +0x15A72B88 +0x0722CE48 +0x0722CE50 +0x0722CE58 +0x0722CE60 +0x161AEC60 +0x161AEC60 +0x0F3E1EB8 +0x0F3E1EC0 +0x0F3E1EC8 +0x0F3E1ED0 +0x0F3E1ED8 +0x1BB93780 +0x1BB93788 +0x1BB93790 +0x1BB93798 +0x0F59DEF0 +0x0F59DEF8 +0x0F59DF00 +0x0F59DF08 +0x1CF179E0 +0x1CF179E8 +0x1099E180 +0x1099E188 +0x1099E190 +0x1099E198 +0x1C1D3840 +0x1C1D3848 +0x1C1D3850 +0x1C1D3858 +0x1C1D3860 +0x044E08A8 +0x044E08B0 +0x044E08B8 +0x044E08C0 +0x044E08C8 +0x044E08D0 +0x09E593D0 +0x09E593D8 +0x09E593E0 +0x09E593E8 +0x09E593F0 +0x09E593F8 +0x09E59400 +0x10936140 +0x10936140 +0x14AAE9A8 +0x1665ECC0 +0x1665ECC8 +0x1665ECD0 +0x1665ECD8 +0x1665ECE0 +0x1665ECE8 +0x033E469C +0x033E46A4 +0x033E46AC +0x033E46B4 +0x033E46BC +0x033E46C4 +0x033E46CC +0x033E46D4 +0x18B0B198 +0x18B0B1A0 +0x18B0B1A8 +0x18B0B1B0 +0x18B0B1B8 +0x0DBD5B80 +0x0DBD5B88 +0x0DBD5B90 +0x0DBD5B98 +0x0AB39570 +0x0AB39570 +0x08071060 +0x08071060 +0x1E873D50 +0x1E873D58 +0x1E873D60 +0x1F84BF00 +0x1F84BF08 +0x1F84BF10 +0x1F84BF18 +0x1622AC58 +0x1622AC60 +0x1622AC68 +0x1622AC70 +0x1622AC78 +0x1622AC80 +0x01768336 +0x0176833E +0x01768346 +0x0176834E +0x01768356 +0x03EA87D4 +0x03EA87DC +0x03EA87E4 +0x1FB4BF70 +0x1FB4BF78 +0x1FB4BF80 +0x1FB4BF88 +0x1FB4BF90 +0x1FB4BF98 +0x1FB4BFA0 +0x147F6910 +0x147F6910 +0x1E333C78 +0x1E333C78 +0x038D4764 +0x038D4764 +0x0DCD5BC0 +0x0DCD5BC0 +0x183830D8 +0x183830D8 +0x11B8A3C0 +0x11B8A3C0 +0x1144A290 +0x1144A290 +0x1E597D28 +0x1E597D28 +0x1A5334B0 +0x1A5334B0 +0x0BC557B0 +0x0BC557B0 +0x09D393C0 +0x09D393C8 +0x09D393D0 +0x09D393D8 +0x09D393E0 +0x09D393E8 +0x09D393F0 +0x02974530 +0x15E66BF8 +0x15E66C00 +0x15E66C08 +0x15E66C10 +0x15E66C18 +0x15E66C20 +0x15E66C28 +0x09291250 +0x09291258 +0x0B8E9720 +0x0B8E9720 +0x11FF2420 +0x11FF2428 +0x11FF2430 +0x11FF2438 +0x11FF2440 +0x11FF2448 +0x11FF2450 +0x11FF2458 +0x079CCF48 +0x079CCF48 +0x05EECBE0 +0x05EECBE8 +0x05EECBF0 +0x05EECBF8 +0x05EECC00 +0x05EECC08 +0x05EECC10 +0x05EECC18 +0x05EECC20 +0x0EF31E40 +0x0EF31E40 +0x1D7CFB40 +0x1D7CFB48 +0x1D7CFB50 +0x1AEB75E0 +0x1AEB75E8 +0x1AEB75F0 +0x1A03B440 +0x1A03B448 +0x01D2C3A6 +0x01D2C3AE +0x01D2C3B6 +0x01D2C3BE +0x0AFB5620 +0x0AFB5620 +0x143D68D0 +0x143D68D0 +0x1C87F960 +0x1C87F960 +0x038C4720 +0x038C4728 +0x038C4730 +0x038C4738 +0x038C4740 +0x038C4748 +0x038C4750 +0x0751CEF0 +0x0751CEF8 +0x0751CF00 +0x0751CF08 +0x13086620 +0x13086628 +0x11B9A3B0 +0x11B9A3B8 +0x11B9A3C0 +0x11B9A3C8 +0x11B9A3D0 +0x11B9A3D8 +0x11B9A3E0 +0x0FD69FB0 +0x16046C50 +0x16046C50 +0x0106825E +0x01068266 +0x1DC13B80 +0x1DC13B88 +0x1DC13B90 +0x11AA2398 +0x11AA23A0 +0x11AA23A8 +0x11AA23B0 +0x11AA23B8 +0x188EB120 +0x188EB128 +0x188EB130 +0x188EB138 +0x00A1016A +0x00A1016A +0x00A78167 +0x00A7816F +0x00A78177 +0x00A7817F +0x00A78187 +0x142CE888 +0x142CE888 +0x1524AA80 +0x1524AA80 +0x1FB1BF78 +0x1FB1BF80 +0x1FB1BF88 +0x1FB1BF90 +0x1FB1BF98 +0x1FB1BFA0 +0x1FB1BFA8 +0x1FB1BFB0 +0x0A5454E8 +0x0A5454E8 +0x1794EF30 +0x1794EF38 +0x1794EF40 +0x1794EF48 +0x1794EF50 +0x1794EF58 +0x1794EF60 +0x1794EF68 +0x1794EF70 +0x0676CD18 +0x0676CD20 +0x0676CD28 +0x0676CD30 +0x0676CD38 +0x0676CD40 +0x0676CD48 +0x0676CD50 +0x1DA63B50 +0x1DA63B58 +0x1DA63B60 +0x1DA63B68 +0x1DA63B70 +0x1DA63B78 +0x1ECEBDE8 +0x1ECEBDF0 +0x1ECEBDF8 +0x03D247A4 +0x03D247AC +0x03D247B4 +0x03D247BC +0x1487E908 +0x1487E910 +0x1487E918 +0x1487E920 +0x1487E928 +0x1487E930 +0x1487E938 +0x1487E940 +0x124B64F8 +0x0BEFD7E0 +0x0BEFD7E8 +0x0BEFD7F0 +0x0BEFD7F8 +0x0BEFD800 +0x0BEFD808 +0x0BEFD810 +0x0BEFD818 +0x1433A878 +0x1433A880 +0x1433A888 +0x1433A890 +0x1433A898 +0x1433A8A0 +0x1433A8A8 +0x1433A8B0 +0x14996978 +0x14996978 +0x16CDADA8 +0x16CDADA8 +0x13812708 +0x13812710 +0x13812718 +0x13812720 +0x13812728 +0x13812730 +0x13812738 +0x13812740 +0x13812748 +0x152E6AC0 +0x003F007E +0x003F0086 +0x003F008E +0x003F0096 +0x003F009E +0x0FDADFF8 +0x0FDADFF8 +0x1DF2FBF8 +0x1DF2FBF8 +0x16BCEDB8 +0x16BCEDC0 +0x16BCEDC8 +0x16BCEDD0 +0x16BCEDD8 +0x16BCEDE0 +0x16BCEDE8 +0x14AD6960 +0x14AD6968 +0x1868B128 +0x1868B128 +0x1ED4FDB0 +0x1ED4FDB8 +0x1ED4FDC0 +0x1ED4FDC8 +0x1ED4FDD0 +0x1ED4FDD8 +0x1ED4FDE0 +0x1ED4FDE8 +0x1FEC8040 +0x1FEC8040 +0x13E26800 +0x13E26808 +0x13E26810 +0x13E26818 +0x13E26820 +0x13E26828 +0x19033200 +0x19033208 +0x120D6468 +0x120D6468 +0x03B98794 +0x03B98794 +0x135FE6C8 +0x135FE6C8 +0x16046C18 +0x16046C18 +0x11796308 +0x11796310 +0x11796318 +0x11796320 +0x11796328 +0x11796330 +0x1200E440 +0x1200E440 +0x10FE6208 +0x10FE6210 +0x10FE6218 +0x10FE6220 +0x10FE6228 +0x10FE6230 +0x1E507CE8 +0x1E507CF0 +0x1E507CF8 +0x1E507D00 +0x121EE440 +0x121EE448 +0x121EE450 +0x121EE458 +0x121EE460 +0x09CA9390 +0x09CA9390 +0x10CEA1F8 +0x10CEA1F8 +0x1EBFBD80 +0x1EBFBD88 +0x1EBFBD90 +0x1EBFBD98 +0x1EBFBDA0 +0x155D6AE8 +0x155D6AE8 +0x0466C900 +0x0466C908 +0x0466C910 +0x0466C918 +0x05AE0B60 +0x08609100 +0x08609100 +0x055B4AD8 +0x055B4AE0 +0x055B4AE8 +0x055B4AF0 +0x055B4AF8 +0x055B4B00 +0x055B4B08 +0x055B4B10 +0x055B4B18 +0x1FB9BFB0 +0x1FB9BFB8 +0x1FB9BFC0 +0x1FB9BFC8 +0x1E35FC60 +0x1E35FC68 +0x064D4CA8 +0x064D4CB0 +0x064D4CB8 +0x064D4CC0 +0x064D4CC8 +0x064D4CD0 +0x064D4CD8 +0x099B5370 +0x099B5378 +0x099B5380 +0x009BC138 +0x009BC140 +0x18C6F198 +0x18C6F198 +0x1063E108 +0x05EFCBE0 +0x05EFCBE8 +0x05EFCBF0 +0x05EFCBF8 +0x05EFCC00 +0x05EFCC08 +0x05EFCC10 +0x05EFCC18 +0x0E4D1CA8 +0x0E4D1CA8 +0x09E8D3D8 +0x09E8D3E0 +0x09E8D3E8 +0x09E8D3F0 +0x09E8D3F8 +0x09E8D400 +0x09E8D408 +0x09E8D410 +0x03280650 +0x03280658 +0x03280660 +0x03280668 +0x03280670 +0x03280678 +0x03280680 +0x1CFF3A08 +0x1CFF3A10 +0x1CFF3A18 +0x1CFF3A20 +0x1CFF3A28 +0x1CFF3A30 +0x15172A28 +0x15172A30 +0x15172A38 +0x15172A40 +0x15172A48 +0x15172A50 +0x15172A58 +0x08F21218 +0x08F21220 +0x08F21228 +0x08F21230 +0x095C52C0 +0x095C52C8 +0x06D34DD8 +0x06D34DD8 +0x1F2D3EA0 +0x1F2D3EA0 +0x08CA51F0 +0x08CA51F0 +0x040C0828 +0x040C0830 +0x040C0838 +0x040C0840 +0x040C0848 +0x040C0850 +0x09291290 +0x09291290 +0x10142040 +0x10142048 +0x10142050 +0x10142058 +0x10142060 +0x10142068 +0x10142070 +0x1380A730 +0x1380A738 +0x1380A740 +0x1380A748 +0x1380A750 +0x1ECCFDA0 +0x1ECCFDA8 +0x1ECCFDB0 +0x13AF2760 +0x13AF2768 +0x13AF2770 +0x13AF2778 +0x13AF2780 +0x13AF2788 +0x13AF2790 +0x13AF2798 +0x08A05158 +0x08A05158 +0x0B24D670 +0x0B24D670 +0x1F0AFE70 +0x1F0AFE78 +0x1F0AFE80 +0x1F0AFE88 +0x0F6DDEE0 +0x0F6DDEE8 +0x133526A8 +0x186330C0 +0x186330C8 +0x186330D0 +0x186330D8 +0x186330E0 +0x186330E8 +0x186330F0 +0x186330F8 +0x1D6AFB30 +0x1C09F820 +0x1C09F828 +0x1C09F830 +0x1C09F838 +0x1C09F840 +0x1C09F848 +0x035786B0 +0x035786B8 +0x035786C0 +0x035786C8 +0x035786D0 +0x035786D8 +0x09CA93C8 +0x09CA93D0 +0x09CA93D8 +0x0FDADFB0 +0x0FDADFB8 +0x0FDADFC0 +0x0FDADFC8 +0x1592EB28 +0x1592EB30 +0x1592EB38 +0x1592EB40 +0x1592EB48 +0x1592EB50 +0x1592EB58 +0x1592EB60 +0x08B5D1D0 +0x08DFD1C0 +0x08DFD1C8 +0x08DFD1D0 +0x08DFD1D8 +0x08DFD1E0 +0x1C13F828 +0x1C13F828 +0x16FE2E20 +0x16FE2E28 +0x16FE2E30 +0x16FE2E38 +0x16FE2E40 +0x16FE2E48 +0x17B2EF98 +0x17B2EF98 +0x019FC358 +0x019FC360 +0x019FC368 +0x019FC370 +0x019FC378 +0x019FC380 +0x019FC388 +0x060ACC18 +0x060ACC20 +0x0117428E +0x1349E6A0 +0x1349E6A8 +0x1349E6B0 +0x1349E6B8 +0x1349E6C0 +0x1349E6C8 +0x1536EA98 +0x1536EAA0 +0x1536EAA8 +0x1536EAB0 +0x1536EAB8 +0x1BB9B788 +0x1BB9B788 +0x141DE860 +0x141DE860 +0x1402A848 +0x1402A848 +0x092B9270 +0x092B9278 +0x092B9280 +0x092B9288 +0x092B9290 +0x0DA45BB0 +0x0DA45BB8 +0x1FB9BF80 +0x1FB9BF88 +0x1FB9BF90 +0x1FB9BF98 +0x16A56D98 +0x16A56D98 +0x0F90DF20 +0x0F90DF28 +0x0F90DF30 +0x0F90DF38 +0x0F90DF40 +0x0F90DF48 +0x0F90DF50 +0x1F0E3E28 +0x1F0E3E30 +0x1F0E3E38 +0x1F0E3E40 +0x1F0E3E48 +0x0DA5DBA8 +0x0DA5DBB0 +0x0DA5DBB8 +0x06E7CDD0 +0x06E7CDD8 +0x06E7CDE0 +0x04FE0A40 +0x04FE0A48 +0x04FE0A50 +0x0ECB1D90 +0x0ECB1D98 +0x0ECB1DA0 +0x0ECB1DA8 +0x0ECB1DB0 +0x0ECB1DB8 +0x1F3C3ED8 +0x1F3C3EE0 +0x1F3C3EE8 +0x16FAAE00 +0x16FAAE08 +0x16FAAE10 +0x133566B0 +0x133566B8 +0x133566C0 +0x11C2E380 +0x11C2E388 +0x1CF3BA08 +0x1CF3BA10 +0x1CF3BA18 +0x1CF3BA20 +0x1CF3BA28 +0x1CF3BA30 +0x0E165C30 +0x082C1088 +0x082C1088 +0x1D4FBB00 +0x1D4FBB00 +0x1551AAB0 +0x1551AAB0 +0x0BFD1800 +0x0BFD1808 +0x0BFD1810 +0x0BFD1818 +0x0BFD1820 +0x0BFD1828 +0x0BFD1830 +0x1A8C3580 +0x0E7A1CF0 +0x0E7A1CF8 +0x0E7A1D00 +0x0E7A1D08 +0x0E7A1D10 +0x0E7A1D18 +0x0D719AF0 +0x0D719AF0 +0x095552D8 +0x095552E0 +0x095552E8 +0x095552F0 +0x095552F8 +0x09555300 +0x0EFA5DF0 +0x0EFA5DF8 +0x0EFA5E00 +0x1D9EBB48 +0x1D9EBB50 +0x1D9EBB58 +0x1D9EBB60 +0x1D9EBB68 +0x1D9EBB70 +0x1D9EBB78 +0x1D9EBB80 +0x186E30F0 +0x186E30F8 +0x186E3100 +0x186E3108 +0x186E3110 +0x186E3118 +0x15F16C10 +0x15F16C18 +0x15F16C20 +0x15F16C28 +0x15F16C30 +0x15F16C38 +0x15F16C40 +0x15F16C48 +0x1A2BB4A8 +0x1A2BB4A8 +0x1BFBF848 +0x00E741CF +0x00E741D7 +0x00E741DF +0x00E741E7 +0x00E741EF +0x00E741F7 +0x1516EA58 +0x1516EA58 +0x01DC83D2 +0x01DC83DA +0x01DC83E2 +0x01DC83EA +0x01DC83F2 +0x0BA69760 +0x0BA69768 +0x0BA69770 +0x0BA69778 +0x0BA69780 +0x06628CE8 +0x06628CF0 +0x06628CF8 +0x06628D00 +0x06628D08 +0x06628D10 +0x186B7118 +0x186B7120 +0x186B7128 +0x186B7130 +0x186B7138 +0x186B7140 +0x1CC3F980 +0x1CC3F988 +0x1CC3F990 +0x1063A100 +0x1063A108 +0x0C18D830 +0x0C18D838 +0x0C18D840 +0x0C18D848 +0x0C18D850 +0x06A48D88 +0x06A48D88 +0x1322A668 +0x1322A670 +0x1322A678 +0x1322A680 +0x1322A688 +0x19797348 +0x0C255850 +0x0C255858 +0x0C255860 +0x0C255868 +0x11262250 +0x11262258 +0x11262260 +0x11262268 +0x11262270 +0x11262278 +0x11262280 +0x11262288 +0x1D83FB38 +0x1D83FB38 +0x0A9A9570 +0x0A9A9578 +0x0A9A9580 +0x0A9A9588 +0x0A9A9590 +0x08E011C0 +0x08E011C8 +0x0ADA1600 +0x0ADA1600 +0x1EAD7DA8 +0x1EAD7DB0 +0x127564E0 +0x127564E8 +0x127564F0 +0x0DEB1BD8 +0x0DEB1BD8 +0x06E8CDE8 +0x06E8CDF0 +0x06E8CDF8 +0x06E8CE00 +0x06E8CE08 +0x06E8CE10 +0x162AEC88 +0x162AEC88 +0x018D4352 +0x018D4352 +0x0E0F1C68 +0x0E0F1C68 +0x13ADA788 +0x13ADA790 +0x13ADA798 +0x13ADA7A0 +0x13ADA7A8 +0x10996180 +0x10996188 +0x10996190 +0x0C249850 +0x0C249858 +0x0C249860 +0x0ADFD610 +0x0ADFD618 +0x0ADFD620 +0x0ADFD628 +0x1D473A80 +0x1D473A88 +0x1D473A90 +0x1D473A98 +0x0C215848 +0x0C215850 +0x0C215858 +0x0C215860 +0x0C215868 +0x0C215870 +0x0C215878 +0x0C215880 +0x0C215888 +0x0DAF9B60 +0x0DAF9B68 +0x0DAF9B70 +0x0DAF9B78 +0x0DAF9B80 +0x0DAF9B88 +0x0DAF9B90 +0x1BFCB800 +0x1BFCB800 +0x056C8AE0 +0x056C8AE8 +0x056C8AF0 +0x056C8AF8 +0x056C8B00 +0x056C8B08 +0x056C8B10 +0x056C8B18 +0x056C8B20 +0x1AA2B560 +0x1AA2B560 +0x1E35BC60 +0x1E35BC68 +0x1E35BC70 +0x1E35BC78 +0x1E35BC80 +0x1E35BC88 +0x1E35BC90 +0x1E35BC98 +0x08759148 +0x08759150 +0x1512AA20 +0x1512AA28 +0x1512AA30 +0x0D179A70 +0x0D179A70 +0x1D8F3B68 +0x1D8F3B70 +0x1D8F3B78 +0x1D8F3B80 +0x0CAC5960 +0x0CAC5968 +0x0CAC5970 +0x0CAC5978 +0x14ED2A10 +0x14ED2A10 +0x09099218 +0x09099220 +0x09099228 +0x09099230 +0x09099238 +0x09099240 +0x1EF1FE08 +0x1EF1FE08 +0x029A0584 +0x029A0584 +0x167AED18 +0x167AED18 +0x1D59BAE8 +0x1D59BAE8 +0x1878F160 +0x1878F160 +0x086290D0 +0x086290D8 +0x086290E0 +0x086290E8 +0x086290F0 +0x1CDEF9E8 +0x1CDEF9E8 +0x13AF2780 +0x13AF2788 +0x13AF2790 +0x13AF2798 +0x13AF27A0 +0x01144228 +0x01144228 +0x01DC83DA +0x01DC83E2 +0x01DC83EA +0x01DC83F2 +0x01DC83FA +0x01DC8402 +0x01DC840A +0x097612F8 +0x09761300 +0x09761308 +0x09761310 +0x09761318 +0x09761320 +0x09761328 +0x09761330 +0x09761338 +0x11D763C8 +0x11D763C8 +0x02944568 +0x02944570 +0x02944578 +0x02944580 +0x02944588 +0x02944590 +0x096412D0 +0x096412D8 +0x096412E0 +0x0722CE88 +0x0722CE88 +0x037B8708 +0x037B8708 +0x1ADC75F0 +0x1ADC75F8 +0x1ADC7600 +0x1ADC7608 +0x1ADC7610 +0x10002000 +0x1BA17778 +0x1BA17780 +0x1BA17788 +0x1BA17790 +0x1BA17798 +0x1BA177A0 +0x1BE1B7F0 +0x1BE1B7F0 +0x055FCB00 +0x055FCB08 +0x055FCB10 +0x055FCB18 +0x055FCB20 +0x15B7AB60 +0x15B7AB68 +0x15B7AB70 +0x15B7AB78 +0x044688B0 +0x044688B8 +0x044688C0 +0x044688C8 +0x044688D0 +0x044688D8 +0x044688E0 +0x044688E8 +0x044688F0 +0x10DAE1E8 +0x10DAE1E8 +0x1BF0B838 +0x1BF0B838 +0x00B44169 +0x00B44171 +0x00B44179 +0x00B44181 +0x00B44189 +0x00B44191 +0x00B44199 +0x00B441A1 +0x00B441A9 +0x05D48BB8 +0x05D48BC0 +0x05D48BC8 +0x05D48BD0 +0x05D48BD8 +0x05D48BE0 +0x0F24DE60 +0x0F24DE60 +0x12FF6618 +0x12FF6618 +0x122A2488 +0x122A2490 +0x122A2498 +0x122A24A0 +0x122A24A8 +0x06010C00 +0x06010C08 +0x06010C10 +0x1B07B648 +0x1B07B648 +0x013E427C +0x013E427C +0x1E3E3C88 +0x1E3E3C88 +0x0AF5D650 +0x0AF5D650 +0x07420EA8 +0x07420EB0 +0x07420EB8 +0x07420EC0 +0x07420EC8 +0x07420ED0 +0x07420ED8 +0x07420EE0 +0x08E211E0 +0x08E211E8 +0x08E211F0 +0x08E211F8 +0x08E21200 +0x17E3F010 +0x17E3F018 +0x17E3F020 +0x1C31F860 +0x1C31F868 +0x1C31F870 +0x1C31F878 +0x1C31F880 +0x1C31F888 +0x01800338 +0x01800338 +0x1BD937D8 +0x1BD937E0 +0x1BD937E8 +0x1BD937F0 +0x1BD937F8 +0x1BD93800 +0x1BD93808 +0x1BD93810 +0x1BD93818 +0x1A007420 +0x1A007428 +0x1A007430 +0x1A007438 +0x1A007440 +0x1A007448 +0x1A007450 +0x1C367860 +0x1C367868 +0x195AB300 +0x195AB300 +0x0A00D410 +0x0A00D410 +0x1927B298 +0x1927B2A0 +0x1927B2A8 +0x084B1090 +0x084B1098 +0x084B10A0 +0x011D0262 +0x011D026A +0x011D0272 +0x011D027A +0x011D0282 +0x07F55048 +0x07F55048 +0x07974F78 +0x07974F78 +0x17B2EF90 +0x17B2EF98 +0x17B2EFA0 +0x17B2EFA8 +0x17B2EFB0 +0x09B2D3A8 +0x09B2D3A8 +0x0F849F38 +0x0F849F40 +0x0F849F48 +0x0F849F50 +0x0F849F58 +0x19A47398 +0x19A47398 +0x07A34F98 +0x07A34FA0 +0x07A34FA8 +0x1CEAF9E0 +0x1CEAF9E8 +0x1CEAF9F0 +0x1CEAF9F8 +0x01AC0388 +0x01AC0388 +0x1AAC7570 +0x1AAC7570 +0x08EED1E8 +0x08EED1E8 +0x09B5D3C0 +0x09B5D3C0 +0x03D307C8 +0x03D307D0 +0x03D307D8 +0x03D307E0 +0x03D307E8 +0x03D307F0 +0x03D307F8 +0x0C679908 +0x0C679908 +0x13DD67F0 +0x13DD67F0 +0x0A5854E0 +0x0A5854E8 +0x0A5854F0 +0x0A5854F8 +0x0A585500 +0x0A585508 +0x0F161E30 +0x0F161E38 +0x0C4FD8E0 +0x0C4FD8E0 +0x17522EC8 +0x17522ED0 +0x17522ED8 +0x17522EE0 +0x17522EE8 +0x0FC05F98 +0x0FC05F98 +0x0FB71FB8 +0x0FB71FB8 +0x1A82F520 +0x1A82F520 +0x04840960 +0x04840968 +0x11BBE380 +0x11BBE388 +0x11BBE390 +0x11BBE398 +0x121FA490 +0x121FA490 +0x1415E868 +0x1415E870 +0x1415E878 +0x0924D250 +0x0924D258 +0x0924D260 +0x0924D268 +0x0924D270 +0x099B5358 +0x099B5360 +0x099B5368 +0x099B5370 +0x099B5378 +0x1E273C88 +0x1E273C88 +0x1FA17F90 +0x1FA17F90 +0x1A16B430 +0x1A16B430 +0x1F84FF00 +0x1F84FF00 +0x05CA8BF8 +0x05CA8C00 +0x10386080 +0x10386088 +0x10386090 +0x10386098 +0x103860A0 +0x103860A8 +0x103860B0 +0x1F56FEB0 +0x1F56FEB8 +0x1F56FEC0 +0x1F56FEC8 +0x1F56FED0 +0x1F56FED8 +0x1F56FEE0 +0x1D803B60 +0x1D803B60 +0x1A41F488 +0x1A41F490 +0x1A41F498 +0x1A41F4A0 +0x1A41F4A8 +0x1A41F4B0 +0x1A41F4B8 +0x1A41F4C0 +0x1C287860 +0x1C287860 +0x01FEC42E +0x01FEC436 +0x01FEC43E +0x01FEC446 +0x01FEC44E +0x01FEC456 +0x01FEC45E +0x02FCC610 +0x02FCC618 +0x02FCC620 +0x02FCC628 +0x02FCC630 +0x02FCC638 +0x02FCC640 +0x02FCC648 +0x02FCC650 +0x0396474C +0x0396474C +0x1347E698 +0x1347E698 +0x1380A718 +0x1380A718 +0x05E40BF8 +0x05E40BF8 +0x18E2F1F0 +0x18E2F1F8 +0x18E2F200 +0x18E2F208 +0x18E2F210 +0x1302A600 +0x1302A608 +0x11926348 +0x11926350 +0x11926358 +0x11926360 +0x11926368 +0x11926370 +0x11926378 +0x19F3F3E0 +0x039F4760 +0x039F4760 +0x07728F40 +0x07728F48 +0x195BF2C0 +0x195BF2C8 +0x195BF2D0 +0x195BF2D8 +0x0D975B50 +0x0D975B50 +0x0AFC5600 +0x0AFC5608 +0x0AFC5610 +0x0AFC5618 +0x0AFC5620 +0x0AFC5628 +0x0AFC5630 +0x0AFC5638 +0x03060624 +0x0306062C +0x03060634 +0x0306063C +0x03060644 +0x0306064C +0x03060654 +0x05B54B68 +0x05B54B70 +0x0DA25B90 +0x0DA25B90 +0x11DAE3C0 +0x11DAE3C8 +0x11DAE3D0 +0x11DAE3D8 +0x11DAE3E0 +0x11DAE3E8 +0x11DAE3F0 +0x11DAE3F8 +0x14D1E9B0 +0x14D1E9B0 +0x09B5D378 +0x09B5D378 +0x1347E698 +0x1347E698 +0x133566C0 +0x11C2E380 +0x11C2E388 +0x11C2E390 +0x11C2E398 +0x10E22208 +0x10E22210 +0x10E22218 +0x10E22220 +0x10E22228 +0x1D8F3B20 +0x171B2E40 +0x171B2E48 +0x171B2E50 +0x171B2E58 +0x171B2E60 +0x171B2E68 +0x171B2E70 +0x176EAEF8 +0x176EAEF8 +0x03A2879C +0x03A287A4 +0x03A287AC +0x15D32BA0 +0x15D32BA8 +0x15D32BB0 +0x06084C50 +0x06084C58 +0x06084C60 +0x06084C68 +0x06084C70 +0x1228E460 +0x1228E468 +0x14B6A998 +0x14B6A998 +0x14D1E9B0 +0x14D1E9B0 +0x161C6C68 +0x161C6C70 +0x161C6C78 +0x161C6C80 +0x161C6C88 +0x02838528 +0x02838530 +0x02838538 +0x02838540 +0x02838548 +0x02838550 +0x02838558 +0x15E9ABE0 +0x0688CD20 +0x0688CD28 +0x0688CD30 +0x0688CD38 +0x0688CD40 +0x0688CD48 +0x0688CD50 +0x0688CD58 +0x11B9E3A8 +0x11B9E3B0 +0x11B9E3B8 +0x11B9E3C0 +0x11B9E3C8 +0x0BE95808 +0x0BE95810 +0x0BE95818 +0x0BE95820 +0x0BE95828 +0x05CA0B98 +0x05CA0BA0 +0x05CA0BA8 +0x1177A328 +0x1F0E3E20 +0x1F0E3E28 +0x1F0E3E30 +0x1F0E3E38 +0x1063A100 +0x1063A100 +0x14142868 +0x14142870 +0x14142878 +0x14142880 +0x0A42D480 +0x0A42D488 +0x0A42D490 +0x1C24F870 +0x1C24F878 +0x1C24F880 +0x1C24F888 +0x1C24F890 +0x1C24F898 +0x1C24F8A0 +0x0B8E9758 +0x0B8E9758 +0x024B44D8 +0x024B44E0 +0x1032A060 +0x1032A068 +0x1032A070 +0x1032A078 +0x13DAA7E8 +0x13DAA7E8 +0x13696728 +0x13696728 +0x1386A720 +0x1386A728 +0x1386A730 +0x1386A738 +0x1386A740 +0x18F631F8 +0x18F63200 +0x18F63208 +0x18F63210 +0x18F63218 +0x18F63220 +0x0F1A1E30 +0x0F1A1E38 +0x0F1A1E40 +0x0F1A1E48 +0x0F1A1E50 +0x0F1A1E58 +0x09E8D430 +0x00E401C8 +0x00E401D0 +0x00E401D8 +0x00E401E0 +0x00E401E8 +0x00E401F0 +0x196AB2E8 +0x196AB2F0 +0x196AB2F8 +0x196AB300 +0x196AB308 +0x196AB310 +0x196AB318 +0x196AB320 +0x124264C0 +0x124264C8 +0x124264D0 +0x124264D8 +0x124264E0 +0x0094C152 +0x0094C15A +0x0094C162 +0x0094C16A +0x0094C172 +0x0094C17A +0x13D4E7C0 +0x13D4E7C8 +0x13D4E7D0 +0x13D4E7D8 +0x13D4E7E0 +0x1FCC3FA8 +0x1FCC3FA8 +0x1FF2FFF8 +0x1FF30000 +0x1FF30008 +0x1FF30010 +0x1FF30018 +0x1FF30020 +0x1FF30028 +0x0F889F68 +0x1279A500 +0x1279A508 +0x1279A510 +0x1279A518 +0x1279A520 +0x1279A528 +0x1279A530 +0x1279A538 +0x183830B8 +0x183830B8 +0x0D135A60 +0x0D135A60 +0x1DAB3B90 +0x1DAB3B98 +0x1DAB3BA0 +0x1DAB3BA8 +0x1DAB3BB0 +0x1DAB3BB8 +0x08AA51A0 +0x08AA51A0 +0x176EAEF0 +0x176EAEF0 +0x024CC4F8 +0x024CC500 +0x00BCC17A +0x00BCC182 +0x00BCC18A +0x00BCC192 +0x149D2948 +0x149D2948 +0x07520ED8 +0x07520EE0 +0x07520EE8 +0x07520EF0 +0x07520EF8 +0x07520F00 +0x18FB3230 +0x18FB3230 +0x0E9ADD38 +0x0E9ADD40 +0x0E9ADD48 +0x0E9ADD50 +0x0E9ADD58 +0x06DE8DE8 +0x06DE8DF0 +0x06DE8DF8 +0x06DE8E00 +0x06DE8E08 +0x14B6A970 +0x14B6A970 +0x196FF310 +0x196FF310 +0x07F54FF0 +0x07F54FF0 +0x1B2836B0 +0x1B2836B0 +0x0205C424 +0x0205C42C +0x0205C434 +0x0205C43C +0x0205C444 +0x12B8A5A8 +0x12B8A5B0 +0x12B8A5B8 +0x12B8A5C0 +0x12B8A5C8 +0x12B8A5D0 +0x12B8A5D8 +0x0AA25590 +0x0AA25590 +0x00B08179 +0x00B08179 +0x11126278 +0x11126280 +0x15836B00 +0x15836B08 +0x15836B10 +0x15836B18 +0x15836B20 +0x011C8252 +0x011C825A +0x011C8262 +0x011C826A +0x011C8272 +0x011C827A +0x011C8282 +0x011C828A +0x011C8292 +0x036586DC +0x036586DC +0x15D8EBC0 +0x15D8EBC8 +0x15D8EBD0 +0x15D8EBD8 +0x15D8EBE0 +0x18F371E0 +0x18F371E8 +0x18F371F0 +0x18F371F8 +0x18F37200 +0x18F37208 +0x18F37210 +0x18F37218 +0x18F37220 +0x0ECD9DA0 +0x0ECD9DA0 +0x05A4CB70 +0x05A4CB78 +0x05A4CB80 +0x05A4CB88 +0x05A4CB90 +0x05A4CB98 +0x05A4CBA0 +0x1D07FA48 +0x1D07FA48 +0x1D757B08 +0x1D757B10 +0x1D757B18 +0x1D757B20 +0x1D757B28 +0x1D757B30 +0x1D2FFA80 +0x1D2FFA88 +0x1D2FFA90 +0x1D2FFA98 +0x1D2FFAA0 +0x163DECA8 +0x163DECA8 +0x1878F100 +0x1878F108 +0x1878F110 +0x1878F118 +0x1878F120 +0x1878F128 +0x1FA57F50 +0x1FA57F58 +0x1FA57F60 +0x1FA57F68 +0x1FA57F70 +0x1FA57F78 +0x0C9E9998 +0x0C9E9998 +0x1398E758 +0x1398E758 +0x11996348 +0x11996350 +0x11996358 +0x11996360 +0x11996368 +0x11996370 +0x11996378 +0x11996380 +0x11996388 +0x19E273E0 +0x19E273E8 +0x19E273F0 +0x19E273F8 +0x19E27400 +0x19E27408 +0x129B2540 +0x129B2548 +0x129B2550 +0x129B2558 +0x129B2560 +0x129B2568 +0x129B2570 +0x129B2578 +0x0B405698 +0x0B4056A0 +0x0B4056A8 +0x0B4056B0 +0x0B4056B8 +0x06DB0DC8 +0x06DB0DD0 +0x06DB0DD8 +0x06DB0DE0 +0x06DB0DE8 +0x06DB0DF0 +0x06DB0DF8 +0x0F5A5ED0 +0x0F5A5ED0 +0x011C8262 +0x011C8262 +0x14ED29F8 +0x14ED29F8 +0x03EA0824 +0x03EA0824 +0x0DB11B70 +0x0DB11B70 +0x0A6114C0 +0x0A6114C0 +0x14D169C8 +0x14D169C8 +0x15786B30 +0x15786B38 +0x15786B40 +0x15786B48 +0x15786B50 +0x15786B58 +0x15786B60 +0x096212F8 +0x096212F8 +0x0E9A1D48 +0x0E9A1D48 +0x1CDB7A08 +0x1CDB7A08 +0x14BA69B0 +0x14BA69B8 +0x14BA69C0 +0x14BA69C8 +0x14BA69D0 +0x098D9358 +0x098D9360 +0x098D9368 +0x098D9370 +0x18ECF1E0 +0x18ECF1E8 +0x18ECF1F0 +0x01E80400 +0x01E80400 +0x1347E6D0 +0x1347E6D0 +0x14876948 +0x14876948 +0x0636CC70 +0x0636CC78 +0x0636CC80 +0x0636CC88 +0x0636CC90 +0x0636CC98 +0x08D351F0 +0x08D351F0 +0x08A4D178 +0x08A4D180 +0x08A4D188 +0x08A4D190 +0x08A4D198 +0x06C00D80 +0x06C00D88 +0x06C00D90 +0x06C00D98 +0x07E9D028 +0x07E9D030 +0x07E9D038 +0x17F16FE0 +0x17F16FE8 +0x17F16FF0 +0x17F16FF8 +0x17F17000 +0x1D36FA70 +0x1D36FA70 +0x0B225680 +0x0B225688 +0x0B225690 +0x0B225698 +0x0B2256A0 +0x019FC340 +0x019FC348 +0x0BD017C8 +0x0BD017D0 +0x0BD017D8 +0x0BD017E0 +0x0BD017E8 +0x0BD017F0 +0x0BD017F8 +0x0BD01800 +0x161AEC98 +0x161AEC98 +0x092E9280 +0x092E9288 +0x092E9290 +0x092E9298 +0x092E92A0 +0x1D7CFB18 +0x1D7CFB18 +0x09F093F0 +0x09F093F0 +0x199AB398 +0x17ACAF60 +0x17ACAF68 +0x17ACAF70 +0x17ACAF78 +0x17ACAF80 +0x17ACAF88 +0x011D026A +0x011D026A +0x18AC3198 +0x18AC31A0 +0x18AC31A8 +0x18AC31B0 +0x18AC31B8 +0x18AC31C0 +0x15DEABC0 +0x15DEABC8 +0x03D247A4 +0x03D247A4 +0x019FC358 +0x019FC360 +0x019FC368 +0x019FC370 +0x019FC378 +0x1066A0E0 +0x1066A0E0 +0x167AED00 +0x167AED00 +0x0817D078 +0x0817D078 +0x10E2A200 +0x10E2A208 +0x10E2A210 +0x10E2A218 +0x10E2A220 +0x10E2A228 +0x1F52BEA8 +0x1F52BEA8 +0x0B6DD740 +0x09325260 +0x09325268 +0x09325270 +0x09325278 +0x09325280 +0x09325288 +0x09325290 +0x09325298 +0x1869B108 +0x1869B110 +0x1869B118 +0x1869B120 +0x1869B128 +0x0C3618B0 +0x0C3618B8 +0x0C3618C0 +0x0C3618C8 +0x0C3618D0 +0x0D6A5B00 +0x0D6A5B08 +0x0D6A5B10 +0x0D6A5B18 +0x0D6A5B20 +0x0D6A5B28 +0x06164C30 +0x06164C38 +0x06164C40 +0x0BA95758 +0x0BA95760 +0x0BA95768 +0x0BA95770 +0x0BA95778 +0x0BA95780 +0x1D91BB68 +0x1D91BB68 +0x16636CD8 +0x16636CE0 +0x16636CE8 +0x16636CF0 +0x16636CF8 +0x16636D00 +0x16636D08 +0x16636D10 +0x06A60D90 +0x06A60D98 +0x06A60DA0 +0x06A60DA8 +0x06A60DB0 +0x05A4CB48 +0x05A4CB50 +0x084B10A0 +0x084B10A8 +0x084B10B0 +0x084B10B8 +0x084B10C0 +0x084B10C8 +0x084B10D0 +0x0F9F5F68 +0x0F9F5F70 +0x0F9F5F78 +0x0F9F5F80 +0x0F9F5F88 +0x156C6B38 +0x156C6B40 +0x1195E320 +0x1195E328 +0x1195E330 +0x1195E338 +0x1195E340 +0x1195E348 +0x1B31F678 +0x1B31F680 +0x1B31F688 +0x1B31F690 +0x1B31F698 +0x1B31F6A0 +0x1B31F6A8 +0x06A2CD90 +0x06A2CD98 +0x06A2CDA0 +0x06A2CDA8 +0x191AF240 +0x191AF248 +0x191AF250 +0x111B2290 +0x111B2290 +0x173DAEB8 +0x173DAEC0 +0x173DAEC8 +0x173DAED0 +0x173DAED8 +0x173DAEE0 +0x173DAEE8 +0x09A8D360 +0x09A8D368 +0x09A8D370 +0x09A8D378 +0x09A8D380 +0x023F44B8 +0x023F44C0 +0x023F44C8 +0x023F44D0 +0x023F44D8 +0x023F44E0 +0x023DC4E4 +0x1F46BE80 +0x1F46BE88 +0x1F46BE90 +0x1F46BE98 +0x1F46BEA0 +0x1FA17F40 +0x1FA17F40 +0x1FABFF80 +0x1FABFF88 +0x1FABFF90 +0x1FABFF98 +0x1FABFFA0 +0x1FABFFA8 +0x1FABFFB0 +0x0A32D468 +0x0A32D468 +0x1A3AB488 +0x1A3AB490 +0x1A3AB498 +0x1A3AB4A0 +0x1A3AB4A8 +0x1A3AB4B0 +0x1A3AB4B8 +0x1A3AB4C0 +0x1A3AB4C8 +0x1B31F6A0 +0x1B31F6A8 +0x1666ECC0 +0x1666ECC8 +0x1666ECD0 +0x0B4816E0 +0x0B4816E8 +0x13926720 +0x13926728 +0x13926730 +0x13926738 +0x13926740 +0x13926748 +0x108C6158 +0x108C6160 +0x108C6168 +0x108C6170 +0x1E333C60 +0x1E333C68 +0x0CF85A00 +0x0CF85A00 +0x11792328 +0x11792328 +0x11ACE3A0 +0x11ACE3A8 +0x050E0A20 +0x050E0A28 +0x050E0A30 +0x050E0A38 +0x050E0A40 +0x050E0A48 +0x050E0A50 +0x09485290 +0x09485298 +0x094852A0 +0x094852A8 +0x094852B0 +0x07B34FA0 +0x07B34FA8 +0x07B34FB0 +0x07B34FB8 +0x07B34FC0 +0x07B34FC8 +0x1E2C7C60 +0x1E2C7C68 +0x0E8C9D40 +0x0E8C9D48 +0x0E8C9D50 +0x0E8C9D58 +0x0E8C9D60 +0x0E8C9D68 +0x0E8C9D70 +0x08E491D8 +0x08E491E0 +0x08E491E8 +0x08E491F0 +0x08E491F8 +0x187BB108 +0x187BB110 +0x187BB118 +0x187BB120 +0x187BB128 +0x187BB130 +0x13A4A788 +0x13A4A788 +0x08B31160 +0x08B31168 +0x08B31170 +0x08B31178 +0x08B31180 +0x08B31188 +0x05BF4B88 +0x05BF4B90 +0x05BF4B98 +0x05BF4BA0 +0x05BF4BA8 +0x05BF4BB0 +0x085A50F0 +0x085A50F0 +0x08E8D1E0 +0x08E8D1E8 +0x08E8D1F0 +0x08E8D1F8 +0x08E8D200 +0x08E8D208 +0x08E8D210 +0x08E8D218 +0x08E8D220 +0x10D5A1B0 +0x10D5A1B0 +0x06848D48 +0x06848D48 +0x1516EA60 +0x1516EA60 +0x103520A0 +0x103520A8 +0x103520B0 +0x103520B8 +0x1FBE7F80 +0x0188833A +0x01888342 +0x0188834A +0x01888352 +0x0188835A +0x01888362 +0x0188836A +0x025244CC +0x025244CC +0x11706330 +0x11706338 +0x11706340 +0x11706348 +0x16F4EDE0 +0x16F4EDE8 +0x16F4EDF0 +0x04E289F0 +0x04E289F8 +0x04E28A00 +0x04E28A08 +0x04E28A10 +0x1CD8F9C0 +0x1F8ABF80 +0x1F8ABF80 +0x1A41F480 +0x1A41F488 +0x1A41F490 +0x1A41F498 +0x1A41F4A0 +0x1A41F4A8 +0x1A41F4B0 +0x1582EB38 +0x1582EB38 +0x09F91430 +0x09F91438 +0x09F91440 +0x09F91448 +0x1C6AB8E0 +0x1C6AB8E8 +0x1C6AB8F0 +0x1C6AB8F8 +0x0E165C60 +0x0E165C60 +0x10752120 +0x10752120 +0x0DC35B98 +0x0DC35BA0 +0x0DC35BA8 +0x0DC35BB0 +0x0DC35BB8 +0x0DC35BC0 +0x0DC35BC8 +0x0DC35BD0 +0x059F8B40 +0x1FFF0058 +0x1FFF0058 +0x05DCCBE8 +0x05DCCBF0 +0x05DCCBF8 +0x05DCCC00 +0x05DCCC08 +0x05DCCC10 +0x1BC3B780 +0x1BC3B788 +0x1BC3B790 +0x1BC3B798 +0x1BC3B7A0 +0x1BC3B7A8 +0x126CE520 +0x126CE528 +0x126CE530 +0x036906D4 +0x036906DC +0x0FCD1FA0 +0x0FCD1FA8 +0x0FCD1FB0 +0x0FCD1FB8 +0x0FCD1FC0 +0x0FCD1FC8 +0x0FCD1FD0 +0x0FCD1FD8 +0x08FA9230 +0x08FA9230 +0x1C367898 +0x1C3678A0 +0x1C3678A8 +0x1C3678B0 +0x18BFF180 +0x18BFF188 +0x18BFF190 +0x18BFF198 +0x1D027A40 +0x1D027A48 +0x1D027A50 +0x07728EE8 +0x07728EF0 +0x07728EF8 +0x07728F00 +0x07728F08 +0x07728F10 +0x06C00D88 +0x06C00D90 +0x06C00D98 +0x06C00DA0 +0x06C00DA8 +0x06C00DB0 +0x06C00DB8 +0x06C00DC0 +0x06C00DC8 +0x08FD5230 +0x08FD5238 +0x08FD5240 +0x08FD5248 +0x08FD5250 +0x1C4838A0 +0x1C4838A8 +0x1C4838B0 +0x1C4838B8 +0x19113280 +0x0B3A5670 +0x0B3A5678 +0x0B3A5680 +0x0B3A5688 +0x0B3A5690 +0x1A91F568 +0x1A91F568 +0x12EA65F8 +0x12EA6600 +0x12EA6608 +0x12EA6610 +0x12EA6618 +0x12EA6620 +0x12EA6628 +0x1E3AFC80 +0x1BE4F7F8 +0x1BE4F800 +0x1BE4F808 +0x1BE4F810 +0x1BE4F818 +0x1BE4F820 +0x1BE4F828 +0x0C361870 +0x0C361878 +0x1F56FEC0 +0x1F56FEC8 +0x1F56FED0 +0x1F56FED8 +0x1F56FEE0 +0x186330D8 +0x186330E0 +0x186330E8 +0x186330F0 +0x186330F8 +0x18633100 +0x10FE2260 +0x10FE2260 +0x05404AA8 +0x05404AB0 +0x05404AB8 +0x05404AC0 +0x05404AC8 +0x05404AD0 +0x0A4AD490 +0x0A4AD498 +0x0A4AD4A0 +0x0A4AD4A8 +0x0A4AD4B0 +0x0A4AD4B8 +0x0A4AD4C0 +0x0A4AD4C8 +0x0A4AD4D0 +0x1C74B8E0 +0x1C74B8E8 +0x1C74B8F0 +0x1C74B8F8 +0x1C74B900 +0x1C74B908 +0x1C74B910 +0x1C74B918 +0x1C74B920 +0x07BF8FC8 +0x07BF8FC8 +0x16A56D68 +0x16A56D68 +0x0AB39598 +0x0AB395A0 +0x0AB395A8 +0x0AB395B0 +0x0AB395B8 +0x0AB395C0 +0x02C34588 +0x02C34590 +0x02C34598 +0x00880140 +0x00880140 +0x013E82C6 +0x013E82CE +0x013E82D6 +0x013E82DE +0x013E82E6 +0x1CF17A00 +0x1CF17A00 +0x16C4AD80 +0x16C4AD80 +0x1D49BAD8 +0x1D49BAE0 +0x1D49BAE8 +0x1D49BAF0 +0x1D49BAF8 +0x1D49BB00 +0x05B7CB70 +0x0A4AD4A0 +0x0A4AD4A8 +0x0A4AD4B0 +0x0A4AD4B8 +0x0A4AD4C0 +0x06E80DD0 +0x06E80DD0 +0x1380A718 +0x1380A718 +0x1590AB38 +0x1590AB40 +0x1590AB48 +0x1590AB50 +0x1590AB58 +0x1590AB60 +0x1590AB68 +0x00C401A0 +0x00C401A0 +0x01ADC384 +0x01ADC38C +0x01ADC394 +0x01ADC39C +0x01ADC3A4 +0x01ADC3AC +0x01ADC3B4 +0x0EEB5DD0 +0x0EEB5DD0 +0x1E3E7CC0 +0x1E3E7CC8 +0x1E3E7CD0 +0x15842B00 +0x15842B08 +0x1F18BE70 +0x1F18BE70 +0x04A38988 +0x04A38990 +0x04A38998 +0x04A389A0 +0x04A389A8 +0x10ACE160 +0x10ACE168 +0x10ACE170 +0x02368484 +0x0236848C +0x02368494 +0x0236849C +0x023684A4 +0x1A377470 +0x1A377470 +0x18CAB1D8 +0x18CAB1D8 +0x186B7140 +0x186B7140 +0x05B7CB90 +0x05B7CB90 +0x08CA51B0 +0x08CA51B8 +0x08CA51C0 +0x08CA51C8 +0x08CA51D0 +0x08CA51D8 +0x08CA51E0 +0x1D73BB20 +0x1D73BB28 +0x1D73BB30 +0x1D73BB38 +0x11FBE400 +0x11FBE408 +0x11FBE410 +0x11FBE418 +0x1F4F7EA0 +0x1F4F7EA8 +0x1F4F7EB0 +0x1F4F7EB8 +0x1F4F7EC0 +0x0A1B1460 +0x0A1B1468 +0x0A1B1470 +0x0A1B1478 +0x0A1B1480 +0x0B7616F0 +0x06E54E08 +0x06E54E08 +0x09FD1440 +0x09FD1440 +0x16C9EDC8 +0x16C9EDC8 +0x02C9459C +0x02C945A4 +0x02C945AC +0x02C945B4 +0x02C945BC +0x02C945C4 +0x02C945CC +0x196FF318 +0x196FF318 +0x07A8CF98 +0x07A8CFA0 +0x10936120 +0x10936128 +0x10936130 +0x1B09B658 +0x1B09B658 +0x1D5DFAF0 +0x1D5DFAF0 +0x0E971D78 +0x0E971D80 +0x0E971D88 +0x071ECE40 +0x071ECE48 +0x071ECE50 +0x071ECE58 +0x071ECE60 +0x071ECE68 +0x093A92C8 +0x093A92C8 +0x069D4D48 +0x069D4D48 +0x11796320 +0x11796328 +0x11796330 +0x11796338 +0x11796340 +0x01ED8404 +0x01ED8404 +0x12C6E590 +0x12C6E598 +0x12C6E5A0 +0x12C6E5A8 +0x12C6E5B0 +0x12C6E5B8 +0x12C6E5C0 +0x12C6E5C8 +0x12C6E5D0 +0x1798EF70 +0x1798EF78 +0x1798EF80 +0x1798EF88 +0x1798EF90 +0x1041E0A0 +0x1041E0A8 +0x1041E0B0 +0x1041E0B8 +0x1041E0C0 +0x1041E0C8 +0x0D4E5AA8 +0x0D4E5AB0 +0x0D4E5AB8 +0x0D4E5AC0 +0x0D4E5AC8 +0x0D4E5AD0 +0x15C6AB88 +0x15C6AB88 +0x0B4816D0 +0x0B4816D8 +0x0B4816E0 +0x0B4816E8 +0x13926720 +0x13926728 +0x13926730 +0x13926738 +0x13926740 +0x08111020 +0x08111020 +0x0C56D8F0 +0x0C56D8F8 +0x0C56D900 +0x06918D20 +0x06918D28 +0x06918D30 +0x08071038 +0x08071040 +0x08071048 +0x08071050 +0x08071058 +0x14992948 +0x14992950 +0x14992958 +0x14992960 +0x14992968 +0x14992970 +0x03154684 +0x1640EC80 +0x1640EC88 +0x1640EC90 +0x1640EC98 +0x001CC049 +0x001CC051 +0x001CC059 +0x001CC061 +0x001CC069 +0x08D311D0 +0x08D311D8 +0x08D311E0 +0x08D311E8 +0x08D311F0 +0x08D311F8 +0x1BC6B780 +0x1BC6B788 +0x04F40A08 +0x04F40A10 +0x04F40A18 +0x04F40A20 +0x04F40A28 +0x04F40A30 +0x04F40A38 +0x0FCC9FF0 +0x0FCC9FF0 +0x1D29FAB0 +0x1D29FAB8 +0x06B84D70 +0x06B84D78 +0x06B84D80 +0x06B84D88 +0x1F0DFE40 +0x1F0DFE40 +0x058C4B28 +0x058C4B28 +0x02854524 +0x02854524 +0x0AF2D628 +0x1B7C7700 +0x1B7C7708 +0x1B7C7710 +0x1B7C7718 +0x1B7C7720 +0x1F3D7EA0 +0x1F3D7EA8 +0x1F3D7EB0 +0x1F3D7EB8 +0x1F3D7EC0 +0x1F3D7EC8 +0x1F3D7ED0 +0x0DEF1C00 +0x0DEF1C08 +0x0DEF1C10 +0x0DEF1C18 +0x0DEF1C20 \ No newline at end of file diff --git a/The attainments and realizations of my dreams/2019_std_death_rate.py b/The attainments and realizations of my dreams/2019_std_death_rate.py new file mode 100644 index 00000000..a4a605ac --- /dev/null +++ b/The attainments and realizations of my dreams/2019_std_death_rate.py @@ -0,0 +1,28 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] +death_rate = [289.6, 358.6, 361.5, 378.8, 387.4, 393.7, 402.4, 402.5, 406.4, 408.1, + 412.4, 413.1, 427.6, 437.3, 438.5, 439.3, 455.7, 493.5, 506.8, 545.2] + +label = ["Taipei", "Hsinchu City", "New Taipei", "Taoyuan", "Taichung", "Hsinchu", + "Penghu", "Changhua", "Chiayi City", "Yilan", "Keelung", "Tainan", "Kaohsiung", + "Chiayi", "Miaoli", "Nantou", "Yunlin", "Hualien", "Pingtung", "Taitung"] + +fig, ax = plt.subplots(figsize=(10, 8)) # [1] +plt.xticks(region_num, labels=label, rotation=47) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, death_rate) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002*height, + '%d'%int(height), ha='center', va='bottom') + +plt.title("2019 Standardized Death Rate By Region In Taiwan") +plt.ylabel("Death per 10 thousands people") +plt.xlabel("Reference: https://www.moi.gov.tw/cl.aspx?n=14661") +plt.show() + +# Reference: +# 1. https://stackoverflow.com/questions/332289/how-do-you-change-the-size-of-figures-drawn-with-matplotlib \ No newline at end of file diff --git a/The attainments and realizations of my dreams/2019_std_death_rate2.py b/The attainments and realizations of my dreams/2019_std_death_rate2.py new file mode 100644 index 00000000..ce3fa03c --- /dev/null +++ b/The attainments and realizations of my dreams/2019_std_death_rate2.py @@ -0,0 +1,32 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] +death_rate = [289.6, 358.6, 361.5, 378.8, 387.4, 393.7, 402.4, 402.5, 406.4, 408.1, + 412.4, 413.1, 427.6, 437.3, 438.5, 439.3, 455.7, 493.5, 506.8, 545.2] + +label = ["Taipei", "Hsinchu City", "New Taipei", "Taoyuan", "Taichung", "Hsinchu", + "Penghu", "Changhua", "Chiayi City", "Yilan", "Keelung", "Tainan", "Kaohsiung", + "Chiayi", "Miaoli", "Nantou", "Yunlin", "Hualien", "Pingtung", "Taitung"] + +fig, ax = plt.subplots(figsize=(10, 8)) # [1] +plt.xticks(region_num, labels=label, rotation=47) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, death_rate) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002*height, + '%d'%int(height), ha='center', va='bottom') + +plt.title("2019 Standardized Death Rate By Region In Taiwan") + +plt.ylabel("Death per 10 thousands people") +plt.xlabel("Reference: https://www.moi.gov.tw/cl.aspx?n=14661") + +plt.ylim(250, 550) + +plt.show() + +# Reference: +# 1. https://stackoverflow.com/questions/332289/how-do-you-change-the-size-of-figures-drawn-with-matplotlib \ No newline at end of file diff --git a/The attainments and realizations of my dreams/2019_std_death_rate3.py b/The attainments and realizations of my dreams/2019_std_death_rate3.py new file mode 100644 index 00000000..4440a7a4 --- /dev/null +++ b/The attainments and realizations of my dreams/2019_std_death_rate3.py @@ -0,0 +1,32 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] +death_rate = [289.6, 358.6, 361.5, 378.8, 387.4, 393.7, 402.4, 402.5, 406.4, 408.1, + 412.4, 413.1, 427.6, 437.3, 438.5, 439.3, 455.7, 493.5, 506.8, 545.2] + +label = ["Taipei", "Hsinchu City", "New Taipei", "Taoyuan", "Taichung", "Hsinchu", + "Penghu", "Changhua", "Chiayi City", "Yilan", "Keelung", "Tainan", "Kaohsiung", + "Chiayi", "Miaoli", "Nantou", "Yunlin", "Hualien", "Pingtung", "Taitung"] + +fig, ax = plt.subplots(figsize=(10, 8)) # [1] +plt.xticks(region_num, labels=label, rotation=47) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, death_rate) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002*height, + '%d'%int(height), ha='center', va='bottom') + +plt.title("2019 Standardized Death Rate By Region In Taiwan") + +plt.ylabel("Death per 10 thousands people") +plt.xlabel("Reference: https://www.moi.gov.tw/cl.aspx?n=14661") + +plt.ylim(280, 560) + +plt.show() + +# Reference: +# 1. https://stackoverflow.com/questions/332289/how-do-you-change-the-size-of-figures-drawn-with-matplotlib \ No newline at end of file diff --git a/The attainments and realizations of my dreams/2019_std_death_rate4.py b/The attainments and realizations of my dreams/2019_std_death_rate4.py new file mode 100644 index 00000000..6a215501 --- /dev/null +++ b/The attainments and realizations of my dreams/2019_std_death_rate4.py @@ -0,0 +1,32 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] +death_rate = [289.6, 358.6, 361.5, 378.8, 387.4, 393.7, 402.4, 402.5, 406.4, 408.1, + 412.4, 413.1, 427.6, 437.3, 438.5, 439.3, 455.7, 493.5, 506.8, 545.2] + +label = ["Taipei", "Hsinchu City", "New Taipei", "Taoyuan", "Taichung", "Hsinchu", + "Penghu", "Changhua", "Chiayi City", "Yilan", "Keelung", "Tainan", "Kaohsiung", + "Chiayi", "Miaoli", "Nantou", "Yunlin", "Hualien", "Pingtung", "Taitung"] + +fig, ax = plt.subplots(figsize=(10, 8)) # [1] +plt.xticks(region_num, labels=label, rotation=47) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, death_rate) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2019 Standardized Death Rate By Region In Taiwan") + +plt.ylabel("Death per 10 thousands people") +plt.xlabel("Reference: https://www.moi.gov.tw/cl.aspx?n=14661") + +plt.ylim(280, 560) + +plt.show() + +# Reference: +# 1. https://stackoverflow.com/questions/332289/how-do-you-change-the-size-of-figures-drawn-with-matplotlib diff --git a/The attainments and realizations of my dreams/2019_std_death_rate5.py b/The attainments and realizations of my dreams/2019_std_death_rate5.py new file mode 100644 index 00000000..a4bab9eb --- /dev/null +++ b/The attainments and realizations of my dreams/2019_std_death_rate5.py @@ -0,0 +1,37 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] +death_rate = [289.6, 358.6, 361.5, 378.8, 387.4, 393.7, 402.4, 402.5, 406.4, 408.1, + 412.4, 413.1, 427.6, 437.3, 438.5, 439.3, 455.7, 493.5, 506.8, 545.2] + +label = ["Taipei", "Hsinchu City", "New Taipei", "Taoyuan", "Taichung", "Hsinchu", + "Penghu", "Changhua", "Chiayi City", "Yilan", "Keelung", "Tainan", "Kaohsiung", + "Chiayi", "Miaoli", "Nantou", "Yunlin", "Hualien", "Pingtung", "Taitung"] + +fig, ax = plt.subplots(figsize=(10, 8)) # [1] +plt.xticks(region_num, labels=label, rotation=47) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, death_rate) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2019 Standardized Death Rate By Region In Taiwan") + +plt.ylabel("Death per 10 thousands people") +plt.xlabel("Reference: https://www.moi.gov.tw/cl.aspx?n=14661") + +plt.ylim(280, 560) + +plt.annotate(text="The Tsai regime announced the foundation of a new medical college in N.TW", + xy=(6, 400), xytext=(6, 520), textcoords='figure fraction', + arrowprops=dict(facecolor='red', shrink=0.05), + horizontalalignment='right', verticalalignment='bottom') + +plt.show() + +# Reference: +# 1. https://stackoverflow.com/questions/332289/how-do-you-change-the-size-of-figures-drawn-with-matplotlib diff --git a/The attainments and realizations of my dreams/2019_std_death_rate6.py b/The attainments and realizations of my dreams/2019_std_death_rate6.py new file mode 100644 index 00000000..924bcac2 --- /dev/null +++ b/The attainments and realizations of my dreams/2019_std_death_rate6.py @@ -0,0 +1,37 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] +death_rate = [289.6, 358.6, 361.5, 378.8, 387.4, 393.7, 402.4, 402.5, 406.4, 408.1, + 412.4, 413.1, 427.6, 437.3, 438.5, 439.3, 455.7, 493.5, 506.8, 545.2] + +label = ["Taipei", "Hsinchu City", "New Taipei", "Taoyuan", "Taichung", "Hsinchu", + "Penghu", "Changhua", "Chiayi City", "Yilan", "Keelung", "Tainan", "Kaohsiung", + "Chiayi", "Miaoli", "Nantou", "Yunlin", "Hualien", "Pingtung", "Taitung"] + +fig, ax = plt.subplots(figsize=(10, 8)) # [1] +plt.xticks(region_num, labels=label, rotation=47) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, death_rate) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2019 Standardized Death Rate By Region In Taiwan") + +plt.ylabel("Death per 10 thousands people") +plt.xlabel("Reference: https://www.moi.gov.tw/cl.aspx?n=14661") + +plt.ylim(280, 560) + +plt.annotate(text="The Tsai regime announced the foundation of a new medical college in N.TW", + xy=(6, 400), xytext=(6, 520), xycoords='data', textcoords='data', + arrowprops=dict(facecolor='red', shrink=0.05), + horizontalalignment='center', verticalalignment='bottom') + +plt.show() + +# Reference: +# 1. https://stackoverflow.com/questions/332289/how-do-you-change-the-size-of-figures-drawn-with-matplotlib diff --git a/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county.csv b/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county.csv new file mode 100644 index 00000000..5db884ce --- /dev/null +++ b/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county.csv @@ -0,0 +1,23 @@ +,COUNTY,NIGHT_WORK,DAY_WORK(7:00~13:00),DAY_WORK(13:00~19:00),DAY_WORK,NIGHT_WEEKEND,DAY_WEEKEND(7:00~13:00),DAY_WEEKEND(13:00~19:00),DAY_WEEKEND,MORNING_WORK,MIDDAY_WORK,AFTERNOON_WORK,EVENING_WORK,MORNING_WEEKEND,MIDDAY_WEEKEND,AFTERNOON_WEEKEND,EVENING_WEEKEND,INFO_TIME +0,啣撣,4404882,3828955,3708033,3760027,4389998,4233496,4087167,4193773,10284511.41,8918287.6,9006483.28,9804692.81,8766501.62,10318260.43,10212998.84,9418215.79,109Y11M +1,箏撣,2789958,3424948,3563844,3508241,2747668,2886879,3067448,2953925,7109127.81,8432508.36,8432755.71,8118225.21,5280778.32,7698035.05,7920404.09,6840720.14,109Y11M +2,獢撣,2526697,2538817,2534858,2536854,2459045,2457750,2469675,2466701,5378615.6,5081505.82,5189705.13,5168944.95,4494943.06,5532910.8,5620730.37,5024045.69,109Y11M +3,箔葉撣,3083970,3097381,3092610,3097786,3052863,3034869,3022051,3033950,6764050.31,6647991.06,6781947.04,6870578.9,5799132.24,7181235.71,7356663.43,6679511.57,109Y11M +4,箏撣,1835928,1849314,1846605,1846887,1839022,1843679,1832836,1837561,3963064.59,3910969.02,4008063.88,3956241.29,3464568.0,4344466.5,4449459.65,3981201.53,109Y11M +5,擃撣,2576693,2574896,2572996,2573879,2575650,2561834,2564244,2563361,5751041.86,5679883.06,5873371.46,5775527.53,4878469.83,5954713.26,6098213.63,5570972.78,109Y11M +6,摰剔腦,441203,429801,431568,429706,468078,470963,469260,465119,820612.54,884594.62,918124.02,792285.82,846875.65,1117919.27,1134634.42,893794.67,109Y11M +7,啁姘蝮,656007,672505,667973,669470,658522,667690,659887,664304,1212645.85,1173657.34,1191427.45,1107531.23,1124406.72,1335534.07,1371502.21,1181676.04,109Y11M +8,蝮,505463,487130,485434,485570,519930,528448,520549,522946,934112.83,912872.42,951256.49,872506.02,968899.18,1194737.98,1264425.33,1056933.96,109Y11M +9,敶啣蝮,1068303,1049600,1050004,1049606,1091186,1096873,1092149,1097891,2203943.54,2110569.6,2166761.19,2110485.15,2018196.98,2448868.57,2522773.25,2181056.12,109Y11M +10,蝮,426734,432678,430430,430064,454395,477733,476173,471206,776405.17,840887.51,855041.58,717360.5,828731.05,1145664.25,1173022.88,877683.77,109Y11M +11,脫蝮,565293,570400,570334,570360,570283,573148,570827,572544,1105479.99,1106259.66,1150228.23,1042132.5,1037810.92,1271014.2,1322802.2,1101577.55,109Y11M +12,蝢拍腦,440515,435301,434018,434444,455221,464554,463403,461220,734515.31,753583.43,777476.7,655719.38,742929.19,950857.48,988927.35,747599.91,109Y11M +13,撅梁腦,689391,666686,669243,667004,710484,715567,716100,713366,1361450.11,1388371.68,1444718.81,1337537.22,1280532.7,1648915.92,1699894.79,1433396.47,109Y11M +14,箸梁腦,192086,190194,190066,190005,197914,197291,195779,195333,289533.92,332855.19,337462.37,273759.51,300570.48,392490.39,393746.24,300458.73,109Y11M +15,梯桃腦,320650,318241,318562,317411,332256,331573,331336,328566,536693.87,600290.03,611537.14,516241.56,539027.08,690625.25,692356.39,553652.8,109Y11M +16,瞉皝蝮,70549,68245,69080,69149,70009,68804,69423,69043,110302.5,118788.19,120856.52,104167.11,102772.41,121002.38,119482.67,99997.27,109Y11M +17,粹撣,355821,297902,291392,293735,360605,348503,340866,346262,637563.49,568571.44,578417.38,586174.69,570316.67,696587.93,703124.49,607129.88,109Y11M +18,啁姘撣,549601,570467,575181,572417,540378,543734,557890,548152,997287.73,1013791.85,1017258.54,985947.27,834137.4,1068331.03,1096901.32,955917.76,109Y11M +19,蝢拙,257530,256316,257297,257060,262138,255554,251435,253886,477599.29,513240.31,527902.47,513166.9,442648.94,568829.58,578460.05,534880.48,109Y11M +20,蝮,98129,96394,96541,96478,99452,97261,97359,96983,120510.5,125821.51,126566.79,102614.41,120275.83,131809.99,132018.33,104540.19,109Y11M +21,瘙蝮,12511,11742,11846,11762,12821,11708,12057,11823,12750.77,13152.3,13112.66,10067.09,12984.01,13470.99,13558.62,10389.78,109Y11M diff --git a/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county.py b/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county.py new file mode 100644 index 00000000..f06698b9 --- /dev/null +++ b/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county.py @@ -0,0 +1,10 @@ +import pandas as pd + +# Skip one or more rows by giving the row indices (the first row that's not skipped is the header):[1] +df = pd.read_csv("2020_November_daily_mobile_user_distribution_by_county.csv" + , header=0, skiprows=[1], encoding="big5") + +print(df) + +# References: +# 1. https://stackoverflow.com/a/27325729/14900011 diff --git a/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county2.py b/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county2.py new file mode 100644 index 00000000..b166fb9d --- /dev/null +++ b/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county2.py @@ -0,0 +1,13 @@ +import pandas as pd + +# Skip one or more rows by giving the row indices (the first row that's not skipped is the header):[1] +df = pd.read_csv("2020_November_daily_mobile_user_distribution_by_county.csv" + , header=0, skiprows=[1], encoding="big5") + +print(df) + +new = df.drop(labels=["COUNTY_ID"], axis=1) +print(new) + +# References: +# 1. https://stackoverflow.com/a/27325729/14900011 diff --git a/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county4.py b/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county4.py new file mode 100644 index 00000000..34f46c56 --- /dev/null +++ b/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county4.py @@ -0,0 +1,16 @@ +import pandas as pd + +# Skip one or more rows by giving the row indices (the first row that's not skipped is the header):[1] +df = pd.read_csv("2020_November_daily_mobile_user_distribution_by_county.csv" + , header=0, skiprows=[1], encoding="big5") + +print(df) + +new = df.drop(labels=["COUNTY_ID"], axis=1) +print(new) + +branding = new.reset_index().set_index('COUNTY') +print(branding) + +# References: +# 1. https://stackoverflow.com/a/27325729/14900011 diff --git a/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county5.py b/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county5.py new file mode 100644 index 00000000..33a5cd7b --- /dev/null +++ b/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county5.py @@ -0,0 +1,14 @@ +import pandas as pd + +# Column(s) to use as the row labels of the DataFrame, either given as string name or column index. +# If a sequence of int / str is given, a MultiIndex is used.[1] +df = pd.read_csv("2020_November_daily_mobile_user_distribution_by_county.csv" + , header=0, skiprows=[1], encoding="big5", index_col=["COUNTY"]) + +print(df) + +new = df.drop(labels=["COUNTY_ID"], axis=1) +print(new) + +# References: +# 1. https://pandas.pydata.org/pandas-docs/dev/reference/api/pandas.read_csv.html diff --git a/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county6.py b/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county6.py new file mode 100644 index 00000000..29d84ee0 --- /dev/null +++ b/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county6.py @@ -0,0 +1,16 @@ +import pandas as pd + +# Column(s) to use as the row labels of the DataFrame, either given as string name or column index. +# If a sequence of int / str is given, a MultiIndex is used.[1] +df = pd.read_csv("2020_November_daily_mobile_user_distribution_by_county.csv" + , header=0, skiprows=[1], encoding="big5", index_col=["COUNTY"]) + +print(df) + +new = df.drop(labels=["COUNTY_ID"], axis=1) +print(new) + +new.to_csv('2020_Nov_daily_mobile_user_distribution_by_county_.csv') + +# References: +# 1. https://pandas.pydata.org/pandas-docs/dev/reference/api/pandas.read_csv.html diff --git a/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county_.csv b/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county_.csv new file mode 100644 index 00000000..71ec4a7c --- /dev/null +++ b/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county_.csv @@ -0,0 +1,23 @@ +COUNTY,NIGHT_WORK,DAY_WORK(7:00~13:00),DAY_WORK(13:00~19:00),DAY_WORK,NIGHT_WEEKEND,DAY_WEEKEND(7:00~13:00),DAY_WEEKEND(13:00~19:00),DAY_WEEKEND,MORNING_WORK,MIDDAY_WORK,AFTERNOON_WORK,EVENING_WORK,MORNING_WEEKEND,MIDDAY_WEEKEND,AFTERNOON_WEEKEND,EVENING_WEEKEND,INFO_TIME +啣撣,4404882,3828955,3708033,3760027,4389998,4233496,4087167,4193773,10284511.41,8918287.6,9006483.28,9804692.81,8766501.62,10318260.43,10212998.84,9418215.79,109Y11M +箏撣,2789958,3424948,3563844,3508241,2747668,2886879,3067448,2953925,7109127.81,8432508.36,8432755.71,8118225.21,5280778.32,7698035.05,7920404.09,6840720.14,109Y11M +獢撣,2526697,2538817,2534858,2536854,2459045,2457750,2469675,2466701,5378615.6,5081505.82,5189705.13,5168944.95,4494943.06,5532910.8,5620730.37,5024045.69,109Y11M +箔葉撣,3083970,3097381,3092610,3097786,3052863,3034869,3022051,3033950,6764050.31,6647991.06,6781947.04,6870578.9,5799132.24,7181235.71,7356663.43,6679511.57,109Y11M +箏撣,1835928,1849314,1846605,1846887,1839022,1843679,1832836,1837561,3963064.59,3910969.02,4008063.88,3956241.29,3464568.0,4344466.5,4449459.65,3981201.53,109Y11M +擃撣,2576693,2574896,2572996,2573879,2575650,2561834,2564244,2563361,5751041.86,5679883.06,5873371.46,5775527.53,4878469.83,5954713.26,6098213.63,5570972.78,109Y11M +摰剔腦,441203,429801,431568,429706,468078,470963,469260,465119,820612.54,884594.62,918124.02,792285.82,846875.65,1117919.27,1134634.42,893794.67,109Y11M +啁姘蝮,656007,672505,667973,669470,658522,667690,659887,664304,1212645.85,1173657.34,1191427.45,1107531.23,1124406.72,1335534.07,1371502.21,1181676.04,109Y11M +蝮,505463,487130,485434,485570,519930,528448,520549,522946,934112.83,912872.42,951256.49,872506.02,968899.18,1194737.98,1264425.33,1056933.96,109Y11M +敶啣蝮,1068303,1049600,1050004,1049606,1091186,1096873,1092149,1097891,2203943.54,2110569.6,2166761.19,2110485.15,2018196.98,2448868.57,2522773.25,2181056.12,109Y11M +蝮,426734,432678,430430,430064,454395,477733,476173,471206,776405.17,840887.51,855041.58,717360.5,828731.05,1145664.25,1173022.88,877683.77,109Y11M +脫蝮,565293,570400,570334,570360,570283,573148,570827,572544,1105479.99,1106259.66,1150228.23,1042132.5,1037810.92,1271014.2,1322802.2,1101577.55,109Y11M +蝢拍腦,440515,435301,434018,434444,455221,464554,463403,461220,734515.31,753583.43,777476.7,655719.38,742929.19,950857.48,988927.35,747599.91,109Y11M +撅梁腦,689391,666686,669243,667004,710484,715567,716100,713366,1361450.11,1388371.68,1444718.81,1337537.22,1280532.7,1648915.92,1699894.79,1433396.47,109Y11M +箸梁腦,192086,190194,190066,190005,197914,197291,195779,195333,289533.92,332855.19,337462.37,273759.51,300570.48,392490.39,393746.24,300458.73,109Y11M +梯桃腦,320650,318241,318562,317411,332256,331573,331336,328566,536693.87,600290.03,611537.14,516241.56,539027.08,690625.25,692356.39,553652.8,109Y11M +瞉皝蝮,70549,68245,69080,69149,70009,68804,69423,69043,110302.5,118788.19,120856.52,104167.11,102772.41,121002.38,119482.67,99997.27,109Y11M +粹撣,355821,297902,291392,293735,360605,348503,340866,346262,637563.49,568571.44,578417.38,586174.69,570316.67,696587.93,703124.49,607129.88,109Y11M +啁姘撣,549601,570467,575181,572417,540378,543734,557890,548152,997287.73,1013791.85,1017258.54,985947.27,834137.4,1068331.03,1096901.32,955917.76,109Y11M +蝢拙,257530,256316,257297,257060,262138,255554,251435,253886,477599.29,513240.31,527902.47,513166.9,442648.94,568829.58,578460.05,534880.48,109Y11M +蝮,98129,96394,96541,96478,99452,97261,97359,96983,120510.5,125821.51,126566.79,102614.41,120275.83,131809.99,132018.33,104540.19,109Y11M +瘙蝮,12511,11742,11846,11762,12821,11708,12057,11823,12750.77,13152.3,13112.66,10067.09,12984.01,13470.99,13558.62,10389.78,109Y11M diff --git a/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county_3.py b/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county_3.py new file mode 100644 index 00000000..4e6e611f --- /dev/null +++ b/The attainments and realizations of my dreams/2020_Nov_daily_mobile_user_distribution_by_county_3.py @@ -0,0 +1,15 @@ +import pandas as pd + +# Skip one or more rows by giving the row indices (the first row that's not skipped is the header):[1] +df = pd.read_csv("2020_November_daily_mobile_user_distribution_by_county.csv" + , header=0, skiprows=[1], encoding="big5") + +print(df) + +new = df.drop(labels=["COUNTY_ID"], axis=1) +print(new) + +new.to_csv('2020_Nov_daily_mobile_user_distribution_by_county.csv') + +# References: +# 1. https://stackoverflow.com/a/27325729/14900011 diff --git a/The attainments and realizations of my dreams/2020_November_daily_mobile_user_by_township.csv b/The attainments and realizations of my dreams/2020_November_daily_mobile_user_by_township.csv new file mode 100644 index 00000000..194d41ac --- /dev/null +++ b/The attainments and realizations of my dreams/2020_November_daily_mobile_user_by_township.csv @@ -0,0 +1,370 @@ +COUNTY_ID,COUNTY,TOWN_ID,TOWN,NIGHT_WORK,DAY_WORK(7:00~13:00),DAY_WORK(13:00~19:00),DAY_WORK,NIGHT_WEEKEND,DAY_WEEKEND(7:00~13:00),DAY_WEEKEND(13:00~19:00),DAY_WEEKEND,MORNING_WORK,MIDDAY_WORK,AFTERNOON_WORK,EVENING_WORK,MORNING_WEEKEND,MIDDAY_WEEKEND,AFTERNOON_WEEKEND,EVENING_WEEKEND,INFO_TIME +縣市代碼,縣市名稱,鄉鎮市區代碼,鄉鎮市區名稱,平日夜間停留人數,平日上午活動人數,平日下午活動人數,平日日間活動人數,假日夜間停留人數,假日上午活動人數,假日下午活動人數,假日日間活動人數,平日早晨旅次,平日中午旅次,平日午後旅次,平日晚上旅次,假日早晨旅次,假日中午旅次,假日午後旅次,假日晚上旅次,資料時間 +65000,新北市,65000010,板橋區,577007,468604,459821,461811,574620,553665,547852,552865,1370756.45,1199378.12,1217279.46,1417770.61,1181447.57,1447237.98,1452579.49,1427165.52,"109Y11M" +65000,新北市,65000020,三重區,426580,353762,336820,343466,424259,402368,379533,395318,1047368.37,873343.72,880980.15,1000009.8,887589.65,1004799.36,975547.52,939548.09,"109Y11M" +65000,新北市,65000030,中和區,470287,414013,398795,408358,466276,439917,417541,433865,1142144.94,995924.74,991048.66,1074345.45,966434.32,1062291.77,1036495.62,972990.59,"109Y11M" +65000,新北市,65000040,永和區,232342,169268,157426,161573,230134,215493,199485,210496,513518.18,415321.92,414020.3,495365.41,461549.08,526167.13,495412.61,485350.57,"109Y11M" +65000,新北市,65000050,新莊區,446481,381702,374563,377239,443620,426704,419179,426607,1093803.05,925342.9,929744.79,1077273.18,925176.4,1086124.76,1056036.59,1001453.5,"109Y11M" +65000,新北市,65000060,新店區,346150,316147,303348,309344,343603,332771,315198,328460,780546.29,694581.09,693588.67,718829.75,650811.86,746315.92,729628.39,657317.14,"109Y11M" +65000,新北市,65000070,樹林區,202270,190785,187977,189656,202721,195384,190928,195311,489739.83,420652.53,426735.44,451024.04,397929.01,447903.69,441277.45,430214.61,"109Y11M" +65000,新北市,65000080,鶯歌區,90900,81480,80218,80939,91143,87876,86757,87625,207558.07,171225.54,179422.75,188227.64,175110.32,203134.32,207767.99,192814.35,"109Y11M" +65000,新北市,65000090,三峽區,120827,105834,104205,104524,121910,123685,120884,122589,258058.78,234151.71,238437.49,244033.42,238756.25,304760.89,301355.44,253190.16,"109Y11M" +65000,新北市,65000100,淡水區,235166,200804,192902,196262,234006,227406,220763,225959,468611.45,453055.6,460827.05,450049.09,409227.35,533757.47,562575.43,471627.85,"109Y11M" +65000,新北市,65000110,汐止區,259462,234013,223014,227807,259805,247347,232960,243506,588586.26,480129.77,475233.5,526224.59,485203.33,534883.69,516922.47,471051.97,"109Y11M" +65000,新北市,65000120,瑞芳區,33298,33380,33374,33374,34345,36259,36704,35860,56586.45,62319.98,64715.77,49256.86,57645.72,90116.07,95374.24,61092.11,"109Y11M" +65000,新北市,65000130,土城區,242008,211738,205000,207403,240563,229233,218697,225948,619026.69,507068.99,514722.42,575021,518413.11,577338.38,561179.73,532459.03,"109Y11M" +65000,新北市,65000140,蘆洲區,210422,150543,142963,145716,210220,193690,182361,190832,461029.82,363415.54,366123.96,445831.58,425043.55,467603.69,446583,436861.52,"109Y11M" +65000,新北市,65000150,五股區,112579,131500,128237,130717,109709,107895,103437,106893,312190.18,269293.75,280567.65,271897.19,221087.58,251046.33,261185.71,232732.31,"109Y11M" +65000,新北市,65000160,泰山區,101023,97232,95286,96175,98966,95327,91470,94406,273883.86,236042.73,246053.9,265467.5,204326.81,239841.43,238979.54,235378.79,"109Y11M" +65000,新北市,65000170,林口區,138129,127658,126810,127409,138265,139516,143771,141132,286107.83,273126.57,276164.83,270630.54,239715.4,308481.96,309984.44,261116.77,"109Y11M" +65000,新北市,65000180,深坑區,30628,29127,27933,28657,30581,28912,28076,28824,60695.94,57122.88,55999.24,52397.97,51217.66,61684.93,63213.94,51022.48,"109Y11M" +65000,新北市,65000190,石碇區,6719,7084,7040,6973,6984,8816,9356,8749,20558.41,26989.57,26370.66,22270.14,32238.45,42521.06,45916,38472.39,"109Y11M" +65000,新北市,65000200,坪林區,3071,3707,3698,3635,3786,5788,6234,5777,13534.88,18995.16,20640.25,17210.58,22234.57,31291.11,33931.2,28502.84,"109Y11M" +65000,新北市,65000210,三芝區,21841,18875,18717,18639,21534,20638,20673,20507,31984.16,32812.82,32779.48,27818.28,31436.41,43331.02,43626.92,31059.73,"109Y11M" +65000,新北市,65000220,石門區,5102,5620,5531,5601,5172,5757,5900,5643,8107.19,10294.14,11030.19,6487.64,8290.13,16703.47,19568.91,9496.23,"109Y11M" +65000,新北市,65000230,八里區,47451,48517,47251,47821,47345,47979,46819,47437,105559.31,99663.65,105821.11,92549.96,86148.55,118936.81,137913.41,100045.49,"109Y11M" +65000,新北市,65000240,平溪區,2439,2633,2666,2604,2828,4067,4447,4022,3705.67,5783.48,5943.02,3061.05,5267.21,12517.56,13428.14,5573.23,"109Y11M" +65000,新北市,65000250,雙溪區,4538,4741,4631,4660,5162,6157,6482,6243,6829.37,7772.16,7717.28,5768.58,8622.31,13214.38,13504.75,8860.25,"109Y11M" +65000,新北市,65000260,貢寮區,6502,7079,6999,7022,7553,9801,9671,9330,11007.03,15825.27,15079.86,8925.23,15539.41,30327.41,30397.38,15856.29,"109Y11M" +65000,新北市,65000270,金山區,15678,15714,15535,15509,17104,19647,20098,19171,25439.61,31966.18,32292.06,22814.81,28516.66,51838.25,54055.61,30540.66,"109Y11M" +65000,新北市,65000280,萬里區,12752,13460,13227,13256,13950,15561,15670,15017,22704.77,28568.71,29142.71,19513.19,25108.9,49230.37,53013.56,28411.33,"109Y11M" +65000,新北市,65000290,烏來區,3229,3936,4048,3876,3834,5837,6222,5384,4868.58,8118.39,8000.62,4617.71,6414.05,14859.23,15543.34,8010.01,"109Y11M" +63000,臺北市,63000010,松山區,201847,278577,294479,288682,198307,207148,218976,211526,521066.66,703588.87,688431.01,634827.78,361013.08,511214.65,515887.31,464836.35,"109Y11M" +63000,臺北市,63000020,信義區,236301,312330,338883,328477,234946,244931,301650,266716,549680.14,699285.47,703489.59,668899.81,410262.42,638423.7,701300.63,597514.4,"109Y11M" +63000,臺北市,63000030,大安區,334939,448353,496305,476810,327922,356418,394107,371353,841288.88,1180592.25,1193389.78,1124240.4,596488.2,996480.53,1038302.46,891852.58,"109Y11M" +63000,臺北市,63000040,中山區,314134,453504,484182,471923,308580,331447,359996,340438,882921.14,1227946.97,1219019.04,1120933.64,616316.14,962611.85,991624.89,855812.84,"109Y11M" +63000,臺北市,63000050,中正區,183571,318569,345815,333549,178225,223195,267469,237208,657854.5,902223.4,895413.81,861093.63,419579.2,801455.08,851999.89,703209.61,"109Y11M" +63000,臺北市,63000060,大同區,125418,143388,149558,146631,125027,130048,143113,134317,400459.23,447197.46,460690.17,470477.6,284903.89,452753.33,492620.61,431231.93,"109Y11M" +63000,臺北市,63000070,萬華區,183951,161837,162279,160601,186390,183850,185284,183265,482640.39,463662.07,490861.04,529077.34,424306.76,560541.22,607057.01,560228.11,"109Y11M" +63000,臺北市,63000080,文山區,260906,221079,210668,215166,256102,252317,240318,249444,535979.1,461829.39,458132.66,484333.34,454376.23,544622.79,512993.29,446438.7,"109Y11M" +63000,臺北市,63000090,南港區,123953,168901,170643,170328,122662,135421,149331,141019,335857.03,353446.44,347861.3,342036.21,239274.99,317771.44,323709.46,274099.54,"109Y11M" +63000,臺北市,63000100,內湖區,294476,385468,388762,390671,286916,292090,286475,292574,697747.58,781412.78,754385.72,721408.5,502062.5,628229.13,610269.61,523692.17,"109Y11M" +63000,臺北市,63000110,士林區,286684,283476,280044,281141,283098,286366,285187,286371,669196.93,670775.71,688329.13,661448.7,534595.29,719896.18,726237.04,636598.56,"109Y11M" +63000,臺北市,63000120,北投區,243777,249467,242226,244263,239494,243647,235543,239692,534436.23,540547.56,532752.46,499448.25,437599.62,564035.14,548401.9,455205.34,"109Y11M" +68000,桃園市,68000010,桃園區,443150,401364,403195,401918,447526,440559,440225,442199,975584.11,936458.1,958419.34,1018892.55,854713.41,1075423.17,1078825.09,990814.61,"109Y11M" +68000,桃園市,68000020,中壢區,468601,450257,454518,451317,468876,469583,490444,474835,1022260.83,1025793.97,1047029.78,1090579.96,879879.24,1158826.39,1192282.39,1102812.77,"109Y11M" +68000,桃園市,68000030,大溪區,89265,82238,82166,81939,91840,91237,93323,91201,190073.2,176870.76,186668.93,173807.05,178478,257834.99,277379.54,211307.21,"109Y11M" +68000,桃園市,68000040,楊梅區,181003,179617,177855,179200,181317,180029,177513,179862,377626.2,330755.21,342821.18,333692.2,320569.81,364456.41,368409.79,327624.94,"109Y11M" +68000,桃園市,68000050,蘆竹區,262574,278499,277114,274994,199968,199107,199704,199396,471499.94,446325.78,454313.53,452915.82,373538.05,454463.71,463861.53,412904.15,"109Y11M" +68000,桃園市,68000060,大園區,125738,153151,158623,159865,121831,132083,138154,137933,259620.28,253518.59,265439.21,225976.75,203438.78,250794.79,270636.03,214348.51,"109Y11M" +68000,桃園市,68000070,龜山區,259439,315950,311267,313829,246122,249477,242195,247414,632987.93,615649.88,610995.12,564611.42,450704.88,516299.61,510651.82,463861.57,"109Y11M" +68000,桃園市,68000080,八德區,199330,175644,174803,175218,200933,191971,191512,192913,425749.19,365606.48,375910.55,404978.41,360551.01,422893.19,420089.31,395916.69,"109Y11M" +68000,桃園市,68000090,龍潭區,130786,139799,138189,138984,130755,133724,133926,133390,260770.6,252951.49,254291.51,228705.29,226551.82,292809.47,293579.23,255318.47,"109Y11M" +68000,桃園市,68000100,平鎮區,225189,202060,199263,200448,225231,215780,210499,214451,485127.31,412198.01,426919.23,452305.9,411198.26,458979.63,461635.02,433509.62,"109Y11M" +68000,桃園市,68000110,新屋區,52784,54826,54511,54690,53746,55759,56423,55912,99520.92,95759.22,96976.75,84400.69,87738.45,109092.55,113091.58,87746.78,"109Y11M" +68000,桃園市,68000120,觀音區,81982,97650,95668,96689,81389,84893,82625,84045,167085.46,155152.29,155771.63,129904.21,130880.18,139557.32,140448.5,114432.04,"109Y11M" +68000,桃園市,68000130,復興區,6855,7763,7687,7763,9511,13550,13132,13149,10709.62,14466.05,14148.37,8174.72,16701.17,31479.56,29840.54,13448.34,"109Y11M" +66000,臺中市,66000010,中區,19009,21887,23711,22578,20498,22347,25530,22872,57423.51,77803.84,80122.38,75824.52,60249.5,109638.77,116809.51,97285.2,"109Y11M" +66000,臺中市,66000020,東區,81226,76757,75410,75833,81823,85360,85909,84697,196414.15,184680.94,189863.3,206267.72,182332.93,234962.03,236747.55,220746.64,"109Y11M" +66000,臺中市,66000030,南區,151530,136222,133158,134292,147685,143053,136538,141618,303741.85,279728.06,282217.33,316935.49,254292.79,297508.81,293489.22,286107.51,"109Y11M" +66000,臺中市,66000040,西區,133233,151193,157865,155399,130641,131778,139848,135049,294583.9,369484.02,371355.56,356275.81,243246.23,375638.33,394331.17,344704.73,"109Y11M" +66000,臺中市,66000050,北區,193464,196233,200128,198527,190248,194863,202097,196526,415990.57,475001.82,484018.99,488547.36,361667.58,514736.36,535916.36,480598.54,"109Y11M" +66000,臺中市,66000060,西屯區,349055,412924,422489,418835,335409,338557,350657,343107,814599.67,885859.66,902772.95,894326.03,634526.14,836673.2,876907.93,829646.31,"109Y11M" +66000,臺中市,66000070,南屯區,202124,219890,222323,221575,198828,204275,208360,205568,454271.13,487248.61,494826.99,503944.39,362981.05,500126.01,507134.61,462756.31,"109Y11M" +66000,臺中市,66000080,北屯區,294667,256613,250342,253377,297223,292777,288201,290829,609859.07,574157.34,590768.41,634196.57,559159.18,696541.84,702371.26,637937.79,"109Y11M" +66000,臺中市,66000090,豐原區,146189,134123,133388,133984,147625,146518,144765,146542,303893.11,288763.04,291393.17,305314.05,279703.7,345073.39,343884.76,312132.42,"109Y11M" +66000,臺中市,66000100,東勢區,36554,32255,32317,32290,39307,39915,39826,39855,63796.22,58982.96,61479.37,57032.19,66972.35,82861.03,82694.84,63405.54,"109Y11M" +66000,臺中市,66000110,大甲區,70767,78200,77942,77940,72278,73740,72150,72832,148900.71,146779.12,148391.56,136695.7,138909.35,170323.36,174562.09,144120.28,"109Y11M" +66000,臺中市,66000120,清水區,79074,71135,70331,70796,79961,78671,77441,78637,144355.79,132218.64,138608.31,131020.69,141269.62,163570.54,179633.02,147194.27,"109Y11M" +66000,臺中市,66000130,沙鹿區,112834,102105,100877,101765,107342,102025,98366,101455,232925.01,222704.86,226540.52,236483.67,199201.25,237235.26,235677.46,223533.6,"109Y11M" +66000,臺中市,66000140,梧棲區,65644,75594,74767,75369,63685,64275,64137,64301,133591.62,132172.14,133956.47,121105.31,109492.92,127301.22,132481.97,112949.02,"109Y11M" +66000,臺中市,66000150,后里區,56870,67298,67072,67228,55406,58320,60880,59235,145881.58,147611.02,148162,132212.53,133662.73,168719.56,183862.72,149461.9,"109Y11M" +66000,臺中市,66000160,神岡區,68693,75663,74789,75173,66966,63653,62138,63523,168384.76,152107.2,157449.98,148186.56,129966.21,139809.44,154017.7,140340.27,"109Y11M" +66000,臺中市,66000170,潭子區,112942,116992,114705,115902,113350,113243,107964,112078,264293.03,230029.75,237456.86,241850.14,221352.9,235040.56,237395.99,219778.91,"109Y11M" +66000,臺中市,66000180,大雅區,107351,116252,116384,116641,103995,98996,96637,98892,253594.01,226502.14,230268.7,235885.23,195180.69,203844.39,208314.47,206414.99,"109Y11M" +66000,臺中市,66000190,新社區,22407,22978,22489,22560,22432,25353,25222,24678,40468.64,49816.16,48612.73,33575.84,43052.38,81076.83,79378.81,38082.59,"109Y11M" +66000,臺中市,66000200,石岡區,11220,9795,9609,9697,12052,12617,12474,12510,23762.93,21709.01,22669.17,20358.83,23990.23,36846.79,39106.23,24342.33,"109Y11M" +66000,臺中市,66000210,外埔區,26969,22887,22605,22752,27648,25736,25295,25692,53071.66,46433.16,48392.1,47052.92,55256.9,59464.68,67049.21,59252.29,"109Y11M" +66000,臺中市,66000220,大安區,14584,12618,12696,12661,14973,14592,14689,14718,23015.32,20581.51,20719.01,19229.84,22481.69,24661.43,25714.45,20992.14,"109Y11M" +66000,臺中市,66000230,烏日區,92898,103156,102146,102761,90152,90705,89143,90332,231358.92,216979.74,226329.99,219547.27,188296.15,217362.41,229950.22,217647.02,"109Y11M" +66000,臺中市,66000240,大肚區,52840,45615,44950,45261,53330,50591,48493,50127,102826.66,86295.65,88122.73,89846.95,98012.23,99197.66,100786.56,95773.17,"109Y11M" +66000,臺中市,66000250,龍井區,89218,78735,76305,77790,88029,83424,80107,82941,185326.3,152704.55,157673.95,166517.38,159120.56,168607.59,175908.62,164676.75,"109Y11M" +66000,臺中市,66000260,霧峰區,81867,89972,89907,90023,78930,78683,77657,78490,184454.09,184038.64,186779.55,174866.39,147346.81,179654.24,180953.83,169650.39,"109Y11M" +66000,臺中市,66000270,太平區,191780,168567,164998,167068,191518,182069,175235,180904,410085.51,356181.18,360111.59,387659.14,358191.06,377040.21,373997.48,357145.93,"109Y11M" +66000,臺中市,66000280,大里區,202540,183927,180985,182106,200622,188289,182899,187144,479710.06,410899.62,424060.64,471580.98,394591.58,439385.01,437051.39,426534.83,"109Y11M" +66000,臺中市,66000290,和平區,16421,17796,17921,17603,20908,30445,29393,28798,23470.55,30516.67,28822.73,18239.4,34625.53,58334.76,50534.02,26299.91,"109Y11M" +67000,臺南市,67000010,新營區,67253,69997,69938,70101,68412,68879,68236,68748,140938.28,144055.62,148290.49,139805.7,130331.14,162444.91,164476.62,147163.47,"109Y11M" +67000,臺南市,67000020,鹽水區,19690,18702,18577,18630,20512,21033,21072,20932,36983.24,34685.9,35350.99,33134.89,37342.8,44002.26,44539.65,34700.75,"109Y11M" +67000,臺南市,67000030,白河區,22117,22094,21813,21783,23742,25951,26211,25339,37983.74,40595.77,42220.46,33091.88,43429.76,60804.71,61877.32,46051.99,"109Y11M" +67000,臺南市,67000040,柳營區,20929,25538,25020,25114,20818,22390,22369,22174,44962.91,47461.58,50543.4,37792.72,39578.29,50102.16,54507.78,44689.46,"109Y11M" +67000,臺南市,67000050,後壁區,24538,24554,24552,24424,25528,26306,26567,26278,44713.61,45815.27,48966.76,40287.25,48198.65,57048.17,64228.8,52349.64,"109Y11M" +67000,臺南市,67000060,東山區,12960,11727,12019,11789,13858,15200,15378,14939,21174.64,22056.89,23521.04,18401.26,27815.37,35480.76,37991.88,26286.72,"109Y11M" +67000,臺南市,67000070,麻豆區,39434,39572,39510,39334,40531,41480,41291,41267,82776.22,82317.55,86052.47,78399.43,81134.46,101326.93,105676.49,89692.98,"109Y11M" +67000,臺南市,67000080,下營區,15750,12333,12625,12502,16747,16322,16724,16410,28510.66,26492.97,28303.8,26939.81,32284.01,38444.63,41776.25,38478.21,"109Y11M" +67000,臺南市,67000090,六甲區,15615,12773,12870,12694,16502,16511,16427,16372,28661.62,26114.01,27823.05,27454.8,32029.46,37334.24,39515.59,31706.83,"109Y11M" +67000,臺南市,67000100,官田區,24512,28596,29018,29006,22935,23951,24002,23870,53241.12,51679.28,54820.01,44945.14,47171.2,55657.34,61607.23,53030.35,"109Y11M" +67000,臺南市,67000110,大內區,7436,6519,6706,6677,7339,8445,8573,8373,10872.8,10813.64,11018.28,9452.61,12483.45,16627.42,16550.5,11427.11,"109Y11M" +67000,臺南市,67000120,佳里區,48073,44317,44651,44339,49682,48956,49162,49283,82112.58,78008.48,80007.8,80368.59,76115.13,91917.2,91871.3,78652.09,"109Y11M" +67000,臺南市,67000130,學甲區,18238,17206,16917,17001,19313,19795,20137,19891,30532.59,29932.53,30316.17,26738.54,31182.35,38087.94,38225.8,28811.27,"109Y11M" +67000,臺南市,67000140,西港區,20172,20489,20632,20556,20692,20908,20626,20797,43740.01,37919.64,39469.32,38578.35,36373.95,41803.62,42505.79,35092.34,"109Y11M" +67000,臺南市,67000150,七股區,13635,13293,12956,13042,14017,15750,15862,15425,21569.23,21879.29,22584.34,17821.79,22506.61,35669.65,37525.72,22580.42,"109Y11M" +67000,臺南市,67000160,將軍區,11967,10732,10680,10772,12464,12942,13095,12977,16402.43,16028.11,16120.56,14163.66,17610.13,22986.59,23372.35,16176.9,"109Y11M" +67000,臺南市,67000170,北門區,8007,8485,8349,8379,8712,11205,10870,10576,12733.73,14748.94,14886.41,10154.39,15669.27,27173.56,27907.39,13811.82,"109Y11M" +67000,臺南市,67000180,新化區,37109,34837,34347,34344,37132,38443,36914,37518,82737.46,70921.22,74028.44,70959.82,76115.77,85298.09,85979.03,72317.32,"109Y11M" +67000,臺南市,67000190,善化區,67629,80119,79408,79957,64937,67566,65493,67334,137815.21,128287.05,129557.66,127785.79,113259.32,128350.94,127612.16,117743.32,"109Y11M" +67000,臺南市,67000200,新市區,66502,96960,96416,96842,63092,65676,64778,65432,185509.77,164114.07,167291.37,162709.59,132925.49,135160.59,140035.18,139998.53,"109Y11M" +67000,臺南市,67000210,安定區,31829,38956,38878,39074,30825,31413,31187,31632,79384.78,71301.94,74402.73,69271.87,59724.27,64505.93,68518.38,61597.63,"109Y11M" +67000,臺南市,67000220,山上區,5916,7593,7493,7510,6236,6965,6971,6891,10745.85,10694.34,10577.59,8382.02,9517.5,11339.56,11685.83,8069.93,"109Y11M" +67000,臺南市,67000230,玉井區,9536,9837,9761,9802,10262,11306,11628,11341,16070.01,16631.25,16962.24,13025.35,18099.47,26029.14,26006.94,16106.81,"109Y11M" +67000,臺南市,67000240,楠西區,6163,6102,6128,6065,6861,7823,8175,7757,8601.01,9474.12,9466.04,6847.69,10268.58,16116.44,15390.92,8640.27,"109Y11M" +67000,臺南市,67000250,南化區,4214,4354,4286,4290,4731,5995,5822,5813,6377.31,6745.15,6920.6,4855.41,9214.51,13452.98,12845.67,6734.48,"109Y11M" +67000,臺南市,67000260,左鎮區,2638,2501,2594,2512,2937,3752,3911,3705,4724.21,4578.42,4817.64,3711.04,5973.05,9575.35,9623.82,5024.15,"109Y11M" +67000,臺南市,67000270,仁德區,94357,109454,107678,108963,92051,93003,92603,92992,229097.33,225956.01,232553.37,211688.81,174036.13,212784.42,224624.94,204669.66,"109Y11M" +67000,臺南市,67000280,歸仁區,66030,65664,66096,65994,64078,63563,63295,63810,140746.05,131098.4,136931.09,134940.2,116980.61,134926.13,141775.74,131869.07,"109Y11M" +67000,臺南市,67000290,關廟區,29618,28036,27871,27924,30305,31068,30389,30829,61920.75,53472.98,56346.28,54999.95,61915.16,70165.99,75030.61,66034.67,"109Y11M" +67000,臺南市,67000300,龍崎區,1664,1916,1813,1837,1755,2651,2780,2519,4529.85,4621.23,5265.89,3660.11,7097.33,9303.53,11091.5,6804.42,"109Y11M" +67000,臺南市,67000310,永康區,280816,275527,271962,273869,274486,265738,257139,263650,636283.22,590206.79,598802.14,630218.01,508797.7,577598.77,572023.81,559259.52,"109Y11M" +67000,臺南市,67000320,東區,177707,161167,163570,161978,177038,172730,174324,173192,384099.63,413803.3,417839.04,447005.15,341258.83,460262.87,452589.03,428706.77,"109Y11M" +67000,臺南市,67000330,南區,110565,103789,101229,102349,111202,107665,103259,106093,248135.18,238962.51,243598.38,249512.49,215756.41,261542.62,269510.43,244445.52,"109Y11M" +67000,臺南市,67000340,北區,132392,115413,114756,114545,132863,127561,122345,125293,273339.15,275860.89,281327.39,300028.61,247269.16,316458.95,312263.06,308521.46,"109Y11M" +67000,臺南市,67000350,安南區,177012,166484,163859,165154,178012,171204,164888,169946,380166.17,337230.68,343067.18,351619.21,318584.81,356752.82,354753.87,320620.13,"109Y11M" +67000,臺南市,67000360,安平區,64930,60808,60142,60384,66256,65350,64038,64551,135908.27,147511.19,151178.65,146852.09,125285.14,184177.65,194204.77,161912.1,"109Y11M" +67000,臺南市,67000370,中西區,78975,92870,101485,97349,82160,88186,106295,93612,198963.95,278892.02,286834.84,280637.24,181232.74,353751.64,389737.46,341423.45,"109Y11M" +64000,高雄市,64000010,鹽埕區,21320,21222,20912,21051,21893,22075,22838,21926,51139.24,60706.39,62369.55,58962.59,49735.94,79101.49,97064.03,82965.68,"109Y11M" +64000,高雄市,64000020,鼓山區,133197,121867,120709,121339,133224,130200,127033,129743,240106.76,245742.62,257161.33,255241.68,216318.25,272061.1,287562.22,254416.41,"109Y11M" +64000,高雄市,64000030,左營區,189101,183697,190281,187038,188083,188652,201976,193214,403168.23,428914.49,444756.2,457172.29,341758.28,472008.83,487534.04,462328.02,"109Y11M" +64000,高雄市,64000040,楠梓區,187386,171808,169998,170692,185341,178423,171643,176877,407128.73,377443.81,379359.7,406053.87,348225.49,380366.17,374574.79,369780.09,"109Y11M" +64000,高雄市,64000050,三民區,315169,291645,287570,288857,311897,307107,294144,302573,675731.64,698208.77,705570.53,721266.38,583982.88,704894.45,685764.05,648365.38,"109Y11M" +64000,高雄市,64000060,新興區,53511,64063,68104,66014,54543,54705,58193,55770,132973.67,177585.18,184425.51,177445.64,111646.91,167791.25,178145.05,171191.18,"109Y11M" +64000,高雄市,64000070,前金區,32269,44519,47879,46296,33056,36817,41670,38389,84367.73,116748.31,119386.52,107229.27,70157.12,111590.09,118578.22,111766.33,"109Y11M" +64000,高雄市,64000080,苓雅區,150111,160641,160836,160381,150830,150753,149166,149401,357201.99,399207.32,410782.91,394230.93,301234.83,393095.74,401065.77,371640.46,"109Y11M" +64000,高雄市,64000090,前鎮區,173373,184341,189379,187131,174738,176819,198168,183597,397228.19,403097.07,419538.69,415898.31,325271.92,443302.73,467375.11,414920.8,"109Y11M" +64000,高雄市,64000100,旗津區,16331,14878,14785,14822,16649,16710,17060,16617,32688.62,35158.11,36645.22,30066.28,31256.3,48430.87,56351.01,38818.8,"109Y11M" +64000,高雄市,64000110,小港區,132172,147378,144897,146665,130848,131773,126510,130094,325544.1,294945.94,309615.2,276411.04,250322.45,265277.03,267271.12,239039.47,"109Y11M" +64000,高雄市,64000120,鳳山區,309643,245791,244284,244857,307589,291186,283322,289693,662473.25,580889.69,608687.66,686077.98,599362.2,691268.56,684910.42,663396.79,"109Y11M" +64000,高雄市,64000130,林園區,49572,45093,44477,44769,50407,49552,48622,49367,103415.11,89958.24,94376.14,95362.9,94900.28,103205.32,103716.54,95179.12,"109Y11M" +64000,高雄市,64000140,大寮區,117164,137597,135906,137400,116115,114837,112370,114528,311235.69,276650.05,298062.25,268313.82,227475.19,246202.51,256652.02,234104.55,"109Y11M" +64000,高雄市,64000150,大樹區,41802,45125,47154,46406,40592,43402,49332,44969,80069.58,82413.25,85521.9,72612.65,69446.55,91880.06,99731.01,77549.06,"109Y11M" +64000,高雄市,64000160,大社區,42449,42401,41029,41679,42145,42715,40692,41993,93637.24,86134.94,87333.21,87003.91,84252.16,90564.29,89136.24,81356.75,"109Y11M" +64000,高雄市,64000170,仁武區,100102,107032,104986,106313,100529,99051,95379,98257,249760.37,223307.19,240852,230020.4,191132.33,209976.68,222022.27,205715.63,"109Y11M" +64000,高雄市,64000180,鳥松區,55856,69528,67775,68488,55308,59861,57678,58854,133303.99,136426.71,139877.83,119341.66,102555.74,118735.99,118517.98,97777.45,"109Y11M" +64000,高雄市,64000190,岡山區,98634,112144,110865,111424,97509,96437,95434,96258,251642.51,242085.58,243996.44,239460.98,199022.24,231863.8,228571.9,224879.14,"109Y11M" +64000,高雄市,64000200,橋頭區,40164,35328,33993,34595,40611,39829,39629,39826,91810.53,78800.83,83965.64,85252.19,78210.53,91715.28,97867.92,86387.31,"109Y11M" +64000,高雄市,64000210,燕巢區,44153,61804,62709,62278,41171,44242,44416,44482,107886.69,121258.49,121901.77,92352.73,82326.46,100600.18,104761.82,92708.34,"109Y11M" +64000,高雄市,64000220,田寮區,4152,4188,4133,4147,4486,5938,6216,5792,11824.3,13236.28,14252.69,11066.8,16481.57,25442.92,28210,22442.16,"109Y11M" +64000,高雄市,64000230,阿蓮區,24453,21698,21501,21545,24826,25309,24902,25001,49807.17,45416.18,46406.46,46195.65,49912.21,57998.05,57148.14,50715.38,"109Y11M" +64000,高雄市,64000240,路竹區,51149,62835,61592,62356,50630,50620,50235,50692,138073.56,130624.42,133771.28,123723.16,103787.16,116641.96,120281.03,120908.72,"109Y11M" +64000,高雄市,64000250,湖內區,30824,25495,25458,25420,30967,29315,28750,29171,65822.89,57663.36,58663.52,60257.18,55010.33,60510.95,63598.21,58871.84,"109Y11M" +64000,高雄市,64000260,茄萣區,22673,19680,19326,19401,23384,23407,23630,23421,41299.93,35624.71,37027.96,38203.34,41132.92,47627.39,53305.27,43995.28,"109Y11M" +64000,高雄市,64000270,永安區,11197,14254,13957,14110,11085,11921,11740,11865,25681,23437.88,24071.9,19571.15,20011.7,22161.92,23108.07,18082.52,"109Y11M" +64000,高雄市,64000280,彌陀區,13399,10827,10794,10827,13777,13449,13382,13497,24016.86,19143.21,19675.69,21452.76,22823.02,23742.83,24585.53,21238.56,"109Y11M" +64000,高雄市,64000290,梓官區,29012,23070,23048,22998,29759,27912,27862,28109,62061.69,52207.52,54205.15,58439.88,57586.83,63508.21,68867.26,60062.45,"109Y11M" +64000,高雄市,64000300,旗山區,30530,30982,30320,30587,31190,30885,31742,31072,57869.06,59817.94,62392.69,52716.43,56550.65,79789.89,88470.27,65121.12,"109Y11M" +64000,高雄市,64000310,美濃區,23519,22067,21996,22017,26246,28267,29372,28484,36626.99,38018.5,38700.52,31393.5,42068.18,66547.74,65198.03,38662.52,"109Y11M" +64000,高雄市,64000320,六龜區,8807,8712,8678,8661,10852,11787,12318,11778,12947.9,13804.88,14588.01,10230.02,17187.65,24183.55,25463.54,14706.79,"109Y11M" +64000,高雄市,64000330,甲仙區,3295,3309,3359,3330,3591,4104,4366,4107,4434.86,5077.64,5152.68,3587.48,5533.79,9687.85,9489.01,4670.45,"109Y11M" +64000,高雄市,64000340,杉林區,6057,5391,5504,5448,6601,6915,7083,6976,8043.4,8009.39,8254.28,6617.11,9309.61,11520.3,11768.23,8159.03,"109Y11M" +64000,高雄市,64000350,內門區,9633,9357,9850,9517,9716,9659,10167,9875,14118.02,15195.95,15443.41,12244.37,14506.25,19389.82,20415.65,13792.49,"109Y11M" +64000,高雄市,64000360,茂林區,930,1039,1047,1039,1209,1730,1860,1709,1150.68,1558.02,1430.56,870.48,1684.46,3857.15,3282.77,1258.36,"109Y11M" +64000,高雄市,64000370,桃源區,2129,2479,2383,2422,2626,3587,3468,3520,3069.29,3520.33,3381.22,1963.46,4248.95,5697.69,5522.86,2577,"109Y11M" +64000,高雄市,64000380,那瑪夏區,1453,1612,1521,1561,1625,1885,1878,1865,1680.37,1843.85,1767.25,1217.28,2040.5,2472.63,2326.22,1421.36,"109Y11M" +10002,宜蘭縣,10002010,宜蘭市,96473,98784,100197,99481,99018,101500,103998,101965,188561.42,210577.17,213745.67,197307.47,176872.7,246628.38,239875.79,204162.71,"109Y11M" +10002,宜蘭縣,10002020,羅東鎮,65083,66138,67073,66553,68452,69656,69156,68973,132401.79,147596.3,149882.19,143229.34,129245.04,170501.94,163772.62,150590.63,"109Y11M" +10002,宜蘭縣,10002030,蘇澳鎮,36296,38586,38457,38469,37905,39443,39124,38860,65982.91,73613.05,76517.49,57178.41,68799.06,89225.68,90629.98,64730.55,"109Y11M" +10002,宜蘭縣,10002040,頭城鎮,23099,22444,22378,22323,25414,25904,25863,25313,50174.67,60300.82,65154.15,49013.46,60153.91,89217.86,97557.26,67700.68,"109Y11M" +10002,宜蘭縣,10002050,礁溪鄉,40592,38400,38525,38060,47454,46271,45734,44365,79592.28,89050.61,96091.65,81472.85,97463.81,128049.97,142388.25,113640.93,"109Y11M" +10002,宜蘭縣,10002060,壯圍鄉,19645,15227,15267,15184,20766,19604,19048,19177,34797.71,31167.29,33256.27,31326.43,37012.12,45720.74,47082.3,36698.16,"109Y11M" +10002,宜蘭縣,10002070,員山鄉,30487,25968,26119,26004,31834,30176,29390,29544,49033.22,46903.98,49186.8,42410.9,50340.23,62076.67,61725.96,45448.64,"109Y11M" +10002,宜蘭縣,10002080,冬山鄉,50045,44931,44348,44511,52986,50186,48706,49495,88165.88,83026.06,85136.39,75168.47,86546.21,99402.25,98727.33,78422.47,"109Y11M" +10002,宜蘭縣,10002090,五結鄉,48227,47711,47609,47523,50506,51949,51983,51534,81760.68,82681.73,85299.62,73996.11,80546.06,104520.92,104939.28,80242.92,"109Y11M" +10002,宜蘭縣,10002100,三星鄉,21033,19837,19370,19639,21310,19261,18670,18906,32305.85,33453.29,34753.4,25373.19,32687.31,41954.93,43216.37,28368.04,"109Y11M" +10002,宜蘭縣,10002110,大同鄉,5691,6710,7252,6937,7332,11325,12042,11396,9191.5,13632.38,15228.94,7172.94,15133.27,24011.78,26413.04,11269.34,"109Y11M" +10002,宜蘭縣,10002120,南澳鄉,4532,5065,4973,5020,5100,5690,5547,5591,8644.62,12591.94,13871.44,8636.24,12075.94,16608.16,18306.24,12519.61,"109Y11M" +10004,新竹縣,10004010,竹北市,227031,214369,215633,215030,226079,225193,221899,225857,398215.04,389820.78,391210.39,388452.77,343495.34,419885.4,415924.31,385877.12,"109Y11M" +10004,新竹縣,10004020,竹東鎮,100364,81123,79960,79977,101361,94863,91704,94086,163571.65,140943.05,144621.4,145685.12,161133.49,176856.28,180940.4,159398.03,"109Y11M" +10004,新竹縣,10004030,新埔鎮,35252,31740,31002,31251,35838,35973,35688,35539,62450.64,57266.94,58956.32,52833.12,58664.59,77620.41,78123.81,59126.2,"109Y11M" +10004,新竹縣,10004040,關西鎮,25604,25545,24059,24722,26056,29202,31444,29366,48967.56,52547.22,53403.04,44249.25,71006.85,89961.67,99995.45,78928.19,"109Y11M" +10004,新竹縣,10004050,湖口鄉,117065,137881,136365,136958,113412,114877,112521,113686,259290.58,247183.8,250891.35,222597.55,218171.07,227164.83,231978.04,225836.76,"109Y11M" +10004,新竹縣,10004060,新豐鄉,67050,61609,60688,61198,67019,66336,64418,65607,110994.39,101812.75,101535.46,101522.38,102342.12,112680.03,110097.79,96614.55,"109Y11M" +10004,新竹縣,10004070,芎林鄉,19716,16317,16002,16113,20138,19454,18830,19094,35046.97,29808.37,31913.01,29829.43,36568.85,42760.68,47795.95,38489.54,"109Y11M" +10004,新竹縣,10004080,橫山鄉,11230,9997,10078,9950,12224,13412,13888,13223,16891.9,18419.29,19092.83,14580.43,21877.85,40154.76,44115.23,22679.37,"109Y11M" +10004,新竹縣,10004090,北埔鄉,7040,5893,5972,5928,8022,8989,9436,8989,8098.85,10109.91,9670.38,6791.34,11497.7,26158.19,27504.3,10857.23,"109Y11M" +10004,新竹縣,10004100,寶山鄉,33049,75386,75225,75662,29931,35113,35581,35435,93124.29,105465.25,109826.67,88003.74,69211.56,73545.73,87605.95,80195.75,"109Y11M" +10004,新竹縣,10004110,峨眉鄉,3774,3483,3484,3487,4211,5387,5440,5277,4881.17,5898.66,5925.3,3829.14,6827.26,13158.83,13925.23,5808.42,"109Y11M" +10004,新竹縣,10004120,尖石鄉,5756,5981,6096,5955,9202,11846,12302,11548,7072.74,9078.52,9126.65,5945.78,14710.26,21779.68,21133.68,11663.41,"109Y11M" +10004,新竹縣,10004130,五峰鄉,3077,3182,3410,3240,5029,7046,6734,6597,4040.07,5302.81,5254.64,3211.18,8899.76,13807.59,12362.08,6201.47,"109Y11M" +10005,苗栗縣,10005010,苗栗市,86555,85857,85564,85707,86534,84014,82690,83899,154831.28,157587.36,161760.58,150846.24,141152.71,165997.23,166766.16,147933.88,"109Y11M" +10005,苗栗縣,10005020,苑裡鎮,38449,34354,34681,34481,39894,39643,39830,39941,61380.41,57017.67,59335.47,55473.33,64269.02,75325.18,78574.04,66425.63,"109Y11M" +10005,苗栗縣,10005030,通霄鎮,23771,21783,21857,21922,25448,27280,27497,26964,44523.38,44872.56,48071.09,40562.85,54060.71,71906.79,82161.8,60030.22,"109Y11M" +10005,苗栗縣,10005040,竹南鎮,101747,109524,108279,109049,100265,98104,94606,97190,206217.23,190452.15,194871.09,190860.05,183648.38,197978.37,211554.86,203689.46,"109Y11M" +10005,苗栗縣,10005050,頭份市,101710,81198,81905,81123,101685,95391,95872,95713,174809.81,156022.05,163690.65,173582.04,174148.24,201406.52,206830.64,192815.41,"109Y11M" +10005,苗栗縣,10005060,後龍鎮,30538,30113,29762,29898,30541,30175,30504,30030,62612.54,60632.56,64338.71,54306.52,62321.61,74969.85,85978.46,76432.07,"109Y11M" +10005,苗栗縣,10005070,卓蘭鎮,11458,11412,11491,11454,12615,13885,13816,13649,20673.35,20704.94,21295.85,16876.14,22464.96,29544.77,29326.68,19508.38,"109Y11M" +10005,苗栗縣,10005080,大湖鄉,9862,10473,10368,10383,11293,13167,12821,12817,15348.2,16448.2,16752.82,11989.12,18618.7,28815.9,27793.67,15593.32,"109Y11M" +10005,苗栗縣,10005090,公館鄉,26499,21282,21320,21262,28060,27786,27057,27380,40098.99,36548.51,38210.15,36927.69,46043.69,56968.79,56877.21,48991.87,"109Y11M" +10005,苗栗縣,10005100,銅鑼鄉,17627,21657,21457,21475,18388,20480,20053,19844,41316.91,46761.97,49371.65,39382.78,48962.94,68011.08,74153.31,58111.17,"109Y11M" +10005,苗栗縣,10005110,南庄鄉,6734,6543,6589,6490,9399,12168,11734,11670,9119.58,12517.16,12283.2,7619.13,16514.65,35509.22,33901.97,13863.39,"109Y11M" +10005,苗栗縣,10005120,頭屋鄉,7774,7016,7021,7049,8280,8829,8727,8645,16391.13,15761.16,17654.23,14974.68,19615.26,23586.91,28913.64,24059.17,"109Y11M" +10005,苗栗縣,10005130,三義鄉,14455,16420,16280,16228,15381,18442,17933,17636,31533.5,38739.11,40448.15,29210.41,41803.67,63998.3,69364.89,44831.66,"109Y11M" +10005,苗栗縣,10005140,西湖鄉,4277,4416,4362,4367,4474,5077,5084,5032,9160.39,9541.64,10891.21,8277.86,14126.09,14330.07,18240.97,14374.39,"109Y11M" +10005,苗栗縣,10005150,造橋鄉,12480,13323,12871,13057,12600,14109,13542,13821,28039.87,28169.67,30632.04,27151.94,32657.8,37405.34,46313.96,47026.18,"109Y11M" +10005,苗栗縣,10005160,三灣鄉,5137,4833,4739,4763,5661,6589,6288,6318,8536.33,9160.7,9730.97,6978.87,11236.57,18410.45,19115.65,9643.59,"109Y11M" +10005,苗栗縣,10005170,獅潭鄉,2709,2974,2970,2968,3449,4980,4807,4651,4615.22,6150.97,6189.04,3672.11,7518.94,16092.99,15700.29,6193.87,"109Y11M" +10005,苗栗縣,10005180,泰安鄉,3682,3952,3917,3893,5964,8330,7688,7749,4904.7,5784.03,5729.55,3814.26,9735.26,14480.24,12857.12,7410.31,"109Y11M" +10007,彰化縣,10007010,彰化市,214161,213783,213554,213419,213353,213275,210409,212870,485620.62,491612.23,495118.49,502452.32,432250.01,542050.15,544698.76,503726.06,"109Y11M" +10007,彰化縣,10007020,鹿港鎮,80583,88520,87984,88051,81125,84576,83820,84109,182654.58,181639.66,179563.31,168171.77,161426.2,214526.49,219923.06,167437.77,"109Y11M" +10007,彰化縣,10007030,和美鎮,83456,77159,77005,77081,84381,82104,81467,82751,164883.98,145448.27,149312.74,155618.88,149920.77,164556.71,167966.05,155830.67,"109Y11M" +10007,彰化縣,10007040,線西鄉,14662,18626,18280,18506,14527,15268,15035,15337,31770.31,31035.24,30591.63,25219.39,25256.56,27713.8,28542.51,22260.94,"109Y11M" +10007,彰化縣,10007050,伸港鄉,31027,30266,29974,30033,31428,30442,29963,30382,65476.06,56875.02,57321.02,56519.39,59011.43,61624.16,62166.15,54281.01,"109Y11M" +10007,彰化縣,10007060,福興鄉,38756,40254,40250,40370,39152,37370,37592,37797,80723.19,72362.01,74148.59,70016.58,66790.88,76689.65,80835.61,67431.23,"109Y11M" +10007,彰化縣,10007070,秀水鄉,32134,32497,32646,32709,32549,32126,31899,32241,64674.46,59136.89,62697.29,59204.78,57340.01,65900.58,68145.76,60689.08,"109Y11M" +10007,彰化縣,10007080,花壇鄉,42269,39314,39696,39612,43161,42919,43009,43370,86931.98,79001.85,82389.36,82980.1,78026.51,94437.89,99406.03,90094.01,"109Y11M" +10007,彰化縣,10007090,芬園鄉,16521,14027,14207,14155,17126,17115,17170,17221,28832.48,24914.41,27170.67,25645.98,29733.24,34047.97,37851.11,30031.83,"109Y11M" +10007,彰化縣,10007100,員林市,104870,101505,102558,101837,108214,110531,111651,110812,218695.63,222027.74,228707.05,235798.1,200867.27,270201.85,270038.48,244654.03,"109Y11M" +10007,彰化縣,10007110,溪湖鎮,44624,41118,41520,41305,45986,46005,45917,46013,94972,93335.3,96565.13,97108.59,91328.02,117355.63,126738.63,110689.77,"109Y11M" +10007,彰化縣,10007120,田中鎮,29351,30973,30246,30766,30952,31499,30957,31144,62035.8,55318.13,60726.66,54244.07,60149.42,66481.53,68300.64,59921.51,"109Y11M" +10007,彰化縣,10007130,大村鄉,40503,42163,42238,42255,39600,38972,39047,39326,75826.5,70478.03,71802.25,68066.84,62716.98,69552.04,71989.41,63715.3,"109Y11M" +10007,彰化縣,10007140,埔鹽鄉,23642,22194,22189,22130,24902,24922,24709,24948,44990.4,40488,41915.55,38889.46,41460.19,46814.89,48655.01,40311.65,"109Y11M" +10007,彰化縣,10007150,埔心鄉,30359,30553,30674,30672,31291,31715,31599,31790,63281.75,58483.08,61634.55,58284.7,53882.28,65694.52,68965.86,58455.47,"109Y11M" +10007,彰化縣,10007160,永靖鄉,26003,23001,22971,23007,27331,26752,26737,26953,49199,43762.78,45611.37,45867.94,46320.28,54539.19,55885.43,46999.68,"109Y11M" +10007,彰化縣,10007170,社頭鄉,30885,26173,26090,26154,32537,32107,31719,32136,55538.5,48391.1,50494.08,50470.6,56180.83,62489.07,64178.56,54758.06,"109Y11M" +10007,彰化縣,10007180,二水鄉,9776,8767,8666,8682,10683,11485,11448,11418,15721.96,14579.51,15348.15,13615,18486.02,21450.48,22638.05,16852.52,"109Y11M" +10007,彰化縣,10007190,北斗鎮,27294,28391,28159,28370,28270,28874,28674,28803,56545.83,57425.62,58085.53,56714.55,51638.13,66003.25,64087.86,57345.82,"109Y11M" +10007,彰化縣,10007200,二林鎮,36425,34787,34917,34838,37965,38900,38516,38699,70714.23,66636.55,68750.83,64949.46,67944.89,77128.37,75600.31,63847.67,"109Y11M" +10007,彰化縣,10007210,田尾鄉,21203,18157,18447,18230,22630,22397,23123,22774,37729.94,35738.31,38699.57,35340.13,38683.91,50136.63,58945.58,42495.93,"109Y11M" +10007,彰化縣,10007220,埤頭鄉,23338,22047,22180,22095,24427,24494,24307,24446,46963.79,44371.05,47625.36,43428.47,47469.68,53788.14,60988.34,50984.22,"109Y11M" +10007,彰化縣,10007230,芳苑鄉,25156,26731,26691,26616,26393,28296,28440,28022,45511.5,45434.06,46397.51,36402.04,43864.65,54889.17,57333.41,40370.15,"109Y11M" +10007,彰化縣,10007240,大城鄉,10510,10171,10242,10312,10846,11519,11596,11570,17370.15,16214.31,16655.39,14012.58,17313.07,20213.25,20964.48,15544.75,"109Y11M" +10007,彰化縣,10007250,竹塘鄉,9106,8069,8126,8050,9734,9943,10010,9842,15777.1,14503.11,15033.44,13287.26,16162.49,18334.67,19062.11,14649.77,"109Y11M" +10007,彰化縣,10007260,溪州鄉,21689,20355,20494,20352,22623,23270,23336,23116,41501.79,41357.37,44395.64,38176.16,43973.26,52248.49,58866.05,47677.22,"109Y11M" +10008,南投縣,10008010,南投市,90184,98575,97748,98193,90208,90290,88682,89482,187138.75,186881.78,190908.12,172625.16,166875.83,200985.1,209842.77,183621.87,"109Y11M" +10008,南投縣,10008020,埔里鎮,78911,77119,77472,77168,82353,81434,81710,80927,133699.07,150828.54,150399.35,133624.52,144792.43,202651.76,197166.78,156035.12,"109Y11M" +10008,南投縣,10008030,草屯鎮,90186,84953,85397,85092,92294,91839,91543,92037,173744.74,172537.53,178059.3,174086.94,166469.41,212762.37,218625.39,195336.97,"109Y11M" +10008,南投縣,10008040,竹山鎮,44375,43383,43704,43438,46618,48913,48883,48305,77768.85,87275.01,91459.8,71578.72,86197.28,125360.95,127366.69,88659.36,"109Y11M" +10008,南投縣,10008050,集集鎮,8323,8630,8650,8606,8224,8524,8707,8474,14963.7,16977.1,16887.11,12243.65,14747.57,25048.61,25857.01,14963.42,"109Y11M" +10008,南投縣,10008060,名間鄉,28162,25609,25868,25719,29790,30402,30760,30590,49405.31,48382.17,52475.5,43296.44,54586.03,70152.53,81512.64,63324.25,"109Y11M" +10008,南投縣,10008070,鹿谷鄉,12975,18022,15499,16330,16069,19908,18999,18597,22119.71,33991.94,30079.61,14272.34,28334.62,46102.65,43726.96,21348.1,"109Y11M" +10008,南投縣,10008080,中寮鄉,7987,7420,7378,7350,8881,10627,10711,10537,12139.73,11789.71,12628.44,9646.17,16044.43,21155.43,22778.08,15387.86,"109Y11M" +10008,南投縣,10008090,魚池鄉,14252,15429,15397,15227,18494,21662,22727,20810,22681,33112.06,33691.15,19629.85,33946.59,68401.59,73004.56,38028.85,"109Y11M" +10008,南投縣,10008100,國姓鄉,12030,11351,11441,11386,14585,17582,17241,17206,18600.28,20458.39,21495.02,16262.24,27684.06,40476.78,44838.6,28364.87,"109Y11M" +10008,南投縣,10008110,水里鄉,12356,12994,12927,12839,12759,13495,13572,13224,21444.69,25565.41,25255.74,17761.59,22431.12,36814.56,36744.34,21336.96,"109Y11M" +10008,南投縣,10008120,信義鄉,10411,11029,10779,10834,12267,14582,14389,14218,15014.36,16804.15,16363.37,10805.98,19741,26075.1,25078.21,14123.66,"109Y11M" +10008,南投縣,10008130,仁愛鄉,16582,18165,18171,17882,21855,28475,28249,26797,27684.98,36283.72,35339.06,21526.91,46880.66,69676.83,66480.84,37152.46,"109Y11M" +10009,雲林縣,10009010,斗六市,129778,140559,140995,140701,127676,127299,127534,127750,247980.98,262268.04,267874.75,251178.19,214677.12,272454.02,279195.14,249517.38,"109Y11M" +10009,雲林縣,10009020,斗南鎮,38831,37321,37234,37370,40015,39722,39145,39645,79659.83,79370.95,83358.27,79098.72,78376.52,95478.78,100556.97,90869.14,"109Y11M" +10009,雲林縣,10009030,虎尾鎮,75513,73583,73741,73641,73536,72134,72067,72273,153476.33,164907.54,169089.82,164114.48,137576.79,176586.14,180963.85,158171.82,"109Y11M" +10009,雲林縣,10009040,西螺鎮,36913,37857,38299,37899,38014,38742,38754,38541,77428.74,83779.24,87524.1,77355.04,81110.76,94758.55,102901.66,96416.64,"109Y11M" +10009,雲林縣,10009050,土庫鎮,19080,17728,17793,17834,19621,19533,19270,19442,38650.7,35759.18,37297.13,35062.65,36901,43501.72,44123.55,36030.27,"109Y11M" +10009,雲林縣,10009060,北港鎮,29483,29985,29783,29892,30353,30801,30138,30433,52827.07,57288.25,57586.3,50297.56,53033.13,72757.71,70317.17,56297.09,"109Y11M" +10009,雲林縣,10009070,古坑鄉,22912,22114,21794,21914,23981,26985,27437,26613,42476.74,45945.09,49994.84,37959,54148.31,77361.46,89654.84,56724.79,"109Y11M" +10009,雲林縣,10009080,大埤鄉,12830,11281,11373,11299,13267,12834,12841,12936,22706.14,21862.41,23426.18,20550.19,24396.7,27949.71,30180.86,25597.2,"109Y11M" +10009,雲林縣,10009090,莿桐鄉,22733,19663,19718,19680,23571,23229,22843,23234,42543.88,37418.42,39341.77,38440.62,41981.06,44910.28,46995.9,40285.02,"109Y11M" +10009,雲林縣,10009100,林內鄉,12165,11388,11156,11264,12734,12648,12409,12559,24874.31,23498.38,26729.07,22623.43,27341.22,33005.42,37917.41,30373.24,"109Y11M" +10009,雲林縣,10009110,二崙鄉,17441,15777,15615,15681,18086,17907,17507,17866,31174.79,28354.02,29428.51,26809.99,30615.56,31709.37,32841.06,27225.19,"109Y11M" +10009,雲林縣,10009120,崙背鄉,19631,16940,17403,17200,20174,20067,20149,20196,37205.81,32063.36,33794.78,32566.35,35774.04,40149.23,41293.9,31838.19,"109Y11M" +10009,雲林縣,10009130,麥寮鄉,41041,55678,54058,55120,37549,38441,37843,38542,108156.69,93232.34,98883.5,80113.12,67969.02,71350.19,72671.58,59546.63,"109Y11M" +10009,雲林縣,10009140,東勢鄉,9125,8258,8310,8292,9563,9584,9544,9584,14800.13,13589.61,14311.89,12952.26,15154.94,18008.15,18278.72,13751,"109Y11M" +10009,雲林縣,10009150,褒忠鄉,8772,8808,8731,8776,9171,9329,9061,9207,19564.63,18024.56,18892.06,17035.64,18984.24,22850.21,23357.11,17359.04,"109Y11M" +10009,雲林縣,10009160,臺西鄉,13845,11951,12264,12022,14706,14823,15174,14873,22800.3,21441.29,22284.99,19663.13,25172.49,32335.84,33070.55,25031.7,"109Y11M" +10009,雲林縣,10009170,元長鄉,15723,14653,14852,14747,16487,16456,16330,16420,30296.38,28503.2,29902.64,26086.26,30297.93,35475.24,37063.17,28559.22,"109Y11M" +10009,雲林縣,10009180,四湖鄉,12208,11753,11677,11743,12976,13367,13136,13174,18912.96,18572.86,18976.61,15524.1,20807.09,26565.89,26067.76,18058.64,"109Y11M" +10009,雲林縣,10009190,口湖鄉,14030,13128,13351,13208,14934,15580,15746,15477,21575.32,22274.67,22922.14,18787.48,24503.09,31723.79,33076.08,22623.88,"109Y11M" +10009,雲林縣,10009200,水林鄉,13238,11975,12189,12077,13868,13668,13900,13775,18368.24,18106.27,18608.89,15914.28,18989.91,22082.52,22274.91,17301.48,"109Y11M" +10010,嘉義縣,10010010,太保市,38110,38942,38587,38858,39244,38864,38123,38394,73610.37,73125.58,76033.64,66885.87,69919.88,82525.25,88775.14,73051.16,"109Y11M" +10010,嘉義縣,10010020,朴子市,38836,41493,41657,41343,39468,40667,40285,40439,64522.98,68939.39,68929.75,59184.59,59550.42,73009.51,71524.06,61162.27,"109Y11M" +10010,嘉義縣,10010030,布袋鎮,14488,13586,13687,13569,15735,16682,16800,16399,22193.47,24217.42,24733.41,19079.4,25703.18,38377.96,40615.95,24600.67,"109Y11M" +10010,嘉義縣,10010040,大林鎮,36020,40120,40086,40188,33494,33118,33098,33159,65942.86,70678.01,71582.1,59942.35,59215.93,68092.53,72230.98,62073.55,"109Y11M" +10010,嘉義縣,10010050,民雄鄉,85278,88037,86861,87730,84076,83149,81774,82990,152774.09,158171.18,162159.99,145458.49,136210.94,168725,177423.9,150938.76,"109Y11M" +10010,嘉義縣,10010060,溪口鄉,9580,8326,8360,8321,9988,9856,9830,9779,15115.46,14543.79,15372.47,13913.61,16341.98,18498.12,19529.61,16499.65,"109Y11M" +10010,嘉義縣,10010070,新港鄉,23844,24804,24310,24500,24925,25532,25399,25478,44232.13,43207.07,45294.72,36704.98,43064.31,50922.21,52717.41,39396.27,"109Y11M" +10010,嘉義縣,10010080,六腳鄉,14456,12740,12723,12764,15387,15349,15756,15474,21816.88,20601.21,21494.35,18672.76,23164.97,28059.49,29563.15,21725.68,"109Y11M" +10010,嘉義縣,10010090,東石鄉,13970,13589,13956,13754,15210,16270,16931,16305,22042.02,24778.93,25660.19,19410.11,25595.1,42507.49,43474.49,25880.43,"109Y11M" +10010,嘉義縣,10010100,義竹鄉,12960,12945,12860,12872,13595,14077,14116,14059,19468.67,18900.36,19535.41,15528.25,19655.62,22197.91,22409.09,16586.41,"109Y11M" +10010,嘉義縣,10010110,鹿草鄉,8739,9341,9318,9329,9217,9543,9582,9509,15518.06,16078.49,17021.49,13639.89,15822,19258.35,21109.44,16427.26,"109Y11M" +10010,嘉義縣,10010120,水上鄉,47081,42072,41945,42051,48022,46367,45842,46461,82140.52,76893.12,82212.27,73379.18,81134.81,93079.14,101304.66,86213.68,"109Y11M" +10010,嘉義縣,10010130,中埔鄉,37868,32114,32149,32165,39660,38599,38801,38688,53006.7,50157.98,52510.2,47414.29,59751.7,74399.37,76652.2,60238.27,"109Y11M" +10010,嘉義縣,10010140,竹崎鄉,26388,23900,24101,23951,28572,29639,29829,29379,33812.74,34125.92,35250.47,27872.1,38738.3,52281.71,52640.5,33808.98,"109Y11M" +10010,嘉義縣,10010150,梅山鄉,14676,14429,14335,14230,16392,18507,18671,17867,20660.02,23644.83,23083.98,16704.42,26009.28,42627.8,40461.83,22866.51,"109Y11M" +10010,嘉義縣,10010160,番路鄉,9796,9888,9971,9885,11637,13805,14254,13262,15572.59,18394.09,20285.83,13010.68,23882.48,38215.02,44080.38,21862.35,"109Y11M" +10010,嘉義縣,10010170,大埔鄉,1831,2058,2129,2092,2083,2550,2606,2533,2381.35,3142.23,3222.14,1813.57,3055.16,5889.2,5595.84,2342.25,"109Y11M" +10010,嘉義縣,10010180,阿里山鄉,6594,6917,6983,6842,8514,11981,11707,11043,9704.39,13983.83,13094.29,7104.86,16113.14,32191.42,28818.7,11925.76,"109Y11M" +10013,屏東縣,10013010,屏東市,184073,187795,189072,188171,184400,184521,184690,184995,393193.73,414674.08,423734.62,422535.34,339150.66,439074.56,437667.04,410462.65,"109Y11M" +10013,屏東縣,10013020,潮州鎮,46420,42370,42794,42442,47508,46892,46815,46942,91969.93,94172.26,97666.51,98004.97,87195.68,112561.91,115925.31,101295.4,"109Y11M" +10013,屏東縣,10013030,東港鎮,37331,37832,38394,38059,39229,39290,39505,39082,77089.9,85759.97,88243.14,81238.87,73103.03,101191.68,103842.71,92241.75,"109Y11M" +10013,屏東縣,10013040,恆春鎮,34586,33750,33253,33514,38266,37417,36080,35766,62436.19,70532.61,71528.43,60721.85,70588.64,102108.13,101623.31,80873.95,"109Y11M" +10013,屏東縣,10013050,萬丹鄉,40743,34058,34673,34240,42103,41144,40765,41013,86121.47,73829.58,80402.59,83260.78,77805.33,88051.38,92291.22,83654.98,"109Y11M" +10013,屏東縣,10013060,長治鄉,31228,29054,29040,29110,31789,31314,30772,31312,59399.94,53341.09,56865.96,53543.79,53204.93,59688.67,62088.27,53086.88,"109Y11M" +10013,屏東縣,10013070,麟洛鄉,9330,8782,8608,8702,9665,10284,10048,10205,19074.57,18027.96,19639.52,17679.75,17589.7,21144.13,22143.88,18061.19,"109Y11M" +10013,屏東縣,10013080,九如鄉,17914,15960,16053,15902,18591,18306,18127,18184,39833.99,35711.99,39328.77,37613.5,37519.94,42889.47,46667.97,42459.92,"109Y11M" +10013,屏東縣,10013090,里港鄉,19581,19307,19220,19144,20571,21484,21304,21356,42745.01,41556.72,42804.63,37626.9,41060.64,50103.52,51556.98,42485.08,"109Y11M" +10013,屏東縣,10013100,鹽埔鄉,23304,22495,22459,22514,23452,23655,23996,23949,42600.24,39470.36,41911.91,36734.68,37886.68,41266.44,43554.04,35829.41,"109Y11M" +10013,屏東縣,10013110,高樹鄉,16245,15760,15714,15625,17391,18405,18556,18315,29373.18,28356.36,30047.96,24006.1,30238.03,35869.57,36924.61,26333.19,"109Y11M" +10013,屏東縣,10013120,萬巒鄉,16607,15294,15452,15344,16390,16629,16836,16721,26963.32,25716.57,26622.16,23679.13,25992.56,33963.78,34547.5,25306.19,"109Y11M" +10013,屏東縣,10013130,內埔鄉,60923,61096,60955,61204,61114,61552,62208,61797,108359.91,111669.07,114169.91,102378.63,95765.07,118521.74,121806.48,100784.29,"109Y11M" +10013,屏東縣,10013140,竹田鄉,13077,12004,12024,11994,13694,13836,13854,13810,29887.19,26852.21,30037.55,27824.14,28003.72,34202.84,37745.36,32032.43,"109Y11M" +10013,屏東縣,10013150,新埤鄉,7974,7620,7757,7675,8465,8777,8811,8795,16346.84,15720.81,16981.71,13268.3,15907.8,19267.3,20997.19,15491.9,"109Y11M" +10013,屏東縣,10013160,枋寮鄉,19311,21181,21151,21076,19714,20237,20345,20126,40041.78,44409.06,45561.08,37538.43,39623.27,51448.13,55289.41,45794.52,"109Y11M" +10013,屏東縣,10013170,新園鄉,27957,23963,24300,23992,29274,28551,28610,28716,49970.36,44570.67,48046.97,46604.36,47462.27,54271.92,57346.2,49305.98,"109Y11M" +10013,屏東縣,10013180,崁頂鄉,8193,7452,7560,7547,8516,8476,8622,8503,15802.61,14289,15422.78,14206.86,14574.39,17301.05,18444.78,15293.46,"109Y11M" +10013,屏東縣,10013190,林邊鄉,9401,7982,8018,7861,9749,9593,9625,9492,15461.26,15089.12,15825.76,15135.81,16035.28,19158.05,20327.25,17232.82,"109Y11M" +10013,屏東縣,10013200,南州鄉,7676,6925,6799,6865,7973,8224,8193,8166,17555.42,16759.85,18192.46,16315.72,17718.41,21971.14,24506,19630.8,"109Y11M" +10013,屏東縣,10013210,佳冬鄉,12671,12466,12296,12379,13398,13638,13747,13587,25039.64,25489.02,27748.22,21480.67,24421.41,29309.45,31662.62,25166.82,"109Y11M" +10013,屏東縣,10013220,琉球鄉,7828,7554,7629,7597,9391,9511,9786,9310,10204.31,13878.32,12934.07,9392.26,15363.47,25885.55,23215.77,14666.09,"109Y11M" +10013,屏東縣,10013230,車城鄉,6322,6407,6432,6328,6935,7605,8628,7504,12433.3,17151.34,17659.5,12193.79,13955.11,30519.29,32794.69,19541.33,"109Y11M" +10013,屏東縣,10013240,滿州鄉,4866,4098,4094,4212,4957,4813,4792,4914,6178.32,5712.78,5969.71,4854.54,6504.07,8251.31,8088.11,5378.06,"109Y11M" +10013,屏東縣,10013250,枋山鄉,4309,4432,4422,4391,4211,4409,4529,4313,11105.38,17570.18,18166.23,11997.47,14688.3,29270.77,33802.81,21828.34,"109Y11M" +10013,屏東縣,10013260,三地門鄉,4208,4114,4083,4114,4719,5455,5581,5403,6294.03,6924.01,7153.44,5057.96,7176.45,12259.25,12221.35,6965.85,"109Y11M" +10013,屏東縣,10013270,霧臺鄉,501,645,633,635,578,957,982,941,623.38,944.53,888.04,457.58,906.89,2077.21,1896.73,690.3,"109Y11M" +10013,屏東縣,10013280,瑪家鄉,2438,2243,2322,2322,2737,3468,3308,3248,3202.95,3362.74,3393.17,2550.75,3856.62,6677.44,6366.09,3420.66,"109Y11M" +10013,屏東縣,10013290,泰武鄉,2287,1989,2040,2009,2709,2957,3099,3001,2867.66,2825.02,2909.18,2346.72,3825.84,5192.84,5213.22,3157.02,"109Y11M" +10013,屏東縣,10013300,來義鄉,3373,3201,3270,3225,3610,3819,3811,3780,4766.18,4610.43,4737.82,3752.15,5003.78,5915.12,6063.33,4151.99,"109Y11M" +10013,屏東縣,10013310,春日鄉,2488,2278,2323,2278,2762,2976,2871,2923,4514.1,4584.1,4852.93,3930.02,5345.45,6542.14,6943.91,5061.42,"109Y11M" +10013,屏東縣,10013320,獅子鄉,2838,3255,3111,3155,3378,4052,3852,3829,6333.03,10684.16,11079.08,6765.01,9378.25,17721.1,20497.59,12610.26,"109Y11M" +10013,屏東縣,10013330,牡丹鄉,3387,3324,3291,3380,3245,3320,3353,3371,3660.97,4125.73,4193.01,2840.38,3681.04,5239.05,5833.08,3101.54,"109Y11M" +10014,臺東縣,10014010,臺東市,111730,110684,110409,110320,113607,111807,110415,110758,178862.57,194299.39,196993.52,176926.97,176713.44,212768.03,211633.46,184815.52,"109Y11M" +10014,臺東縣,10014020,成功鎮,8209,8215,8297,8212,8619,8845,8891,8784,11160.62,14857.79,14781.02,9410.56,12061.54,19453.46,18756.31,10629.46,"109Y11M" +10014,臺東縣,10014030,關山鎮,6590,6993,6947,6983,6945,6967,6908,6898,9171.87,10961.5,11056.03,7900.94,9547.29,12660.18,12468.37,8526.28,"109Y11M" +10014,臺東縣,10014040,卑南鄉,16481,15281,15297,15273,17638,16688,16601,16346,25949.05,26698.68,27562.77,22185.86,27408.07,32686.96,33710.48,25690.34,"109Y11M" +10014,臺東縣,10014050,鹿野鄉,5720,5572,5683,5580,6297,6232,6293,6197,9244.27,11242.81,11430.41,7871.16,10613.27,14747.63,14981.38,9548.38,"109Y11M" +10014,臺東縣,10014060,池上鄉,6569,6454,6502,6398,7247,7299,7364,7183,9713.85,12737.83,13008.97,8617.66,11191.06,16317.02,17104.05,10162.5,"109Y11M" +10014,臺東縣,10014070,東河鄉,5726,5897,5843,5887,6100,6405,6478,6353,7962.45,9962.88,10386.14,6643.14,8881.58,13752.25,13807.41,7868.28,"109Y11M" +10014,臺東縣,10014080,長濱鄉,3975,4036,4053,4041,4233,4276,4311,4293,4899.63,7074.34,7333.21,4185.28,5958.49,8893.28,9324.55,4903.3,"109Y11M" +10014,臺東縣,10014090,太麻里鄉,8218,8501,8372,8397,8624,9367,9388,9220,12805.45,19269.96,19473.98,12563.74,14625.64,27009.6,27748.62,16114.34,"109Y11M" +10014,臺東縣,10014100,大武鄉,3056,3169,3139,3163,3196,3350,3308,3297,5045.78,7777.69,7816.53,5072.13,6106.7,10703.49,11343.31,6996.16,"109Y11M" +10014,臺東縣,10014110,綠島鄉,4303,4233,4288,4277,3919,3802,3937,3882,2873.99,3252.85,3192.11,2404.32,3295.88,3797.92,3665.65,2720.35,"109Y11M" +10014,臺東縣,10014120,海端鄉,2047,1942,1954,1958,2160,2349,2336,2318,2292.61,2379.59,2322.17,1702.9,2620.28,2982.48,2895.43,1964.99,"109Y11M" +10014,臺東縣,10014130,延平鄉,1912,1958,1961,1979,1993,2311,2089,2132,2512.47,3199.87,2902.52,1968.02,2833.34,4561.89,3545.9,2280.86,"109Y11M" +10014,臺東縣,10014140,金峰鄉,1597,1475,1491,1468,1808,1895,1868,1895,1965.33,2224.49,2177.04,1588.43,2496.28,3099.81,2975.23,2008.3,"109Y11M" +10014,臺東縣,10014150,達仁鄉,1994,1993,2067,2035,2123,2285,2249,2268,2970.48,4733.64,4873.05,3086.54,4013.21,6732.18,7456.42,4535.63,"109Y11M" +10014,臺東縣,10014160,蘭嶼鄉,3961,3791,3762,4033,3405,3411,3345,3511,2103.49,2181.87,2152.9,1631.86,2204.41,2324.19,2329.67,1694.03,"109Y11M" +10015,花蓮縣,10015010,花蓮市,111406,122253,122652,122074,115642,116485,117211,115574,209532.77,236082.34,238423.82,221785.33,197806.27,250350.96,244553.27,230928.98,"109Y11M" +10015,花蓮縣,10015020,鳳林鎮,8426,8676,8502,8498,8950,8976,9025,8824,13426.73,16440.56,16674.65,11233.07,13869.52,20425.86,20613.94,13587.01,"109Y11M" +10015,花蓮縣,10015030,玉里鎮,18418,18680,18568,18640,18625,18480,18500,18387,26635.07,29793.09,30410.09,23065.03,25956.03,31350.1,31955.52,24280.48,"109Y11M" +10015,花蓮縣,10015040,新城鄉,24747,24747,24550,24630,24599,24531,24169,24346,42311.51,47710.44,47970.66,37614.28,41224.4,56801.11,55226.47,38097.66,"109Y11M" +10015,花蓮縣,10015050,吉安鄉,88054,71777,71470,71447,90679,82503,81715,82289,136641.2,128228.26,133008.63,126646.45,138000.99,148507.96,154352.73,132381.72,"109Y11M" +10015,花蓮縣,10015060,壽豐鄉,25630,26568,26690,26606,26997,28306,28639,28145,39246.08,48079.78,48467.44,35899.07,41237.07,60052.85,60335.56,40150.73,"109Y11M" +10015,花蓮縣,10015070,光復鄉,8367,8410,8527,8461,8850,9140,9153,9064,13697.85,16385.2,16850.65,11356.92,14307.67,20245.02,20217.67,13400.22,"109Y11M" +10015,花蓮縣,10015080,豐濱鄉,2814,2977,2982,2961,2905,3241,3277,3207,3649.26,7224.87,8158.67,3502.75,4928.2,10514.53,11459.07,4576.6,"109Y11M" +10015,花蓮縣,10015090,瑞穗鄉,9190,8941,9100,8945,9839,10048,10150,9987,14333.57,17358.42,17804.13,12834.45,15792.38,21315.37,21742.32,15552.93,"109Y11M" +10015,花蓮縣,10015100,富里鄉,6196,6232,6264,6215,6608,6734,6859,6725,9154.63,11185.94,11852.45,7839.52,9786.66,13544.79,14400.34,9199.57,"109Y11M" +10015,花蓮縣,10015110,秀林鄉,13005,14885,15090,14843,13859,18171,17691,17156,22846.22,36303.87,36184.02,20257.64,30359.59,50755.48,50527.22,26560.35,"109Y11M" +10015,花蓮縣,10015120,萬榮鄉,1651,1549,1548,1551,1808,1909,1898,1846,2057.29,1979.37,2062.5,1599.85,2358.1,2547.77,2593.55,1903.86,"109Y11M" +10015,花蓮縣,10015130,卓溪鄉,2745,2546,2619,2541,2894,3049,3049,3016,3161.69,3517.9,3669.41,2607.2,3400.19,4213.44,4378.72,3032.68,"109Y11M" +10016,澎湖縣,10016010,馬公市,49763,48927,49392,49128,50227,49251,49791,49250,83957.77,91106.73,92671.08,82398.56,77456.78,91034.32,89488.37,78524.2,"109Y11M" +10016,澎湖縣,10016020,湖西鄉,9795,9359,9429,9623,9605,9592,9624,9741,14320.45,14265.48,14772.76,12014.59,13312.7,14869.1,15225.08,11726.56,"109Y11M" +10016,澎湖縣,10016030,白沙鄉,3835,3491,3596,3595,3913,3897,3885,3893,4884.31,5171.92,5269.55,3980.58,4822.85,6128.58,5939.71,4057.72,"109Y11M" +10016,澎湖縣,10016040,西嶼鄉,3252,3005,3068,3053,3272,3223,3235,3185,4394.52,5251.88,5218.26,3572.19,4652.95,6135.3,6030.1,3595.98,"109Y11M" +10016,澎湖縣,10016050,望安鄉,1835,1740,1752,1769,1216,1185,1180,1196,1146.89,1268.58,1268.18,895.73,1003.22,1120.67,1126.66,814.37,"109Y11M" +10016,澎湖縣,10016060,七美鄉,2068,1723,1843,1980,1776,1656,1709,1778,1598.57,1723.6,1656.7,1305.47,1523.91,1714.41,1672.74,1278.43,"109Y11M" +10017,基隆市,10017010,中正區,54134,52005,51290,51669,54414,54369,54843,54207,91101.55,96170.51,97134.89,86208.56,82550.82,112066.6,113976.11,88764.48,"109Y11M" +10017,基隆市,10017020,七堵區,56104,48233,46926,47464,56202,53746,51809,53290,125681.05,94789.72,98222.61,104277.58,99216.01,113033.21,116723.34,105173.75,"109Y11M" +10017,基隆市,10017030,暖暖區,35297,25534,24654,24994,36300,34087,32500,33690,58530.04,43642.85,45532.94,49309.26,55513.5,59961.25,61766.47,54080.79,"109Y11M" +10017,基隆市,10017040,仁愛區,33694,31974,34879,33091,34605,35108,38330,35980,77266.9,94754.01,98408.75,103492.71,69349.36,114085.87,121690.18,111424.36,"109Y11M" +10017,基隆市,10017050,中山區,41269,34193,32750,33381,41233,40179,39004,39854,71050.84,61246,61286.73,60064.28,63842.09,71917.65,71066.88,60882.49,"109Y11M" +10017,基隆市,10017060,安樂區,82099,62445,59225,60714,83616,78478,74001,77373,130843.19,104046.03,103909.85,109188.08,122626.84,136866.56,132954.41,113239.98,"109Y11M" +10017,基隆市,10017070,信義區,53224,43518,41668,42422,54234,52536,50379,51870,83089.93,73922.31,73921.62,73634.23,77218.06,88656.8,84947.09,73564.02,"109Y11M" +10018,新竹市,10018010,東區,308608,369928,377445,374143,297685,310079,329342,316100,604051.78,657105.03,651126.76,608995.97,466055.48,634632.84,647499.56,557136.05,"109Y11M" +10018,新竹市,10018020,北區,150170,120704,118922,119171,152068,146393,143872,145621,242644.24,227203.55,231204.31,244984.18,230890.68,284053.71,287488.35,255588.9,"109Y11M" +10018,新竹市,10018030,香山區,90823,79836,78815,79102,90625,87262,84676,86431,150591.72,129483.27,134927.47,131967.11,137191.25,149644.48,161913.41,143192.8,"109Y11M" +10020,嘉義市,10020010,東區,117321,124303,122848,123976,117859,116698,113382,115092,225197.52,239615.93,245012.65,225507.12,197021.04,255401.5,257149.43,225957.31,"109Y11M" +10020,嘉義市,10020020,西區,140209,132013,134448,133084,144279,138856,138053,138793,252401.77,273624.38,282889.83,287659.78,245627.89,313428.08,321310.62,308923.17,"109Y11M" +09020,金門縣,09020010,金城鎮,28733,29458,29494,29406,29249,28731,29131,28718,38198.82,41576.23,41164.96,35049.38,37983.76,43143.34,42654.83,35716.79,"109Y11M" +09020,金門縣,09020020,金沙鎮,12972,11472,11415,11515,13229,12591,12311,12438,14137.68,13679.89,13749.99,11080.9,15182.21,15457.37,15262.19,11618.12,"109Y11M" +09020,金門縣,09020030,金湖鎮,25459,26831,26914,26901,25522,25941,25899,25786,32754.02,34292.13,35732.14,26673.87,31365.14,34645.96,35700.89,27049.44,"109Y11M" +09020,金門縣,09020040,金寧鄉,27600,25413,25512,25424,28005,26771,26735,26762,31643.44,31848.13,31775.4,26878.52,31828,33536.99,33729.3,26967.36,"109Y11M" +09020,金門縣,09020050,烈嶼鄉,3366,3221,3206,3231,3447,3227,3284,3279,3776.55,4425.14,4144.29,2974.16,3916.72,5026.33,4671.12,3188.47,"109Y11M" +09020,金門縣,09020060,烏坵鄉,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"109Y11M" +09007,連江縣,09007010,南竿鄉,7040,6853,6839,6834,7246,6784,6945,6825,7588.81,7801.12,7821.19,5932.6,7791.09,7943.34,8015.98,6079.16,"109Y11M" +09007,連江縣,09007020,北竿鄉,2056,1700,1722,1718,2202,1769,1796,1746,1955.72,2085.21,2061.54,1565.71,2016.06,2266.35,2254.97,1680.78,"109Y11M" +09007,連江縣,09007030,莒光鄉,1128,1038,1069,1052,1113,990,1062,1032,993.21,1051.25,1058.46,864.78,979.91,1032.73,1056.97,897.53,"109Y11M" +09007,連江縣,09007040,東引鄉,2287,2151,2216,2158,2259,2166,2254,2220,2213.03,2214.72,2171.47,1708.31,2196.96,2228.56,2230.7,1732.31,"109Y11M" diff --git a/The attainments and realizations of my dreams/2020_November_daily_mobile_user_distribution_by_county.csv b/The attainments and realizations of my dreams/2020_November_daily_mobile_user_distribution_by_county.csv new file mode 100644 index 00000000..64026b7a --- /dev/null +++ b/The attainments and realizations of my dreams/2020_November_daily_mobile_user_distribution_by_county.csv @@ -0,0 +1,24 @@ +COUNTY_ID,COUNTY,NIGHT_WORK,DAY_WORK(7:00~13:00),DAY_WORK(13:00~19:00),DAY_WORK,NIGHT_WEEKEND,DAY_WEEKEND(7:00~13:00),DAY_WEEKEND(13:00~19:00),DAY_WEEKEND,MORNING_WORK,MIDDAY_WORK,AFTERNOON_WORK,EVENING_WORK,MORNING_WEEKEND,MIDDAY_WEEKEND,AFTERNOON_WEEKEND,EVENING_WEEKEND,INFO_TIME +縣市代碼,縣市名稱,平日夜間停留人數,平日上午活動人數,平日下午活動人數,平日日間活動人數,假日夜間停留人數,假日上午活動人數,假日下午活動人數,假日日間活動人數,平日早晨旅次,平日中午旅次,平日午後旅次,平日晚上旅次,假日早晨旅次,假日中午旅次,假日午後旅次,假日晚上旅次,資料時間 +65000,新北市,4404882,3828955,3708033,3760027,4389998,4233496,4087167,4193773,10284511.41,8918287.6,9006483.28,9804692.81,8766501.62,10318260.43,10212998.84,9418215.79,"109Y11M" +63000,臺北市,2789958,3424948,3563844,3508241,2747668,2886879,3067448,2953925,7109127.81,8432508.36,8432755.71,8118225.21,5280778.32,7698035.05,7920404.09,6840720.14,"109Y11M" +68000,桃園市,2526697,2538817,2534858,2536854,2459045,2457750,2469675,2466701,5378615.6,5081505.82,5189705.13,5168944.95,4494943.06,5532910.8,5620730.37,5024045.69,"109Y11M" +66000,臺中市,3083970,3097381,3092610,3097786,3052863,3034869,3022051,3033950,6764050.31,6647991.06,6781947.04,6870578.9,5799132.24,7181235.71,7356663.43,6679511.57,"109Y11M" +67000,臺南市,1835928,1849314,1846605,1846887,1839022,1843679,1832836,1837561,3963064.59,3910969.02,4008063.88,3956241.29,3464568,4344466.5,4449459.65,3981201.53,"109Y11M" +64000,高雄市,2576693,2574896,2572996,2573879,2575650,2561834,2564244,2563361,5751041.86,5679883.06,5873371.46,5775527.53,4878469.83,5954713.26,6098213.63,5570972.78,"109Y11M" +10002,宜蘭縣,441203,429801,431568,429706,468078,470963,469260,465119,820612.54,884594.62,918124.02,792285.82,846875.65,1117919.27,1134634.42,893794.67,"109Y11M" +10004,新竹縣,656007,672505,667973,669470,658522,667690,659887,664304,1212645.85,1173657.34,1191427.45,1107531.23,1124406.72,1335534.07,1371502.21,1181676.04,"109Y11M" +10005,苗栗縣,505463,487130,485434,485570,519930,528448,520549,522946,934112.83,912872.42,951256.49,872506.02,968899.18,1194737.98,1264425.33,1056933.96,"109Y11M" +10007,彰化縣,1068303,1049600,1050004,1049606,1091186,1096873,1092149,1097891,2203943.54,2110569.6,2166761.19,2110485.15,2018196.98,2448868.57,2522773.25,2181056.12,"109Y11M" +10008,南投縣,426734,432678,430430,430064,454395,477733,476173,471206,776405.17,840887.51,855041.58,717360.5,828731.05,1145664.25,1173022.88,877683.77,"109Y11M" +10009,雲林縣,565293,570400,570334,570360,570283,573148,570827,572544,1105479.99,1106259.66,1150228.23,1042132.5,1037810.92,1271014.2,1322802.2,1101577.55,"109Y11M" +10010,嘉義縣,440515,435301,434018,434444,455221,464554,463403,461220,734515.31,753583.43,777476.7,655719.38,742929.19,950857.48,988927.35,747599.91,"109Y11M" +10013,屏東縣,689391,666686,669243,667004,710484,715567,716100,713366,1361450.11,1388371.68,1444718.81,1337537.22,1280532.7,1648915.92,1699894.79,1433396.47,"109Y11M" +10014,臺東縣,192086,190194,190066,190005,197914,197291,195779,195333,289533.92,332855.19,337462.37,273759.51,300570.48,392490.39,393746.24,300458.73,"109Y11M" +10015,花蓮縣,320650,318241,318562,317411,332256,331573,331336,328566,536693.87,600290.03,611537.14,516241.56,539027.08,690625.25,692356.39,553652.8,"109Y11M" +10016,澎湖縣,70549,68245,69080,69149,70009,68804,69423,69043,110302.5,118788.19,120856.52,104167.11,102772.41,121002.38,119482.67,99997.27,"109Y11M" +10017,基隆市,355821,297902,291392,293735,360605,348503,340866,346262,637563.49,568571.44,578417.38,586174.69,570316.67,696587.93,703124.49,607129.88,"109Y11M" +10018,新竹市,549601,570467,575181,572417,540378,543734,557890,548152,997287.73,1013791.85,1017258.54,985947.27,834137.4,1068331.03,1096901.32,955917.76,"109Y11M" +10020,嘉義市,257530,256316,257297,257060,262138,255554,251435,253886,477599.29,513240.31,527902.47,513166.9,442648.94,568829.58,578460.05,534880.48,"109Y11M" +09020,金門縣,98129,96394,96541,96478,99452,97261,97359,96983,120510.5,125821.51,126566.79,102614.41,120275.83,131809.99,132018.33,104540.19,"109Y11M" +09007,連江縣,12511,11742,11846,11762,12821,11708,12057,11823,12750.77,13152.3,13112.66,10067.09,12984.01,13470.99,13558.62,10389.78,"109Y11M" diff --git a/The attainments and realizations of my dreams/2020_regional_daily_mobile_user_basic_statistics.py b/The attainments and realizations of my dreams/2020_regional_daily_mobile_user_basic_statistics.py new file mode 100644 index 00000000..58023f1b --- /dev/null +++ b/The attainments and realizations of my dreams/2020_regional_daily_mobile_user_basic_statistics.py @@ -0,0 +1,8 @@ +import pandas as pd + +dataframe = pd.read_csv('2020_Nov_daily_mobile_user_distribution_by_county_.csv', header=0, + index_col=["COUNTY"]) +print(dataframe) + +total = dataframe["NIGHT_WORK"].sum() +print(total) diff --git a/The attainments and realizations of my dreams/2020_translated.py b/The attainments and realizations of my dreams/2020_translated.py new file mode 100644 index 00000000..ac5feb2d --- /dev/null +++ b/The attainments and realizations of my dreams/2020_translated.py @@ -0,0 +1,17 @@ +import pandas as pd +import matplotlib.pyplot as plt + +distribution = pd.read_csv('2020_translated_Nov_daily_mobile_user_distribution_by_county_.csv', + index_col=0) + +print(distribution.head()) +print(30*'=') +print(distribution.info()) +print(30*'=') +print(distribution["INFO_TIME"].value_counts()) +print(30*'=') +print(distribution.describe()) +print(30*'=') +print(distribution.hist(bins=50, figsize=(20, 15))) +plt.savefig('2020_translated_histogram') +plt.show() diff --git a/The attainments and realizations of my dreams/2020_translated_2.py b/The attainments and realizations of my dreams/2020_translated_2.py new file mode 100644 index 00000000..eaaaf4e2 --- /dev/null +++ b/The attainments and realizations of my dreams/2020_translated_2.py @@ -0,0 +1,9 @@ +import pandas as pd +import matplotlib.pyplot as plt + +distribution = pd.read_csv('2020_translated_Nov_daily_mobile_user_distribution_by_county_.csv', + index_col=0) + +transposed_distribution = distribution.transpose() +print(transposed_distribution) +transposed_distribution.to_csv("2020_transposed_translated_mobile_user_distribution_by_county.csv") diff --git a/The attainments and realizations of my dreams/2020_translated_Nov_daily_mobile_user_distribution_by_county_.csv b/The attainments and realizations of my dreams/2020_translated_Nov_daily_mobile_user_distribution_by_county_.csv new file mode 100644 index 00000000..9a506f57 --- /dev/null +++ b/The attainments and realizations of my dreams/2020_translated_Nov_daily_mobile_user_distribution_by_county_.csv @@ -0,0 +1,23 @@ +,COUNTY,NIGHT_WORK,DAY_WORK(7:00~13:00),DAY_WORK(13:00~19:00),DAY_WORK,NIGHT_WEEKEND,DAY_WEEKEND(7:00~13:00),DAY_WEEKEND(13:00~19:00),DAY_WEEKEND,MORNING_WORK,MIDDAY_WORK,AFTERNOON_WORK,EVENING_WORK,MORNING_WEEKEND,MIDDAY_WEEKEND,AFTERNOON_WEEKEND,EVENING_WEEKEND,INFO_TIME +0,New Taipei City,4404882,3828955,3708033,3760027,4389998,4233496,4087167,4193773,10284511.41,8918287.6,9006483.28,9804692.81,8766501.62,10318260.43,10212998.84,9418215.79,109Y11M +1,Taipei City,2789958,3424948,3563844,3508241,2747668,2886879,3067448,2953925,7109127.81,8432508.36,8432755.71,8118225.21,5280778.32,7698035.05,7920404.09,6840720.14,109Y11M +2,Taoyuan City,2526697,2538817,2534858,2536854,2459045,2457750,2469675,2466701,5378615.6,5081505.82,5189705.13,5168944.95,4494943.06,5532910.8,5620730.37,5024045.69,109Y11M +3,Taichung City,3083970,3097381,3092610,3097786,3052863,3034869,3022051,3033950,6764050.31,6647991.06,6781947.04,6870578.9,5799132.24,7181235.71,7356663.43,6679511.57,109Y11M +4,Tainan City,1835928,1849314,1846605,1846887,1839022,1843679,1832836,1837561,3963064.59,3910969.02,4008063.88,3956241.29,3464568.0,4344466.5,4449459.65,3981201.53,109Y11M +5,Kaohsiung City,2576693,2574896,2572996,2573879,2575650,2561834,2564244,2563361,5751041.86,5679883.06,5873371.46,5775527.53,4878469.83,5954713.26,6098213.63,5570972.78,109Y11M +6,Yilan County,441203,429801,431568,429706,468078,470963,469260,465119,820612.54,884594.62,918124.02,792285.82,846875.65,1117919.27,1134634.42,893794.67,109Y11M +7,Hsinchu County,656007,672505,667973,669470,658522,667690,659887,664304,1212645.85,1173657.34,1191427.45,1107531.23,1124406.72,1335534.07,1371502.21,1181676.04,109Y11M +8,Miaoli County,505463,487130,485434,485570,519930,528448,520549,522946,934112.83,912872.42,951256.49,872506.02,968899.18,1194737.98,1264425.33,1056933.96,109Y11M +9,Changhua County,1068303,1049600,1050004,1049606,1091186,1096873,1092149,1097891,2203943.54,2110569.6,2166761.19,2110485.15,2018196.98,2448868.57,2522773.25,2181056.12,109Y11M +10,Nantou County,426734,432678,430430,430064,454395,477733,476173,471206,776405.17,840887.51,855041.58,717360.5,828731.05,1145664.25,1173022.88,877683.77,109Y11M +11,Yunlin County,565293,570400,570334,570360,570283,573148,570827,572544,1105479.99,1106259.66,1150228.23,1042132.5,1037810.92,1271014.2,1322802.2,1101577.55,109Y11M +12,Chiayi County,440515,435301,434018,434444,455221,464554,463403,461220,734515.31,753583.43,777476.7,655719.38,742929.19,950857.48,988927.35,747599.91,109Y11M +13,Pingtung County,689391,666686,669243,667004,710484,715567,716100,713366,1361450.11,1388371.68,1444718.81,1337537.22,1280532.7,1648915.92,1699894.79,1433396.47,109Y11M +14,Taitung County,192086,190194,190066,190005,197914,197291,195779,195333,289533.92,332855.19,337462.37,273759.51,300570.48,392490.39,393746.24,300458.73,109Y11M +15,Hualien County,320650,318241,318562,317411,332256,331573,331336,328566,536693.87,600290.03,611537.14,516241.56,539027.08,690625.25,692356.39,553652.8,109Y11M +16,Penhu County,70549,68245,69080,69149,70009,68804,69423,69043,110302.5,118788.19,120856.52,104167.11,102772.41,121002.38,119482.67,99997.27,109Y11M +17,Keelung City,355821,297902,291392,293735,360605,348503,340866,346262,637563.49,568571.44,578417.38,586174.69,570316.67,696587.93,703124.49,607129.88,109Y11M +18,Hsinchu City,549601,570467,575181,572417,540378,543734,557890,548152,997287.73,1013791.85,1017258.54,985947.27,834137.4,1068331.03,1096901.32,955917.76,109Y11M +19,Chiayi City,257530,256316,257297,257060,262138,255554,251435,253886,477599.29,513240.31,527902.47,513166.9,442648.94,568829.58,578460.05,534880.48,109Y11M +20,Kinmen County,98129,96394,96541,96478,99452,97261,97359,96983,120510.5,125821.51,126566.79,102614.41,120275.83,131809.99,132018.33,104540.19,109Y11M +21,Lienjian County,12511,11742,11846,11762,12821,11708,12057,11823,12750.77,13152.3,13112.66,10067.09,12984.01,13470.99,13558.62,10389.78,109Y11M \ No newline at end of file diff --git a/The attainments and realizations of my dreams/2020_translated_histogram.png b/The attainments and realizations of my dreams/2020_translated_histogram.png new file mode 100644 index 00000000..35d6c5f7 Binary files /dev/null and b/The attainments and realizations of my dreams/2020_translated_histogram.png differ diff --git a/The attainments and realizations of my dreams/2020_transposed_translated.py b/The attainments and realizations of my dreams/2020_transposed_translated.py new file mode 100644 index 00000000..094497fa --- /dev/null +++ b/The attainments and realizations of my dreams/2020_transposed_translated.py @@ -0,0 +1,11 @@ +import pandas as pd +import matplotlib.pyplot as plt + +distribution = pd.read_csv('2020_transposed_translated_mobile_user_distribution_by_county.csv') +print(distribution) + +distribution2 = pd.read_csv('2020_transposed_translated_mobile_user_distribution_by_county.csv', + index_col=0) +print(distribution2) + + diff --git a/The attainments and realizations of my dreams/2020_transposed_translated2.py b/The attainments and realizations of my dreams/2020_transposed_translated2.py new file mode 100644 index 00000000..9715b7d2 --- /dev/null +++ b/The attainments and realizations of my dreams/2020_transposed_translated2.py @@ -0,0 +1,8 @@ +import pandas as pd +import matplotlib.pyplot as plt + +distribution = pd.read_csv('2020_transposed_translated_mobile_user_distribution_by_county.csv', + index_col=0) +print(distribution) + +print(distribution.info()) diff --git a/The attainments and realizations of my dreams/2020_transposed_translated3.py b/The attainments and realizations of my dreams/2020_transposed_translated3.py new file mode 100644 index 00000000..05877773 --- /dev/null +++ b/The attainments and realizations of my dreams/2020_transposed_translated3.py @@ -0,0 +1,22 @@ +import pandas as pd +import matplotlib.pyplot as plt + +distribution = pd.read_csv('2020_transposed_translated_mobile_user_distribution_by_county.csv', + index_col=0, header=0, skiprows=0) +print(distribution) + +distribution = pd.read_csv('2020_transposed_translated_mobile_user_distribution_by_county.csv', + index_col=0, skiprows=0, header=0) +print(distribution) + +distribution = pd.read_csv('2020_transposed_translated_mobile_user_distribution_by_county.csv', + index_col=0, skiprows=[0], header=0) +print(distribution) + +distribution = pd.read_csv('2020_transposed_translated_mobile_user_distribution_by_county.csv', + index_col=0, header=0, skiprows=[0]) +print(distribution) + +distribution = pd.read_csv('2020_transposed_translated_mobile_user_distribution_by_county.csv', + index_col=0, header=0, skiprows=1) +print(distribution) diff --git a/The attainments and realizations of my dreams/2020_transposed_translated4.py b/The attainments and realizations of my dreams/2020_transposed_translated4.py new file mode 100644 index 00000000..040f2ab5 --- /dev/null +++ b/The attainments and realizations of my dreams/2020_transposed_translated4.py @@ -0,0 +1,11 @@ +import pandas as pd +import matplotlib.pyplot as plt + +distribution = pd.read_csv('2020_transposed_translated_mobile_user_distribution_by_county.csv', + index_col=0, header=0, skiprows=1) + +print(distribution) + +distribution.hist(bins=50, figsize=(20, 15)) +plt.show() + diff --git a/The attainments and realizations of my dreams/2020_transposed_translated5.py b/The attainments and realizations of my dreams/2020_transposed_translated5.py new file mode 100644 index 00000000..5ab07df5 --- /dev/null +++ b/The attainments and realizations of my dreams/2020_transposed_translated5.py @@ -0,0 +1,9 @@ +import pandas as pd +import matplotlib.pyplot as plt + +distribution = pd.read_csv('2020_transposed_translated_mobile_user_distribution_by_county.csv', + index_col=0, header=0, skiprows=1) + +print(distribution) + +distribution.plot() diff --git a/The attainments and realizations of my dreams/2020_transposed_translated6.py b/The attainments and realizations of my dreams/2020_transposed_translated6.py new file mode 100644 index 00000000..54d971fb --- /dev/null +++ b/The attainments and realizations of my dreams/2020_transposed_translated6.py @@ -0,0 +1,9 @@ +import pandas as pd +import matplotlib.pyplot as plt + +distribution = pd.read_csv('2020_transposed_translated_mobile_user_distribution_by_county.csv', + index_col=0, header=0, skiprows=1, skipinitialspace=True, skip_blank_lines=True) + +print(distribution) + +distribution.plot() diff --git a/The attainments and realizations of my dreams/2020_transposed_translated7.py b/The attainments and realizations of my dreams/2020_transposed_translated7.py new file mode 100644 index 00000000..cc49d564 --- /dev/null +++ b/The attainments and realizations of my dreams/2020_transposed_translated7.py @@ -0,0 +1,7 @@ +import pandas as pd +import matplotlib.pyplot as plt + +distribution = pd.read_csv('2020_transposed_translated_mobile_user_distribution_by_county.csv', + index_col=0, header=0, skiprows=1, skipinitialspace=True, skip_blank_lines=True) + +print(distribution) diff --git a/The attainments and realizations of my dreams/2020_transposed_translated_mobile_user_distribution_by_county.csv b/The attainments and realizations of my dreams/2020_transposed_translated_mobile_user_distribution_by_county.csv new file mode 100644 index 00000000..ce1fc1be --- /dev/null +++ b/The attainments and realizations of my dreams/2020_transposed_translated_mobile_user_distribution_by_county.csv @@ -0,0 +1,19 @@ +,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21 +COUNTY,New Taipei City,Taipei City,Taoyuan City,Taichung City,Tainan City,Kaohsiung City,Yilan County,Hsinchu County,Miaoli County,Changhua County,Nantou County,Yunlin County,Chiayi County,Pingtung County,Taitung County,Hualien County,Penhu County,Keelung City,Hsinchu City,Chiayi City,Kinmen County,Lienjian County +NIGHT_WORK,4404882,2789958,2526697,3083970,1835928,2576693,441203,656007,505463,1068303,426734,565293,440515,689391,192086,320650,70549,355821,549601,257530,98129,12511 +DAY_WORK(7:00~13:00),3828955,3424948,2538817,3097381,1849314,2574896,429801,672505,487130,1049600,432678,570400,435301,666686,190194,318241,68245,297902,570467,256316,96394,11742 +DAY_WORK(13:00~19:00),3708033,3563844,2534858,3092610,1846605,2572996,431568,667973,485434,1050004,430430,570334,434018,669243,190066,318562,69080,291392,575181,257297,96541,11846 +DAY_WORK,3760027,3508241,2536854,3097786,1846887,2573879,429706,669470,485570,1049606,430064,570360,434444,667004,190005,317411,69149,293735,572417,257060,96478,11762 +NIGHT_WEEKEND,4389998,2747668,2459045,3052863,1839022,2575650,468078,658522,519930,1091186,454395,570283,455221,710484,197914,332256,70009,360605,540378,262138,99452,12821 +DAY_WEEKEND(7:00~13:00),4233496,2886879,2457750,3034869,1843679,2561834,470963,667690,528448,1096873,477733,573148,464554,715567,197291,331573,68804,348503,543734,255554,97261,11708 +DAY_WEEKEND(13:00~19:00),4087167,3067448,2469675,3022051,1832836,2564244,469260,659887,520549,1092149,476173,570827,463403,716100,195779,331336,69423,340866,557890,251435,97359,12057 +DAY_WEEKEND,4193773,2953925,2466701,3033950,1837561,2563361,465119,664304,522946,1097891,471206,572544,461220,713366,195333,328566,69043,346262,548152,253886,96983,11823 +MORNING_WORK,10284511.41,7109127.81,5378615.6,6764050.31,3963064.59,5751041.86,820612.54,1212645.85,934112.83,2203943.54,776405.17,1105479.99,734515.31,1361450.11,289533.92,536693.87,110302.5,637563.49,997287.73,477599.29,120510.5,12750.77 +MIDDAY_WORK,8918287.6,8432508.36,5081505.82,6647991.06,3910969.02,5679883.06,884594.62,1173657.34,912872.42,2110569.6,840887.51,1106259.66,753583.43,1388371.68,332855.19,600290.03,118788.19,568571.44,1013791.85,513240.31,125821.51,13152.3 +AFTERNOON_WORK,9006483.28,8432755.71,5189705.13,6781947.04,4008063.88,5873371.46,918124.02,1191427.45,951256.49,2166761.19,855041.58,1150228.23,777476.7,1444718.81,337462.37,611537.14,120856.52,578417.38,1017258.54,527902.47,126566.79,13112.66 +EVENING_WORK,9804692.81,8118225.21,5168944.95,6870578.9,3956241.29,5775527.53,792285.82,1107531.23,872506.02,2110485.15,717360.5,1042132.5,655719.38,1337537.22,273759.51,516241.56,104167.11,586174.69,985947.27,513166.9,102614.41,10067.09 +MORNING_WEEKEND,8766501.62,5280778.32,4494943.06,5799132.24,3464568.0,4878469.83,846875.65,1124406.72,968899.18,2018196.98,828731.05,1037810.92,742929.19,1280532.7,300570.48,539027.08,102772.41,570316.67,834137.4,442648.94,120275.83,12984.01 +MIDDAY_WEEKEND,10318260.43,7698035.05,5532910.8,7181235.71,4344466.5,5954713.26,1117919.27,1335534.07,1194737.98,2448868.57,1145664.25,1271014.2,950857.48,1648915.92,392490.39,690625.25,121002.38,696587.93,1068331.03,568829.58,131809.99,13470.99 +AFTERNOON_WEEKEND,10212998.84,7920404.09,5620730.37,7356663.43,4449459.65,6098213.63,1134634.42,1371502.21,1264425.33,2522773.25,1173022.88,1322802.2,988927.35,1699894.79,393746.24,692356.39,119482.67,703124.49,1096901.32,578460.05,132018.33,13558.62 +EVENING_WEEKEND,9418215.79,6840720.14,5024045.69,6679511.57,3981201.53,5570972.78,893794.67,1181676.04,1056933.96,2181056.12,877683.77,1101577.55,747599.91,1433396.47,300458.73,553652.8,99997.27,607129.88,955917.76,534880.48,104540.19,10389.78 +INFO_TIME,109Y11M,109Y11M,109Y11M,109Y11M,109Y11M,109Y11M,109Y11M,109Y11M,109Y11M,109Y11M,109Y11M,109Y11M,109Y11M,109Y11M,109Y11M,109Y11M,109Y11M,109Y11M,109Y11M,109Y11M,109Y11M,109Y11M diff --git a/The attainments and realizations of my dreams/Age ratio by region/2023.py b/The attainments and realizations of my dreams/Age ratio by region/2023.py new file mode 100644 index 00000000..f6e1a213 --- /dev/null +++ b/The attainments and realizations of my dreams/Age ratio by region/2023.py @@ -0,0 +1,57 @@ +import matplotlib.pyplot as plt +import numpy as np + +category_names = ['Strongly disagree', 'Disagree', + 'Neither agree nor disagree', 'Agree', 'Strongly agree'] +results = { + 'Question 1': [10, 15, 17, 32, 26], + 'Question 2': [26, 22, 29, 10, 13], + 'Question 3': [35, 37, 7, 2, 19], + 'Question 4': [32, 11, 9, 15, 33], + 'Question 5': [21, 29, 5, 5, 40], + 'Question 6': [8, 19, 5, 30, 38] +} + + +def survey(results, category_names): + """ + Parameters + ---------- + results : dict + A mapping from question labels to a list of answers per category. + It is assumed all lists contain the same number of entries and that + it matches the length of *category_names*. + category_names : list of str + The category labels. + """ + labels = list(results.keys()) + data = np.array(list(results.values())) + data_cum = data.cumsum(axis=1) + category_colors = plt.colormaps['RdYlGn']( + np.linspace(0.15, 0.85, data.shape[1])) + + fig, ax = plt.subplots(figsize=(9.2, 5)) + ax.invert_yaxis() + ax.xaxis.set_visible(False) + ax.set_xlim(0, np.sum(data, axis=1).max()) + + for i, (colname, color) in enumerate(zip(category_names, category_colors)): + widths = data[:, i] + starts = data_cum[:, i] - widths + rects = ax.barh(labels, widths, left=starts, height=0.5, + label=colname, color=color) + + r, g, b, _ = color + text_color = 'white' if r * g * b < 0.5 else 'darkgrey' + ax.bar_label(rects, label_type='center', color=text_color) + ax.legend(ncols=len(category_names), bbox_to_anchor=(0, 1), + loc='lower left', fontsize='small') + + return fig, ax + + +survey(results, category_names) +plt.show() + +# References: +# 1. https://matplotlib.org/stable/gallery/lines_bars_and_markers/horizontal_barchart_distribution.html#sphx-glr-gallery-lines-bars-and-markers-horizontal-barchart-distribution-py \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Age ratio by region/__init__.py b/The attainments and realizations of my dreams/Age ratio by region/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Annual household income/2021.py b/The attainments and realizations of my dreams/Annual household income/2021.py new file mode 100644 index 00000000..9e4047a6 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual household income/2021.py @@ -0,0 +1,30 @@ +import matplotlib.pyplot as plt + +year = [2015, 2016, 2017, 2018, 2019, 2020, 2021] +income_Kaohsiung = [1145895, 1166824, 1186204, 1219246, 1224268, 1224100, 1231562] +income_Tainan = [1007093, 1063495, 1079199, 1086077, 1079174, 1086475, 1120580] +income_Taichung = [1169183, 1140325, 1245350, 1279865, 1298497, 1289700, 1304508] +income_Taoyuan = [1307158, 1317790, 1337361, 1378732, 1392199, 1424027, 1448909] +income_Taipei = [1581899, 1568945, 1648122, 1649348, 1723021, 1716591, 1732126] +income_New_Taipei = [1171978, 1223867, 1265798, 1292753, 1319841, 1352548, 1381603] +income_Hsinchu_county = [1283995, 1365150, 1616327, 1519478, 1539555, 1619782, 1689337] +income_Hsinchu_city = [1427572, 1537317, 1572296, 1426379, 1602826, 1618903, 1602415] +income_Miaoli_county = [1008241, 1166196, 1029485, 1045881, 1073028, 1161999, 1214424] + +plt.plot(year, income_Taipei, label="Taipei") +plt.plot(year, income_New_Taipei, label="New Taipei") +plt.plot(year, income_Taoyuan, label="Taoyuan") +plt.plot(year, income_Hsinchu_county, label="Hsinchu county") +plt.plot(year, income_Hsinchu_city, label="Hsinchu city") +plt.plot(year, income_Miaoli_county, label="Miaoli") +plt.plot(year, income_Taichung, label="Taichung") +plt.plot(year, income_Tainan, label="Tainan") +plt.plot(year, income_Kaohsiung, label="Kaohsiung", marker='*', ms=12) + +plt.title("Annual household income by region in Taiwan") +plt.legend() +plt.grid(linewidth=0.7) +plt.ylabel("Income (1 million New Taiwan Dollar)") +plt.xlabel("Reference: https://statfy.mol.gov.tw/map02.aspx?cid=64&xFunc=138&xKey=1") + +plt.show() diff --git a/The attainments and realizations of my dreams/Annual household income/2021_6_major_cities.py b/The attainments and realizations of my dreams/Annual household income/2021_6_major_cities.py new file mode 100644 index 00000000..b8565853 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual household income/2021_6_major_cities.py @@ -0,0 +1,41 @@ +import matplotlib.pyplot as plt +import matplotlib.image as image + +year = [2015, 2016, 2017, 2018, 2019, 2020, 2021] +income_Kaohsiung = [1145895, 1166824, 1186204, 1219246, 1224268, 1224100, 1231562] +income_Tainan = [1007093, 1063495, 1079199, 1086077, 1079174, 1086475, 1120580] +income_Taichung = [1169183, 1140325, 1245350, 1279865, 1298497, 1289700, 1304508] +income_Taoyuan = [1307158, 1317790, 1337361, 1378732, 1392199, 1424027, 1448909] +income_Taipei = [1581899, 1568945, 1648122, 1649348, 1723021, 1716591, 1732126] +income_New_Taipei = [1171978, 1223867, 1265798, 1292753, 1319841, 1352548, 1381603] +income_Hsinchu_county = [1283995, 1365150, 1616327, 1519478, 1539555, 1619782, 1689337] +income_Hsinchu_city = [1427572, 1537317, 1572296, 1426379, 1602826, 1618903, 1602415] +# income_Miaoli_county = [1008241, 1166196, 1029485, 1045881, 1073028, 1161999, 1214424] + +fig, ax = plt.subplots(figsize=(9, 9)) + +plt.plot(year, income_Taipei, label="Taipei") +plt.plot(year, income_New_Taipei, label="New Taipei") +plt.plot(year, income_Taoyuan, label="Taoyuan") +plt.plot(year, income_Hsinchu_county, label="Hsinchu county") +plt.plot(year, income_Hsinchu_city, label="Hsinchu city") +# plt.plot(year, income_Miaoli_county, label="Miaoli") +plt.plot(year, income_Taichung, label="Taichung") +plt.plot(year, income_Tainan, label="Tainan") +plt.plot(year, income_Kaohsiung, label="Kaohsiung", marker='*', ms=12) + +plt.title("Annual household income by region in Taiwan") +plt.legend() +plt.grid(linewidth=0.7) +plt.ylabel("Income (1 million New Taiwan Dollar)") +plt.xlabel("Reference: https://statfy.mol.gov.tw/map02.aspx?cid=64&xFunc=138&xKey=1") + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='30', transform=ax.transAxes) + +plt.show() diff --git a/The attainments and realizations of my dreams/Annual household income/2021_watermark.py b/The attainments and realizations of my dreams/Annual household income/2021_watermark.py new file mode 100644 index 00000000..75afb3f0 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual household income/2021_watermark.py @@ -0,0 +1,41 @@ +import matplotlib.pyplot as plt +import matplotlib.image as image + +year = [2015, 2016, 2017, 2018, 2019, 2020, 2021] +income_Kaohsiung = [1145895, 1166824, 1186204, 1219246, 1224268, 1224100, 1231562] +income_Tainan = [1007093, 1063495, 1079199, 1086077, 1079174, 1086475, 1120580] +income_Taichung = [1169183, 1140325, 1245350, 1279865, 1298497, 1289700, 1304508] +income_Taoyuan = [1307158, 1317790, 1337361, 1378732, 1392199, 1424027, 1448909] +income_Taipei = [1581899, 1568945, 1648122, 1649348, 1723021, 1716591, 1732126] +income_New_Taipei = [1171978, 1223867, 1265798, 1292753, 1319841, 1352548, 1381603] +income_Hsinchu_county = [1283995, 1365150, 1616327, 1519478, 1539555, 1619782, 1689337] +income_Hsinchu_city = [1427572, 1537317, 1572296, 1426379, 1602826, 1618903, 1602415] +income_Miaoli_county = [1008241, 1166196, 1029485, 1045881, 1073028, 1161999, 1214424] + +fig, ax = plt.subplots(figsize=(9, 9)) + +plt.plot(year, income_Taipei, label="Taipei") +plt.plot(year, income_New_Taipei, label="New Taipei") +plt.plot(year, income_Taoyuan, label="Taoyuan") +plt.plot(year, income_Hsinchu_county, label="Hsinchu county") +plt.plot(year, income_Hsinchu_city, label="Hsinchu city") +plt.plot(year, income_Miaoli_county, label="Miaoli") +plt.plot(year, income_Taichung, label="Taichung") +plt.plot(year, income_Tainan, label="Tainan") +plt.plot(year, income_Kaohsiung, label="Kaohsiung", marker='*', ms=12) + +plt.title("Annual household income by region in Taiwan") +plt.legend() +plt.grid(linewidth=0.7) +plt.ylabel("Income (1 million New Taiwan Dollar)") +plt.xlabel("Reference: https://statfy.mol.gov.tw/map02.aspx?cid=64&xFunc=138&xKey=1") + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='30', transform=ax.transAxes) + +plt.show() diff --git a/The attainments and realizations of my dreams/Annual household income/Annual_house_hold_income_2020.py b/The attainments and realizations of my dreams/Annual household income/Annual_house_hold_income_2020.py new file mode 100644 index 00000000..92cf342e --- /dev/null +++ b/The attainments and realizations of my dreams/Annual household income/Annual_house_hold_income_2020.py @@ -0,0 +1,30 @@ +import matplotlib.pyplot as plt + +year = [2015, 2016, 2017, 2018, 2019, 2020] +income_Kaohsiung = [1145895, 1166824, 1186204, 1219246, 1224268, 1224100] +income_Tainan = [1007093, 1063495, 1079199, 1086077, 1079174, 1086475] +income_Taichung = [1169183, 1140325, 1245350, 1279865, 1298497, 1289700] +income_Taoyuan = [1307158, 1317790, 1337361, 1378732, 1392199, 1424027] +income_Taipei = [1581899, 1568945, 1648122, 1649348, 1723021, 1716591] +income_New_Taipei = [1171978, 1223867, 1265798, 1292753, 1319841, 1352548] +income_Hsinchu_county = [1283995, 1365150, 1616327, 1519478, 1539555, 1619782] +income_Hsinchu_city = [1427572, 1537317, 1572296, 1426379, 1602826, 1618903] +income_Miaoli_county = [1008241, 1166196, 1029485, 1045881, 1073028, 1161999] + +plt.plot(year, income_Taipei, label="Taipei") +plt.plot(year, income_New_Taipei, label="New Taipei") +plt.plot(year, income_Taoyuan, label="Taoyuan") +plt.plot(year, income_Hsinchu_county, label="Hsinchu county") +plt.plot(year, income_Hsinchu_city, label="Hsinchu city") +plt.plot(year, income_Miaoli_county, label="Miaoli") +plt.plot(year, income_Taichung, label="Taichung") +plt.plot(year, income_Tainan, label="Tainan") +plt.plot(year, income_Kaohsiung, label="Kaohsiung", marker='*', ms=12) + +plt.title("Annual household income by region in Taiwan") +plt.legend() +plt.grid(linewidth=0.7) +plt.ylabel("Income (1 million New Taiwan Dollar)") +plt.xlabel("Reference: https://statfy.mol.gov.tw/map02.aspx?cid=64&xFunc=138&xKey=1") + +plt.show() diff --git a/The attainments and realizations of my dreams/Annual household income/Annual_household_income.png b/The attainments and realizations of my dreams/Annual household income/Annual_household_income.png new file mode 100644 index 00000000..fc3a0bd7 Binary files /dev/null and b/The attainments and realizations of my dreams/Annual household income/Annual_household_income.png differ diff --git a/The attainments and realizations of my dreams/Annual household income/Annual_household_income.py b/The attainments and realizations of my dreams/Annual household income/Annual_household_income.py new file mode 100644 index 00000000..70fc0fe0 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual household income/Annual_household_income.py @@ -0,0 +1,31 @@ +import matplotlib.pyplot as plt + +year = [2015, 2016, 2017, 2018, 2019, 2020] +income_Kaohsiung = [1145895, 1166824, 1186204, 1219246, 1224268, 1224100] +income_Tainan = [1007093, 1063495, 1079199, 1086077, 1079174, 1086475] +income_Taichung = [1169183, 1140325, 1245350, 1279865, 1298497, 1289700] +income_Taoyuan = [1307158, 1317790, 1337361, 1378732, 1392199, 1424027] +income_Taipei = [1581899, 1568945, 1648122, 1649348, 1723021, 1716591] +income_New_Taipei = [1171978, 1223867, 1265798, 1292753, 1319841, 1352548] +income_Hsinchu_county = [1283995, 1365150, 1616327, 1519478, 1539555, 1619782] +income_Hsinchu_city = [1427572, 1537317, 1572296, 1426379, 1602826, 1618903] +income_Miaoli_county = [1008241, 1166196, 1029485, 1045881, 1073028, 1161999] + +plt.plot(year, income_Taipei, label="Taipei") +plt.plot(year, income_New_Taipei, label="New Taipei") +plt.plot(year, income_Taoyuan, label="Taoyuan") +plt.plot(year, income_Hsinchu_county, label="Hsinchu county") +plt.plot(year, income_Hsinchu_city, label="Hsinchu city") +plt.plot(year, income_Miaoli_county, label="Miaoli") +plt.plot(year, income_Taichung, label="Taichung") +plt.plot(year, income_Tainan, label="Tainan") +plt.plot(year, income_Kaohsiung, label="Kaohsiung") + +plt.title("Annual household income by region in Taiwan") +plt.legend() +plt.grid(linewidth=0.7) +plt.ylabel("Income (1 million New Taiwan Dollar)") +plt.xlabel("Reference: https://statfy.mol.gov.tw/map02.aspx?cid=64&xFunc=138&xKey=1") + +plt.savefig("Annual_household_income") +plt.show() diff --git a/The attainments and realizations of my dreams/Annual household income/CC-BY.png b/The attainments and realizations of my dreams/Annual household income/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Annual household income/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Annual household income/__init__.py b/The attainments and realizations of my dreams/Annual household income/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/2017-2019.py b/The attainments and realizations of my dreams/Annual local government expenditure/2017-2019.py new file mode 100644 index 00000000..8d1f1f2b --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/2017-2019.py @@ -0,0 +1,39 @@ +import matplotlib.pyplot as plt +import numpy as np + +Year = ("2017", "2018", "2019") +penguin_means = { + 'Taipei': (165.75, 172.55, 164.91), + 'New Taipei': (156.31, 162.03, 163.66), + 'Taoyuan': (102.23, 110.05, 114.51), + 'Taichung': (126.77, 129.68, 124.65), + 'Tainan': (79.84, 84.85, 86.25), + 'Kaohsiung': (128.79, 129.16, 133.48), +} + +x = np.arange(len(Year)) # the label locations +width = 0.10 # the width of the bars +multiplier = 0 + +fig, ax = plt.subplots(layout='tight', figsize=(15, 7)) # [1] + +for attribute, measurement in penguin_means.items(): + offset = width * multiplier + rects = ax.bar(x + offset, measurement, width, label=attribute) + ax.bar_label(rects, padding=3) + multiplier += 1 + +# Add some text for labels, title and custom x-axis tick labels, etc. +ax.set_ylabel('New Taiwan Dollar (billion)') +ax.set_title('Annual Expenditure by Local Government\n (Yearly distribution of taxpayer\'s money)') +ax.set_xticks(x + width, Year) +ax.legend(loc='upper left', ncols=3) +ax.set_ylim(75, 180) + +plt.xlabel("Reference https://www.dgbas.gov.tw/News.aspx?n=1525&sms=10694") + +plt.show() + +# References: +# https://matplotlib.org/stable/gallery/lines_bars_and_markers/barchart.html +# 1. https://matplotlib.org/stable/users/explain/axes/tight_layout_guide.html#tight-layout-guide diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024.py b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024.py new file mode 100644 index 00000000..b47b5906 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024.py @@ -0,0 +1,35 @@ +import matplotlib.pyplot as plt +import numpy as np + +Year = ("2022", "2023", "2024") +penguin_means = { + 'Taipei': (171.58, 177.48, 190.71), + 'New Taipei': (186.48, 197.57, 212.48), + 'Kaohsiung': (151.44, 160.85, 169.57), +} + +x = np.arange(len(Year)) # the label locations +width = 0.25 # the width of the bars +multiplier = 0 + +fig, ax = plt.subplots(layout='constrained') + +for attribute, measurement in penguin_means.items(): + offset = width * multiplier + rects = ax.bar(x + offset, measurement, width, label=attribute) + ax.bar_label(rects, padding=3) + multiplier += 1 + +# Add some text for labels, title and custom x-axis tick labels, etc. +ax.set_ylabel('New Taiwan Dollar (billion)') +ax.set_title('Annual Expenditure by Local Government\n (Yearly distribution of taxpayer\'s money)') +ax.set_xticks(x + width, Year) +ax.legend(loc='upper left', ncols=3) +ax.set_ylim(80, 220) + +plt.xlabel("Reference https://www.dgbas.gov.tw/News.aspx?n=1525&sms=10694") + +plt.show() + +# References: +# https://matplotlib.org/stable/gallery/lines_bars_and_markers/barchart.html \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_1.py b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_1.py new file mode 100644 index 00000000..9b29106a --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_1.py @@ -0,0 +1,35 @@ +import matplotlib.pyplot as plt +import numpy as np + +Year = ("2022", "2023", "2024") +penguin_means = { + 'Taipei': (171.58, 177.48, 190.71), + 'New Taipei': (186.48, 197.57, 212.48), + 'Kaohsiung': (151.44, 160.85, 169.57), +} + +x = np.arange(len(Year)) # the label locations +width = 0.25 # the width of the bars +multiplier = 0 + +fig, ax = plt.subplots(layout='constrained') + +for attribute, measurement in penguin_means.items(): + offset = width * multiplier + rects = ax.bar(x + offset, measurement, width, label=attribute) + ax.bar_label(rects, padding=3) + multiplier += 1 + +# Add some text for labels, title and custom x-axis tick labels, etc. +ax.set_ylabel('New Taiwan Dollar (billion)') +ax.set_title('Annual Expenditure by Local Government\n (Yearly distribution of taxpayer\'s money)') +ax.set_xticks(x + width, Year) +ax.legend(loc='upper left', ncols=3) +ax.set_ylim(150, 220) + +plt.xlabel("Reference https://www.dgbas.gov.tw/News.aspx?n=1525&sms=10694") + +plt.show() + +# References: +# https://matplotlib.org/stable/gallery/lines_bars_and_markers/barchart.html \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_2.py b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_2.py new file mode 100644 index 00000000..eb23d4f3 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_2.py @@ -0,0 +1,39 @@ +import matplotlib.pyplot as plt +import numpy as np + +Year = ("2022", "2023", "2024") +penguin_means = { + 'Taipei': (171.58, 177.48, 190.71), + 'New Taipei': (186.48, 197.57, 212.48), + 'Taoyuan': (141.05, ), + 'Taichung': (151.20, ), + 'Tainan': (102.06, ), + 'Kaohsiung': (151.44, 160.85, 169.57), +} + +x = np.arange(len(Year)) # the label locations +width = 0.25 # the width of the bars +multiplier = 0 + +fig, ax = plt.subplots(layout='tight') # [1] + +for attribute, measurement in penguin_means.items(): + offset = width * multiplier + rects = ax.bar(x + offset, measurement, width, label=attribute) + ax.bar_label(rects, padding=3) + multiplier += 1 + +# Add some text for labels, title and custom x-axis tick labels, etc. +ax.set_ylabel('New Taiwan Dollar (billion)') +ax.set_title('Annual Expenditure by Local Government\n (Yearly distribution of taxpayer\'s money)') +ax.set_xticks(x + width, Year) +ax.legend(loc='upper left', ncols=3) +ax.set_ylim(80, 220) + +plt.xlabel("Reference https://www.dgbas.gov.tw/News.aspx?n=1525&sms=10694") + +plt.show() + +# References: +# https://matplotlib.org/stable/gallery/lines_bars_and_markers/barchart.html +# 1. https://matplotlib.org/stable/users/explain/axes/tight_layout_guide.html#tight-layout-guide diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_3.py b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_3.py new file mode 100644 index 00000000..f394fc00 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_3.py @@ -0,0 +1,39 @@ +import matplotlib.pyplot as plt +import numpy as np + +Year = ("2022", "2023", "2024") +penguin_means = { + 'Taipei': (171.58, 177.48, 190.71), + 'New Taipei': (186.48, 197.57, 212.48), + 'Taoyuan': (141.05, 142.99, 156.80), + 'Taichung': (151.20, 150.48, 177.22), + 'Tainan': (102.06, 102.56, 116.94), + 'Kaohsiung': (151.44, 160.85, 169.57), +} + +x = np.arange(len(Year)) # the label locations +width = 0.10 # the width of the bars +multiplier = 0 + +fig, ax = plt.subplots(layout='tight', figsize=(16, 9)) # [1] + +for attribute, measurement in penguin_means.items(): + offset = width * multiplier + rects = ax.bar(x + offset, measurement, width, label=attribute) + ax.bar_label(rects, padding=3) + multiplier += 1 + +# Add some text for labels, title and custom x-axis tick labels, etc. +ax.set_ylabel('New Taiwan Dollar (billion)') +ax.set_title('Annual Expenditure by Local Government\n (Yearly distribution of taxpayer\'s money)') +ax.set_xticks(x + width, Year) +ax.legend(loc='upper left', ncols=3) +ax.set_ylim(80, 220) + +plt.xlabel("Reference https://www.dgbas.gov.tw/News.aspx?n=1525&sms=10694") + +plt.show() + +# References: +# https://matplotlib.org/stable/gallery/lines_bars_and_markers/barchart.html +# 1. https://matplotlib.org/stable/users/explain/axes/tight_layout_guide.html#tight-layout-guide diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_4.py b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_4.py new file mode 100644 index 00000000..61e0c84d --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_4.py @@ -0,0 +1,39 @@ +import matplotlib.pyplot as plt +import numpy as np + +Year = ("2022", "2023", "2024") +penguin_means = { + 'Taipei': (171.58, 177.48, 190.71), + 'New Taipei': (186.48, 197.57, 212.48), + 'Taoyuan': (141.05, 142.99, 156.80), + 'Taichung': (151.20, 150.48, 177.22), + 'Tainan': (102.06, 102.56, 116.94), + 'Kaohsiung': (151.44, 160.85, 169.57), +} + +x = np.arange(len(Year)) # the label locations +width = 0.10 # the width of the bars +multiplier = 0 + +fig, ax = plt.subplots(layout='tight', figsize=(14, 9)) # [1] + +for attribute, measurement in penguin_means.items(): + offset = width * multiplier + rects = ax.bar(x + offset, measurement, width, label=attribute) + ax.bar_label(rects, padding=3) + multiplier += 1 + +# Add some text for labels, title and custom x-axis tick labels, etc. +ax.set_ylabel('New Taiwan Dollar (billion)') +ax.set_title('Annual Expenditure by Local Government\n (Yearly distribution of taxpayer\'s money)') +ax.set_xticks(x + width, Year) +ax.legend(loc='upper left', ncols=3) +ax.set_ylim(80, 220) + +plt.xlabel("Reference https://www.dgbas.gov.tw/News.aspx?n=1525&sms=10694") + +plt.show() + +# References: +# https://matplotlib.org/stable/gallery/lines_bars_and_markers/barchart.html +# 1. https://matplotlib.org/stable/users/explain/axes/tight_layout_guide.html#tight-layout-guide diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_5.py b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_5.py new file mode 100644 index 00000000..060d1190 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_5.py @@ -0,0 +1,39 @@ +import matplotlib.pyplot as plt +import numpy as np + +Year = ("2022", "2023", "2024") +penguin_means = { + 'Taipei': (171.58, 177.48, 190.71), + 'New Taipei': (186.48, 197.57, 212.48), + 'Taoyuan': (141.05, 142.99, 156.80), + 'Taichung': (151.20, 150.48, 177.22), + 'Tainan': (102.06, 102.56, 116.94), + 'Kaohsiung': (151.44, 160.85, 169.57), +} + +x = np.arange(len(Year)) # the label locations +width = 0.10 # the width of the bars +multiplier = 0 + +fig, ax = plt.subplots(layout='tight', figsize=(15, 7)) # [1] + +for attribute, measurement in penguin_means.items(): + offset = width * multiplier + rects = ax.bar(x + offset, measurement, width, label=attribute) + ax.bar_label(rects, padding=3) + multiplier += 1 + +# Add some text for labels, title and custom x-axis tick labels, etc. +ax.set_ylabel('New Taiwan Dollar (billion)') +ax.set_title('Annual Expenditure by Local Government\n (Yearly distribution of taxpayer\'s money)') +ax.set_xticks(x + width, Year) +ax.legend(loc='upper left', ncols=3) +ax.set_ylim(80, 220) + +plt.xlabel("Reference https://www.dgbas.gov.tw/News.aspx?n=1525&sms=10694") + +plt.show() + +# References: +# https://matplotlib.org/stable/gallery/lines_bars_and_markers/barchart.html +# 1. https://matplotlib.org/stable/users/explain/axes/tight_layout_guide.html#tight-layout-guide diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_6.py b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_6.py new file mode 100644 index 00000000..620eac26 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_6.py @@ -0,0 +1,39 @@ +import matplotlib.pyplot as plt +import numpy as np + +Year = ("2022", "2023", "2024") +penguin_means = { + 'Taipei': (171.58, 177.48, 190.71), + 'New Taipei': (186.48, 197.57, 212.48), + 'Taoyuan': (141.05, 142.99, 156.80), + 'Taichung': (151.20, 150.48, 177.22), + 'Tainan': (102.06, 102.56, 116.94), + 'Kaohsiung': (151.44, 160.85, 169.57), +} + +x = np.arange(len(Year)) # the label locations +width = 0.10 # the width of the bars +multiplier = 0 + +fig, ax = plt.subplots(layout='tight', figsize=(15, 7)) # [1] + +for attribute, measurement in penguin_means.items(): + offset = width * multiplier + rects = ax.bar(x + offset, measurement, width, label=attribute) + ax.bar_label(rects, padding=3) + multiplier += 1 + +# Add some text for labels, title and custom x-axis tick labels, etc. +ax.set_ylabel('New Taiwan Dollar (billion)') +ax.set_title('Annual Expenditure by Local Government\n (Yearly distribution of taxpayer\'s money)') +ax.set_xticks(x + width, Year) +ax.legend(loc='upper left', ncols=3) +ax.set_ylim(100, 220) + +plt.xlabel("Reference https://www.dgbas.gov.tw/News.aspx?n=1525&sms=10694") + +plt.show() + +# References: +# https://matplotlib.org/stable/gallery/lines_bars_and_markers/barchart.html +# 1. https://matplotlib.org/stable/users/explain/axes/tight_layout_guide.html#tight-layout-guide diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_7.py b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_7.py new file mode 100644 index 00000000..7fe0a9f5 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_7.py @@ -0,0 +1,53 @@ +import matplotlib.pyplot as plt +import matplotlib.image as image +import matplotlib +import numpy as np +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +Year = ("2022", "2023", "2024") +penguin_means = { + 'Taipei': (171.58, 177.48, 190.71), + 'New Taipei': (186.48, 197.57, 212.48), + 'Taoyuan': (141.05, 142.99, 156.80), + 'Taichung': (151.20, 150.48, 177.22), + 'Tainan': (102.06, 102.56, 116.94), + 'Kaohsiung': (151.44, 160.85, 169.57), +} + +x = np.arange(len(Year)) # the label locations +width = 0.10 # the width of the bars +multiplier = 0 + +fig, ax = plt.subplots(layout='tight', figsize=(15, 7)) # [1] + +for attribute, measurement in penguin_means.items(): + offset = width * multiplier + rects = ax.bar(x + offset, measurement, width, label=attribute) + ax.bar_label(rects, padding=3) + multiplier += 1 + +# Add some text for labels, title and custom x-axis tick labels, etc. +ax.set_ylabel('New Taiwan Dollar (billion)') +ax.set_title('Annual Expenditure by Local Government\n (Yearly distribution of taxpayer\'s money)') +ax.set_xticks(x + width, Year) +ax.legend(loc='upper left', ncols=3) +ax.set_ylim(100, 220) + +plt.xlabel("Reference https://www.dgbas.gov.tw/News.aspx?n=1525&sms=10694") + +img = image.imread('CC0.png') + +plt.figimage(X=img, xo=1000, yo=650, alpha=0.9) + +# Insert text watermark +plt.text(x=0.3, y=0.7, s="CC0 No Copyright\n∠甈", fontsize=30, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, #rotation='30', + transform=ax.transAxes) + +plt.show() + +# References: +# https://matplotlib.org/stable/gallery/lines_bars_and_markers/barchart.html +# 1. https://matplotlib.org/stable/users/explain/axes/tight_layout_guide.html#tight-layout-guide diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_at_metro_level.py b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_at_metro_level.py new file mode 100644 index 00000000..54ccc6bd --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2024_at_metro_level.py @@ -0,0 +1,62 @@ +import matplotlib.pyplot as plt +import matplotlib.image as image +import matplotlib +import numpy as np +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +Year = ("2022", "2023", "2024") +penguin_means = { + # Taipei + New Taipei + Keelung + 'Greater Taipei': (171.58+186.48+21.15, 177.48+197.57+19.63, 190.71+212.48+24.09), + # Taoyuan + Hsinchu county + Hsinchu city + Miaoli + 'Taoyuan-Hsinchu_Miaoli': (141.05+32.36+25.61+21.56, + 142.99+34.82+25.51+22.98, + 156.80+35.43+28.11+25.05), + + 'Taichung-Changhua-Nantou': (151.20+56.60+28.90, 150.48+58.89+24.92, 177.22+64.45+33.72), + + # Yunlin + Chiayi county + Chiayi city + Tainan + 'Yunlin-Chiayi-Tainan': (37.30+28.35+16.62+102.06, + 36.30+27.41+18.38+102.56, + 40.43+33.22+19.35+116.94), + + 'Kaohsiung-Pingtung': (151.44+47.11, 160.85+50.33, 169.57+55.85), +} + +x = np.arange(len(Year)) # the label locations +width = 0.10 # the width of the bars +multiplier = 0 + +fig, ax = plt.subplots(layout='tight', figsize=(15, 7)) # [1] + +for attribute, measurement in penguin_means.items(): + offset = width * multiplier + rects = ax.bar(x + offset, measurement, width, label=attribute) + ax.bar_label(rects, padding=3) + multiplier += 1 + +# Add some text for labels, title and custom x-axis tick labels, etc. +ax.set_ylabel('New Taiwan Dollar (billion)') +ax.set_title('Annual Expenditure by Local Governments\n (Yearly distribution of taxpayer\'s money at metro level)') +ax.set_xticks(x + width, Year) +ax.legend(loc='upper left', ncols=3) +ax.set_ylim(150, 450) + +plt.xlabel("Reference https://www.dgbas.gov.tw/News.aspx?n=1525&sms=10694") + +img = image.imread('CC0.png') + +plt.figimage(X=img, xo=1050, yo=650, alpha=0.9) + +# Insert text watermark +plt.text(x=0.25, y=0.65, s="CC0 No Copyright\n∠甈", fontsize=30, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, #rotation='30', + transform=ax.transAxes) + +plt.show() + +# References: +# https://matplotlib.org/stable/gallery/lines_bars_and_markers/barchart.html +# 1. https://matplotlib.org/stable/users/explain/axes/tight_layout_guide.html#tight-layout-guide diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/2022-2025_at_metro_level.py b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2025_at_metro_level.py new file mode 100644 index 00000000..8867891e --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/2022-2025_at_metro_level.py @@ -0,0 +1,48 @@ +import matplotlib.pyplot as plt +import numpy as np + +Year = ("2022", "2023", "2024", "2025") +penguin_means = { + # Taipei + New Taipei + Keelung + 'Greater Taipei': (171.58+186.48+21.15+ , 177.48+197.57+19.63+ , 190.71+212.48+24.09+), + # Taoyuan + Hsinchu county + Hsinchu city + Miaoli + 'Taoyuan-Hsinchu_Miaoli': (141.05+32.36+25.61+21.56, + 142.99+34.82+25.51+22.98, + 156.80+35.43+28.11+25.05), + + 'Taichung-Changhua-Nantou': (151.20+56.60+28.90, 150.48+58.89+24.92, 177.22+64.45+33.72), + + # Yunlin + Chiayi county + Chiayi city + Tainan + 'Yunlin-Chiayi-Tainan': (37.30+28.35+16.62+102.06, + 36.30+27.41+18.38+102.56, + 40.43+33.22+19.35+116.94), + + 'Kaohsiung-Pingtung': (151.44+47.11, 160.85+50.33, 169.57+55.85), +} + +x = np.arange(len(Year)) # the label locations +width = 0.10 # the width of the bars +multiplier = 0 + +fig, ax = plt.subplots(layout='tight', figsize=(15, 7)) # [1] + +for attribute, measurement in penguin_means.items(): + offset = width * multiplier + rects = ax.bar(x + offset, measurement, width, label=attribute) + ax.bar_label(rects, padding=3) + multiplier += 1 + +# Add some text for labels, title and custom x-axis tick labels, etc. +ax.set_ylabel('New Taiwan Dollar (billion)') +ax.set_title('Annual Expenditure by Local Governments\n (Yearly distribution of taxpayer\'s money at metro level)') +ax.set_xticks(x + width, Year) +ax.legend(loc='upper left', ncols=3) +ax.set_ylim(150, 450) + +plt.xlabel("Reference https://www.dgbas.gov.tw/News.aspx?n=1525&sms=10694") + +plt.show() + +# References: +# https://matplotlib.org/stable/gallery/lines_bars_and_markers/barchart.html +# 1. https://matplotlib.org/stable/users/explain/axes/tight_layout_guide.html#tight-layout-guide diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/CC0.png b/The attainments and realizations of my dreams/Annual local government expenditure/CC0.png new file mode 100644 index 00000000..10986298 Binary files /dev/null and b/The attainments and realizations of my dreams/Annual local government expenditure/CC0.png differ diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-2.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-2.py new file mode 100644 index 00000000..7a6147d0 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-2.py @@ -0,0 +1,49 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Taipei', 'New Taipei', "Taoyuan", 'Taichung', "Tainan", 'Kaohsiung') +sex_counts = { + 'Statutory': np.array([34.95, 26.52, 17.12, 20.63, 17.44, 26.47]), #[1]:18 + 'Federal discretionary subsidy': np.array([17.12, 31.11, 15.21, 24.88, 22.85, 27.83]), #[1]:25 +} + +position_vacancies = [sex_counts['Statutory'][0] + sex_counts["Federal discretionary subsidy"][0], + sex_counts["Statutory"][1] + sex_counts["Federal discretionary subsidy"][1], + sex_counts["Statutory"][2] + sex_counts["Federal discretionary subsidy"][2], + sex_counts["Statutory"][3] + sex_counts["Federal discretionary subsidy"][3], + sex_counts["Statutory"][4] + sex_counts["Federal discretionary subsidy"][4], + sex_counts["Statutory"][5] + sex_counts["Federal discretionary subsidy"][5] + ] + +fig, ax = plt.subplots() +bottom = np.zeros(6) + +p = 0 + +for sex, sex_count in sex_counts.items(): + p = ax.bar(species, sex_count, width=0.6, label=sex, bottom=bottom) + bottom += sex_count + + ax.bar_label(p, label_type='center') + + # for rect in p: + # height = rect.get_height() + # ax.text(rect.get_x() + rect.get_width() / 2., 2.001 * height, + # '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.bar_label(p, labels=position_vacancies, label_type="edge") + +# plot = ax.bar(region_num, position_vacancies, width=0.6) +# +# for rect in plot: +# height = rect.get_height() +# ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, +# '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.set_title("2015's composition of local government's income") +ax.legend() + +plt.show() + +# References: +# 1. https://ws.dgbas.gov.tw/public/attachment/5611134736t64w6mty.pdf diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-3.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-3.py new file mode 100644 index 00000000..36db69a4 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-3.py @@ -0,0 +1,49 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Taipei', 'New Taipei', "Taoyuan", 'Taichung', "Tainan", 'Kaohsiung') +allotted_money = { + 'Statutory': [34.95, 26.52, 17.12, 20.63, 17.44, 26.47], #[1]:18 + 'Federal discretionary subsidy': [17.12, 31.11, 15.21, 24.88, 22.85, 27.83], #[1]:25 +} + +sum = [allotted_money['Statutory'][0] + allotted_money["Federal discretionary subsidy"][0], + allotted_money["Statutory"][1] + allotted_money["Federal discretionary subsidy"][1], + allotted_money["Statutory"][2] + allotted_money["Federal discretionary subsidy"][2], + allotted_money["Statutory"][3] + allotted_money["Federal discretionary subsidy"][3], + allotted_money["Statutory"][4] + allotted_money["Federal discretionary subsidy"][4], + allotted_money["Statutory"][5] + allotted_money["Federal discretionary subsidy"][5] + ] + +fig, ax = plt.subplots() +bottom = np.zeros(6) + +p = 0 + +for sex, sex_count in allotted_money.items(): + p = ax.bar(species, sex_count, width=0.6, label=sex, bottom=bottom) + bottom += sex_count + + ax.bar_label(p, label_type='center') + + # for rect in p: + # height = rect.get_height() + # ax.text(rect.get_x() + rect.get_width() / 2., 2.001 * height, + # '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.bar_label(p, labels=sum, label_type="edge", fmt="%.2f") + +# plot = ax.bar(region_num, position_vacancies, width=0.6) +# +# for rect in plot: +# height = rect.get_height() +# ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, +# '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.set_title("2015's composition of local government's income") +ax.legend() + +plt.show() + +# References: +# 1. https://ws.dgbas.gov.tw/public/attachment/5611134736t64w6mty.pdf diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-4.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-4.py new file mode 100644 index 00000000..f27a0a0c --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-4.py @@ -0,0 +1,49 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Taipei', 'New Taipei', "Taoyuan", 'Taichung', "Tainan", 'Kaohsiung') +allotted_money = { + 'Statutory': [34.95, 26.52, 17.12, 20.63, 17.44, 26.47], #[1]:18 + 'Federal discretionary subsidy': [17.12, 31.11, 15.21, 24.88, 22.85, 27.83], #[1]:25 +} + +sum = [allotted_money['Statutory'][0] + allotted_money["Federal discretionary subsidy"][0], + allotted_money["Statutory"][1] + allotted_money["Federal discretionary subsidy"][1], + allotted_money["Statutory"][2] + allotted_money["Federal discretionary subsidy"][2], + allotted_money["Statutory"][3] + allotted_money["Federal discretionary subsidy"][3], + allotted_money["Statutory"][4] + allotted_money["Federal discretionary subsidy"][4], + allotted_money["Statutory"][5] + allotted_money["Federal discretionary subsidy"][5] + ] + +fig, ax = plt.subplots() +bottom = np.zeros(6) + +p = 0 + +for sex, sex_count in allotted_money.items(): + p = ax.bar(species, sex_count, width=0.6, label=sex, bottom=bottom) + bottom += sex_count + + ax.bar_label(p, label_type='center') + + # for rect in p: + # height = rect.get_height() + # ax.text(rect.get_x() + rect.get_width() / 2., 2.001 * height, + # '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.bar_label(p, labels=sum, fmt="%.2f", label_type="edge") + +# plot = ax.bar(region_num, position_vacancies, width=0.6) +# +# for rect in plot: +# height = rect.get_height() +# ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, +# '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.set_title("2015's composition of local government's income") +ax.legend() + +plt.show() + +# References: +# 1. https://ws.dgbas.gov.tw/public/attachment/5611134736t64w6mty.pdf diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-5.ipynb b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-5.ipynb new file mode 100644 index 00000000..49583384 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-5.ipynb @@ -0,0 +1,117 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "initial_id", + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-03-20T10:19:37.950799Z", + "start_time": "2025-03-20T10:19:36.050188Z" + } + }, + "cell_type": "code", + "source": [ + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "\n", + "species = ('Taipei', 'New Taipei', \"Taoyuan\", 'Taichung', \"Tainan\", 'Kaohsiung')\n", + "allotted_money = {\n", + " 'Statutory': [34.95, 26.52, 17.12, 20.63, 17.44, 26.47], #[1]:18\n", + " 'Federal discretionary subsidy': [17.12, 31.11, 15.21, 24.88, 22.85, 27.83], #[1]:25\n", + "}\n", + "\n", + "sum = [allotted_money['Statutory'][0] + allotted_money[\"Federal discretionary subsidy\"][0],\n", + " allotted_money[\"Statutory\"][1] + allotted_money[\"Federal discretionary subsidy\"][1],\n", + " allotted_money[\"Statutory\"][2] + allotted_money[\"Federal discretionary subsidy\"][2],\n", + " allotted_money[\"Statutory\"][3] + allotted_money[\"Federal discretionary subsidy\"][3],\n", + " allotted_money[\"Statutory\"][4] + allotted_money[\"Federal discretionary subsidy\"][4],\n", + " allotted_money[\"Statutory\"][5] + allotted_money[\"Federal discretionary subsidy\"][5]\n", + " ]\n", + "\n", + "fig, ax = plt.subplots()\n", + "bottom = np.zeros(6)\n", + "\n", + "p = 0\n", + "\n", + "for sex, sex_count in allotted_money.items():\n", + " p = ax.bar(species, sex_count, width=0.6, label=sex, bottom=bottom) #[Note1]\n", + " bottom += sex_count\n", + "\n", + " ax.bar_label(p, label_type='center')\n", + "\n", + " # for rect in p:\n", + " # height = rect.get_height()\n", + " # ax.text(rect.get_x() + rect.get_width() / 2., 2.001 * height,\n", + " # '%d' % int(height), ha='center', va='bottom', fontsize=12)\n", + "\n", + "ax.bar_label(p, labels=sum, fmt=\"{:3.2f}\", label_type=\"edge\")\n", + "\n", + "# plot = ax.bar(region_num, position_vacancies, width=0.6)\n", + "#\n", + "# for rect in plot:\n", + "# height = rect.get_height()\n", + "# ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height,\n", + "# '%d' % int(height), ha='center', va='bottom', fontsize=12)\n", + "\n", + "ax.set_title(\"2015's composition of local government's income\")\n", + "ax.legend()\n", + "\n", + "plt.show()\n", + "\n", + "# References:\n", + "# 1. https://ws.dgbas.gov.tw/public/attachment/5611134736t64w6mty.pdf\n", + "# 2.\n", + "\n", + "# Notes:\n", + "# 1. when having duplicate values in categorical x data,\n", + "# these values map to the same numerical x coordinate, and hence the corresponding bars\n", + "# are drawn on top of each other. [2]\n" + ], + "id": "4b1bd0ee69789a25", + "outputs": [ + { + "data": { + "text/plain": [ + "
" + ], + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAh8AAAGzCAYAAACPa3XZAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAACZ6UlEQVR4nOzdd1gUxxsH8O/dcQ0OjipFmopSLGAXYxc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r0KIKCgtDe3o7t27ejoaHBoA9B0GUXQvqxDRs24MUXX4S9vf1jn1Iifc/PP/+MqKgouLu7491338Vbb73V7S2ohBiTiYkJsrKyEBAQgAkTJuDChQs4fvw4d4O+IdBlF0IIIYQYFc18EEIIIcSoaPBBCCGEEKOiwQchhBBCjIoGH4QQQggxKhp8EEIIIcSoaPBBCCGEEKOiwQchhBBCjIoGH4QQQggxqv8DJH71/xUQvgYAAAAASUVORK5CYII=" + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "execution_count": 1 + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-5.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-5.py new file mode 100644 index 00000000..fce73b2d --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-5.py @@ -0,0 +1,55 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Taipei', 'New Taipei', "Taoyuan", 'Taichung', "Tainan", 'Kaohsiung') +allotted_money = { + 'Statutory': [34.95, 26.52, 17.12, 20.63, 17.44, 26.47], #[1]:18 + 'Federal discretionary subsidy': [17.12, 31.11, 15.21, 24.88, 22.85, 27.83], #[1]:25 +} + +sum = [allotted_money['Statutory'][0] + allotted_money["Federal discretionary subsidy"][0], + allotted_money["Statutory"][1] + allotted_money["Federal discretionary subsidy"][1], + allotted_money["Statutory"][2] + allotted_money["Federal discretionary subsidy"][2], + allotted_money["Statutory"][3] + allotted_money["Federal discretionary subsidy"][3], + allotted_money["Statutory"][4] + allotted_money["Federal discretionary subsidy"][4], + allotted_money["Statutory"][5] + allotted_money["Federal discretionary subsidy"][5] + ] + +fig, ax = plt.subplots() +bottom = np.zeros(6) + +p = 0 + +for sex, sex_count in allotted_money.items(): + p = ax.bar(species, sex_count, width=0.6, label=sex, bottom=bottom) #[Note1] + bottom += sex_count + + ax.bar_label(p, label_type='center') + + # for rect in p: + # height = rect.get_height() + # ax.text(rect.get_x() + rect.get_width() / 2., 2.001 * height, + # '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.bar_label(p, labels=sum, fmt="{:3.2f}", label_type="edge") + +# plot = ax.bar(region_num, position_vacancies, width=0.6) +# +# for rect in plot: +# height = rect.get_height() +# ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, +# '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.set_title("2015's composition of local government's income") +ax.legend() + +plt.show() + +# References: +# 1. https://ws.dgbas.gov.tw/public/attachment/5611134736t64w6mty.pdf +# 2. + +# Notes: +# 1. when having duplicate values in categorical x data, +# these values map to the same numerical x coordinate, and hence the corresponding bars +# are drawn on top of each other. [2] diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-6.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-6.py new file mode 100644 index 00000000..0c57a267 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-6.py @@ -0,0 +1,55 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Taipei', 'New Taipei', "Taoyuan", 'Taichung', "Tainan", 'Kaohsiung') +allotted_money = { + 'Statutory': [34.95, 26.52, 17.12, 20.63, 17.44, 26.47], #[1]:18 + 'Federal discretionary subsidy': [17.12, 31.11, 15.21, 24.88, 22.85, 27.83], #[1]:25 +} + +sum = [allotted_money['Statutory'][0] + allotted_money["Federal discretionary subsidy"][0], + allotted_money["Statutory"][1] + allotted_money["Federal discretionary subsidy"][1], + allotted_money["Statutory"][2] + allotted_money["Federal discretionary subsidy"][2], + allotted_money["Statutory"][3] + allotted_money["Federal discretionary subsidy"][3], + allotted_money["Statutory"][4] + allotted_money["Federal discretionary subsidy"][4], + allotted_money["Statutory"][5] + allotted_money["Federal discretionary subsidy"][5] + ] + +fig, ax = plt.subplots() +bottom = np.zeros(6) + +p = 0 + +for sex, sex_count in allotted_money.items(): + p = ax.bar(species, sex_count, width=0.6, label=sex, bottom=bottom) #[Note1] + bottom += sex_count + + ax.bar_label(p, label_type='center') + + # for rect in p: + # height = rect.get_height() + # ax.text(rect.get_x() + rect.get_width() / 2., 2.001 * height, + # '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.bar_label(p, labels=[f'簣{e:.2f}' for e in sum], label_type="edge") + +# plot = ax.bar(region_num, position_vacancies, width=0.6) +# +# for rect in plot: +# height = rect.get_height() +# ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, +# '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.set_title("2015's composition of local government's income") +ax.legend() + +plt.show() + +# References: +# 1. https://ws.dgbas.gov.tw/public/attachment/5611134736t64w6mty.pdf +# 2. https://matplotlib.org/3.8.4/api/_as_gen/matplotlib.axes.Axes.bar_label.html + +# Notes: +# 1. when having duplicate values in categorical x data, +# these values map to the same numerical x coordinate, and hence the corresponding bars +# are drawn on top of each other. [2] diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-7.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-7.py new file mode 100644 index 00000000..a597cd40 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-7.py @@ -0,0 +1,56 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Taipei', 'New Taipei', "Taoyuan", 'Taichung', "Tainan", 'Kaohsiung') +allotted_money = { + 'Statutory': [34.95, 26.52, 17.12, 20.63, 17.44, 26.47], #[1]:18 + 'Federal discretionary subsidy': [17.12, 31.11, 15.21, 24.88, 22.85, 27.83], #[1]:25 +} + +sum = [allotted_money['Statutory'][0] + allotted_money["Federal discretionary subsidy"][0], + allotted_money["Statutory"][1] + allotted_money["Federal discretionary subsidy"][1], + allotted_money["Statutory"][2] + allotted_money["Federal discretionary subsidy"][2], + allotted_money["Statutory"][3] + allotted_money["Federal discretionary subsidy"][3], + allotted_money["Statutory"][4] + allotted_money["Federal discretionary subsidy"][4], + allotted_money["Statutory"][5] + allotted_money["Federal discretionary subsidy"][5] + ] + +fig, ax = plt.subplots() +bottom = np.zeros(6) + +p = 0 + +for sex, sex_count in allotted_money.items(): + p = ax.bar(species, sex_count, width=0.6, label=sex, bottom=bottom) #[Note1] + bottom += sex_count + + ax.bar_label(p, label_type='center') + + # for rect in p: + # height = rect.get_height() + # ax.text(rect.get_x() + rect.get_width() / 2., 2.001 * height, + # '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.bar_label(p, labels=[f'{e:.2f}' for e in sum], label_type="edge") #[3] + +# plot = ax.bar(region_num, position_vacancies, width=0.6) +# +# for rect in plot: +# height = rect.get_height() +# ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, +# '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.set_title("2015's composition of local government's income") +ax.legend() + +plt.show() + +# References: +# 1. https://ws.dgbas.gov.tw/public/attachment/5611134736t64w6mty.pdf +# 2. https://matplotlib.org/3.8.4/api/_as_gen/matplotlib.axes.Axes.bar_label.html +# 3. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html + +# Notes: +# 1. when having duplicate values in categorical x data, +# these values map to the same numerical x coordinate, and hence the corresponding bars +# are drawn on top of each other. [2] diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-8.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-8.py new file mode 100644 index 00000000..4c487319 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-8.py @@ -0,0 +1,56 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Taipei', 'New Taipei', "Taoyuan", 'Taichung', "Tainan", 'Kaohsiung') +allotted_money = { + 'Statutory': [34.95, 26.52, 17.12, 20.63, 17.44, 26.47], #[1]:18 + 'Federal discretionary subsidy': [17.12, 31.11, 15.21, 24.88, 22.85, 27.83], #[1]:25 +} + +sum = [allotted_money['Statutory'][0] + allotted_money["Federal discretionary subsidy"][0], + allotted_money["Statutory"][1] + allotted_money["Federal discretionary subsidy"][1], + allotted_money["Statutory"][2] + allotted_money["Federal discretionary subsidy"][2], + allotted_money["Statutory"][3] + allotted_money["Federal discretionary subsidy"][3], + allotted_money["Statutory"][4] + allotted_money["Federal discretionary subsidy"][4], + allotted_money["Statutory"][5] + allotted_money["Federal discretionary subsidy"][5] + ] + +fig, ax = plt.subplots(figsize=(6, 9)) +bottom = np.zeros(6) + +p = 0 + +for sex, sex_count in allotted_money.items(): + p = ax.bar(species, sex_count, width=0.6, label=sex, bottom=bottom) #[Note1] + bottom += sex_count + + ax.bar_label(p, label_type='center') + + # for rect in p: + # height = rect.get_height() + # ax.text(rect.get_x() + rect.get_width() / 2., 2.001 * height, + # '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.bar_label(p, labels=[f'{s:.2f}' for s in sum], label_type="edge") #[3] + +# plot = ax.bar(region_num, position_vacancies, width=0.6) +# +# for rect in plot: +# height = rect.get_height() +# ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, +# '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.set_title("2015's composition of local government's income \n (Unit: billion)") +ax.legend() + +plt.show() + +# References: +# 1. https://ws.dgbas.gov.tw/public/attachment/5611134736t64w6mty.pdf +# 2. https://matplotlib.org/3.8.4/api/_as_gen/matplotlib.axes.Axes.bar_label.html +# 3. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html + +# Notes: +# 1. when having duplicate values in categorical x data, +# these values map to the same numerical x coordinate, and hence the corresponding bars +# are drawn on top of each other. [2] diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-9.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-9.py new file mode 100644 index 00000000..ceb6b56e --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015-9.py @@ -0,0 +1,61 @@ +import matplotlib.pyplot as plt +import numpy as np +import matplotlib + +matplotlib.rc('font', family="MS Gothic") + +species = ('Taipei', 'New Taipei', "Taoyuan", 'Taichung', "Tainan", 'Kaohsiung') +allotted_money = { + 'Statutory': [34.95, 26.52, 17.12, 20.63, 17.44, 26.47], #[1]:18 + 'Federal discretionary subsidy': [17.12, 31.11, 15.21, 24.88, 22.85, 27.83], #[1]:25 +} + +sum = [allotted_money['Statutory'][0] + allotted_money["Federal discretionary subsidy"][0], + allotted_money["Statutory"][1] + allotted_money["Federal discretionary subsidy"][1], + allotted_money["Statutory"][2] + allotted_money["Federal discretionary subsidy"][2], + allotted_money["Statutory"][3] + allotted_money["Federal discretionary subsidy"][3], + allotted_money["Statutory"][4] + allotted_money["Federal discretionary subsidy"][4], + allotted_money["Statutory"][5] + allotted_money["Federal discretionary subsidy"][5] + ] + +fig, ax = plt.subplots(figsize=(6, 9)) +bottom = np.zeros(6) + +p = 0 + +for sex, sex_count in allotted_money.items(): + p = ax.bar(species, sex_count, width=0.6, label=sex, bottom=bottom) #[Note1] + bottom += sex_count + + ax.bar_label(p, label_type='center') + + # for rect in p: + # height = rect.get_height() + # ax.text(rect.get_x() + rect.get_width() / 2., 2.001 * height, + # '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.bar_label(p, labels=[f'{s:.2f}' for s in sum], label_type="edge") #[3] + +# plot = ax.bar(region_num, position_vacancies, width=0.6) +# +# for rect in plot: +# height = rect.get_height() +# ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, +# '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.set_title("2015's composition of local government's income \n (Unit: billion)") +ax.legend() + +plt.xlabel("鞈 Reference https://ws.dgbas.gov.tw/public/attachment/5611134736t64w6mty.pdf") + +plt.show() + +# References: +# 1. https://ws.dgbas.gov.tw/public/attachment/5611134736t64w6mty.pdf +# 2. https://matplotlib.org/3.8.4/api/_as_gen/matplotlib.axes.Axes.bar_label.html +# 3. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html + +# Notes: +# 1. when having duplicate values in categorical x data, +# these values map to the same numerical x coordinate, and hence the corresponding bars +# are drawn on top of each other. [2] diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015.py new file mode 100644 index 00000000..de34c9ec --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2015.py @@ -0,0 +1,43 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Taipei', 'Taichung', 'Kaohsiung') +sex_counts = { + 'Statutory': np.array([73, 34, 61]), + 'Federal discretionary subsidy': np.array([71, 39, 58]), +} + +region_num = [1, 2, 3] +position_vacancies = [sex_counts['Statutory'][0] + sex_counts["Federal discretionary subsidy"][0], + sex_counts["Statutory"][1] + sex_counts["Federal discretionary subsidy"][1], + sex_counts["Statutory"][2] + sex_counts["Federal discretionary subsidy"][2]] + +fig, ax = plt.subplots() +bottom = np.zeros(3) + +p = 0 + +for sex, sex_count in sex_counts.items(): + p = ax.bar(species, sex_count, width=0.6, label=sex, bottom=bottom) + bottom += sex_count + + ax.bar_label(p, label_type='center') + + # for rect in p: + # height = rect.get_height() + # ax.text(rect.get_x() + rect.get_width() / 2., 2.001 * height, + # '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.bar_label(p, labels=position_vacancies, label_type="edge") + +# plot = ax.bar(region_num, position_vacancies, width=0.6) +# +# for rect in plot: +# height = rect.get_height() +# ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, +# '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.set_title('Number of penguins by sex') +ax.legend() + +plt.show() diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-2.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-2.py new file mode 100644 index 00000000..9fef605d --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-2.py @@ -0,0 +1,36 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Taipei', 'Taichung', 'Kaohsiung') +sex_counts = { + 'Statutory': np.array([73, 34, 61]), + 'Basic subsidy': np.array([73, 34, 58]), +} +width = 0.6 # the width of the bars: can also be len(x) sequence + +region_num = [1, 2, 3] +position_vacancies = [sex_counts['Statutory'][0] + sex_counts["Basic subsidy"][0], + sex_counts["Statutory"][1] + sex_counts["Basic subsidy"][1], + sex_counts["Statutory"][2] + sex_counts["Basic subsidy"][2]] + +fig, ax = plt.subplots() +bottom = np.zeros(3) + +for sex, sex_count in sex_counts.items(): + p = ax.bar(species, sex_count, width, label=sex, bottom=bottom) + bottom += sex_count + + ax.bar_label(p, label_type='center') + + +plot = ax.bar(region_num, position_vacancies, width) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.set_title('Number of penguins by sex') +ax.legend() + +plt.show() diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-3.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-3.py new file mode 100644 index 00000000..f4d02de3 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-3.py @@ -0,0 +1,35 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Taipei', 'Taichung', 'Kaohsiung') +sex_counts = { + 'Statutory': np.array([73, 34, 61]), + 'Basic subsidy': np.array([73, 34, 58]), +} + +region_num = [1, 2, 3] +position_vacancies = [sex_counts['Statutory'][0] + sex_counts["Basic subsidy"][0], + sex_counts["Statutory"][1] + sex_counts["Basic subsidy"][1], + sex_counts["Statutory"][2] + sex_counts["Basic subsidy"][2]] + +fig, ax = plt.subplots() +bottom = np.zeros(3) + +for sex, sex_count in sex_counts.items(): + p = ax.bar(species, sex_count, width=0.6, label=sex, bottom=bottom) + bottom += sex_count + + ax.bar_label(p, label_type='center') + + +plot = ax.bar(region_num, position_vacancies, width=0.6) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.set_title('Number of penguins by sex') +ax.legend() + +plt.show() diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-4.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-4.py new file mode 100644 index 00000000..812bb43e --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-4.py @@ -0,0 +1,40 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Taipei', 'Taichung', 'Kaohsiung') +sex_counts = { + 'Statutory': np.array([73, 34, 61]), + 'Basic subsidy': np.array([73, 34, 58]), +} + +region_num = [1, 2, 3] +position_vacancies = [sex_counts['Statutory'][0] + sex_counts["Basic subsidy"][0], + sex_counts["Statutory"][1] + sex_counts["Basic subsidy"][1], + sex_counts["Statutory"][2] + sex_counts["Basic subsidy"][2]] + +fig, ax = plt.subplots() +bottom = np.zeros(3) + +for sex, sex_count in sex_counts.items(): + p = ax.bar(species, sex_count, width=0.6, label=sex, bottom=bottom) + bottom += sex_count + + ax.bar_label(p, label_type='center') + + for rect in p: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + + +# plot = ax.bar(region_num, position_vacancies, width=0.6) +# +# for rect in plot: +# height = rect.get_height() +# ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, +# '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.set_title('Number of penguins by sex') +ax.legend() + +plt.show() diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-5-2.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-5-2.py new file mode 100644 index 00000000..5005be6c --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-5-2.py @@ -0,0 +1,40 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Taipei', 'Taichung', 'Kaohsiung') +sex_counts = { + 'Statutory': np.array([73, 34, 61]), + 'Basic subsidy': np.array([71, 35, 58]), +} + +region_num = [1, 2, 3] +position_vacancies = [sex_counts['Statutory'][0] + sex_counts["Basic subsidy"][0], + sex_counts["Statutory"][1] + sex_counts["Basic subsidy"][1], + sex_counts["Statutory"][2] + sex_counts["Basic subsidy"][2]] + +fig, ax = plt.subplots() +bottom = np.zeros(3) + +for sex, sex_count in sex_counts.items(): + p = ax.bar(species, sex_count, width=0.6, label=sex, bottom=bottom) + bottom += sex_count + + ax.bar_label(p, label_type='center') + + for rect in p: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 2.001 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + + +# plot = ax.bar(region_num, position_vacancies, width=0.6) +# +# for rect in plot: +# height = rect.get_height() +# ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, +# '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.set_title('Number of penguins by sex') +ax.legend() + +plt.show() diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-5-3.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-5-3.py new file mode 100644 index 00000000..d42eea81 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-5-3.py @@ -0,0 +1,42 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Taipei', 'Taichung', 'Kaohsiung') +sex_counts = { + 'Statutory': np.array([73, 34, 61]), + 'Basic subsidy': np.array([71, 39, 58]), +} + +region_num = [1, 2, 3] +position_vacancies = [sex_counts['Statutory'][0] + sex_counts["Basic subsidy"][0], + sex_counts["Statutory"][1] + sex_counts["Basic subsidy"][1], + sex_counts["Statutory"][2] + sex_counts["Basic subsidy"][2]] + +fig, ax = plt.subplots() +bottom = np.zeros(3) + +p = 0 + +for sex, sex_count in sex_counts.items(): + p = ax.bar(species, sex_count, width=0.6, label=sex, bottom=bottom) + bottom += sex_count + + ax.bar_label(p, label_type='center') + + for rect in p: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 2.001 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + + +# plot = ax.bar(region_num, position_vacancies, width=0.6) +# +# for rect in plot: +# height = rect.get_height() +# ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, +# '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.set_title('Number of penguins by sex') +ax.legend() + +plt.show() diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-5-4.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-5-4.py new file mode 100644 index 00000000..9d34d212 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-5-4.py @@ -0,0 +1,43 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Taipei', 'Taichung', 'Kaohsiung') +sex_counts = { + 'Statutory': np.array([73, 34, 61]), + 'Basic subsidy': np.array([71, 39, 58]), +} + +region_num = [1, 2, 3] +position_vacancies = [sex_counts['Statutory'][0] + sex_counts["Basic subsidy"][0], + sex_counts["Statutory"][1] + sex_counts["Basic subsidy"][1], + sex_counts["Statutory"][2] + sex_counts["Basic subsidy"][2]] + +fig, ax = plt.subplots() +bottom = np.zeros(3) + +p = 0 + +for sex, sex_count in sex_counts.items(): + p = ax.bar(species, sex_count, width=0.6, label=sex, bottom=bottom) + bottom += sex_count + + ax.bar_label(p, label_type='center') + + # for rect in p: + # height = rect.get_height() + # ax.text(rect.get_x() + rect.get_width() / 2., 2.001 * height, + # '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.bar_label(p, labels=position_vacancies, label_type="edge") + +# plot = ax.bar(region_num, position_vacancies, width=0.6) +# +# for rect in plot: +# height = rect.get_height() +# ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, +# '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.set_title('Number of penguins by sex') +ax.legend() + +plt.show() diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-5.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-5.py new file mode 100644 index 00000000..3498b698 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-5.py @@ -0,0 +1,40 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Taipei', 'Taichung', 'Kaohsiung') +sex_counts = { + 'Statutory': np.array([73, 34, 61]), + 'Basic subsidy': np.array([73, 34, 58]), +} + +region_num = [1, 2, 3] +position_vacancies = [sex_counts['Statutory'][0] + sex_counts["Basic subsidy"][0], + sex_counts["Statutory"][1] + sex_counts["Basic subsidy"][1], + sex_counts["Statutory"][2] + sex_counts["Basic subsidy"][2]] + +fig, ax = plt.subplots() +bottom = np.zeros(3) + +for sex, sex_count in sex_counts.items(): + p = ax.bar(species, sex_count, width=0.6, label=sex, bottom=bottom) + bottom += sex_count + + ax.bar_label(p, label_type='center') + + for rect in p: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 2.001 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + + +# plot = ax.bar(region_num, position_vacancies, width=0.6) +# +# for rect in plot: +# height = rect.get_height() +# ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, +# '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.set_title('Number of penguins by sex') +ax.legend() + +plt.show() diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-6.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-6.py new file mode 100644 index 00000000..b5ead4d5 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-6.py @@ -0,0 +1,43 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Taipei', 'Taichung', 'Kaohsiung') +sex_counts = { + 'Statutory': np.array([73, 34, 61]), + 'Basic subsidy': np.array([73, 34, 58]), +} + +region_num = [1, 2, 3] +position_vacancies = [sex_counts['Statutory'][0] + sex_counts["Basic subsidy"][0], + sex_counts["Statutory"][1] + sex_counts["Basic subsidy"][1], + sex_counts["Statutory"][2] + sex_counts["Basic subsidy"][2]] + +fig, ax = plt.subplots() +bottom = np.zeros(3) + +n = 0 + +for sex, sex_count in sex_counts.items(): + p = ax.bar(species, sex_count, width=0.6, label=sex, bottom=bottom) + bottom += sex_count + + ax.bar_label(p, label_type='center') + + height = p[n].get_height() + ax.text(p[n].get_x() + p[n].get_width() / 2., 2.001 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + + n = n + 1 + + +# plot = ax.bar(region_num, position_vacancies, width=0.6) +# +# for rect in plot: +# height = rect.get_height() +# ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, +# '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.set_title('Number of penguins by sex') +ax.legend() + +plt.show() diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-7.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-7.py new file mode 100644 index 00000000..72c0b45f --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024-7.py @@ -0,0 +1,43 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Taipei', 'Taichung', 'Kaohsiung') +sex_counts = { + 'Statutory': np.array([73, 34, 61]), + 'Basic subsidy': np.array([73, 34, 58]), +} + +region_num = [1, 2, 3] +position_vacancies = [sex_counts['Statutory'][0] + sex_counts["Basic subsidy"][0], + sex_counts["Statutory"][1] + sex_counts["Basic subsidy"][1], + sex_counts["Statutory"][2] + sex_counts["Basic subsidy"][2]] + +fig, ax = plt.subplots(figsize=(6, 7)) +bottom = np.zeros(3) + +n = 0 + +for sex, sex_count in sex_counts.items(): + p = ax.bar(species, sex_count, width=0.6, label=sex, bottom=bottom) + bottom += sex_count + + ax.bar_label(p, label_type='center') + + height = p[n].get_height() + ax.text(p[n].get_x() + p[n].get_width() / 2., 2.001 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + + n = n + 1 + + +# plot = ax.bar(region_num, position_vacancies, width=0.6) +# +# for rect in plot: +# height = rect.get_height() +# ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, +# '%d' % int(height), ha='center', va='bottom', fontsize=12) + +ax.set_title('Number of penguins by sex') +ax.legend() + +plt.show() diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024.py new file mode 100644 index 00000000..ba5269e5 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/2024.py @@ -0,0 +1,24 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Taipei', 'Chinstrap', 'Kaohsiung') +sex_counts = { + 'Statutory': np.array([73, 34, 61]), + 'Basic subsidy': np.array([73, 34, 58]), +} +width = 0.6 # the width of the bars: can also be len(x) sequence + + +fig, ax = plt.subplots() +bottom = np.zeros(3) + +for sex, sex_count in sex_counts.items(): + p = ax.bar(species, sex_count, width, label=sex, bottom=bottom) + bottom += sex_count + + ax.bar_label(p, label_type='center') + +ax.set_title('Number of penguins by sex') +ax.legend() + +plt.show() diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/Sample.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/Sample.py new file mode 100644 index 00000000..92b091c0 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/Sample.py @@ -0,0 +1,26 @@ +import matplotlib.pyplot as plt +import numpy as np + +species = ('Adelie', 'Chinstrap', 'Gentoo') +sex_counts = { + 'Male': np.array([73, 34, 61]), + 'Female': np.array([73, 34, 58]), +} +width = 0.6 # the width of the bars: can also be len(x) sequence + + +fig, ax = plt.subplots() +bottom = np.zeros(3) # 3 species + +for sex, sex_count in sex_counts.items(): + p = ax.bar(species, sex_count, width, label=sex, bottom=bottom) + bottom += sex_count + + ax.bar_label(p, label_type='center') + +ax.set_title('Number of penguins by sex') +ax.legend() + +plt.show() + +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/__init__.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/Composition/bar_label_demo.py b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/bar_label_demo.py new file mode 100644 index 00000000..2e43dbb1 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual local government expenditure/Composition/bar_label_demo.py @@ -0,0 +1,126 @@ +""" +===================== +Bar chart with labels +===================== + +This example shows how to use the `~.Axes.bar_label` helper function +to create bar chart labels. + +See also the :doc:`grouped bar +`, +:doc:`stacked bar +` and +:doc:`horizontal bar chart +` examples. +""" + +import matplotlib.pyplot as plt +import numpy as np + +# %% +# data from https://allisonhorst.github.io/palmerpenguins/ + +species = ('Adelie', 'Chinstrap', 'Gentoo') +sex_counts = { + 'Male': np.array([73, 34, 61]), + 'Female': np.array([73, 34, 58]), +} +width = 0.6 # the width of the bars: can also be len(x) sequence + + +fig, ax = plt.subplots() +bottom = np.zeros(3) + +for sex, sex_count in sex_counts.items(): + p = ax.bar(species, sex_count, width, label=sex, bottom=bottom) + bottom += sex_count + + ax.bar_label(p, label_type='center') + +ax.set_title('Number of penguins by sex') +ax.legend() + +plt.show() + +# %% +# Horizontal bar chart + +# Fixing random state for reproducibility +np.random.seed(19680801) + +# Example data +people = ('Tom', 'Dick', 'Harry', 'Slim', 'Jim') +y_pos = np.arange(len(people)) +performance = 3 + 10 * np.random.rand(len(people)) +error = np.random.rand(len(people)) + +fig, ax = plt.subplots() + +hbars = ax.barh(y_pos, performance, xerr=error, align='center') +ax.set_yticks(y_pos, labels=people) +ax.invert_yaxis() # labels read top-to-bottom +ax.set_xlabel('Performance') +ax.set_title('How fast do you want to go today?') + +# Label with specially formatted floats +ax.bar_label(hbars, fmt='%.2f') +ax.set_xlim(right=15) # adjust xlim to fit labels + +plt.show() + +# %% +# Some of the more advanced things that one can do with bar labels + +fig, ax = plt.subplots() + +hbars = ax.barh(y_pos, performance, xerr=error, align='center') +ax.set_yticks(y_pos, labels=people) +ax.invert_yaxis() # labels read top-to-bottom +ax.set_xlabel('Performance') +ax.set_title('How fast do you want to go today?') + +# Label with given captions, custom padding and annotate options +ax.bar_label(hbars, labels=[f'簣{e:.2f}' for e in error], + padding=8, color='b', fontsize=14) +ax.set_xlim(right=16) + +plt.show() + +# %% +# Bar labels using {}-style format string + +fruit_names = ['Coffee', 'Salted Caramel', 'Pistachio'] +fruit_counts = [4000, 2000, 7000] + +fig, ax = plt.subplots() +bar_container = ax.bar(fruit_names, fruit_counts) +ax.set(ylabel='pints sold', title='Gelato sales by flavor', ylim=(0, 8000)) +ax.bar_label(bar_container, fmt='{:,.0f}') + +# %% +# Bar labels using a callable + +animal_names = ['Lion', 'Gazelle', 'Cheetah'] +mph_speed = [50, 60, 75] + +fig, ax = plt.subplots() +bar_container = ax.bar(animal_names, mph_speed) +ax.set(ylabel='speed in MPH', title='Running speeds', ylim=(0, 80)) +ax.bar_label(bar_container, fmt=lambda x: f'{x * 1.61:.1f} km/h') + +# %% +# +# .. admonition:: References +# +# The use of the following functions, methods, classes and modules is shown +# in this example: +# +# - `matplotlib.axes.Axes.bar` / `matplotlib.pyplot.bar` +# - `matplotlib.axes.Axes.barh` / `matplotlib.pyplot.barh` +# - `matplotlib.axes.Axes.bar_label` / `matplotlib.pyplot.bar_label` +# +# .. tags:: +# +# component: label +# plot-type: bar +# level: beginner diff --git a/The attainments and realizations of my dreams/Annual local government expenditure/__init__.py b/The attainments and realizations of my dreams/Annual local government expenditure/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2017 all.py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2017 all.py new file mode 100644 index 00000000..509463a0 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2017 all.py @@ -0,0 +1,38 @@ +import matplotlib.pyplot as plt +import numpy as np +import matplotlib.image as image + +plt.rcdefaults() + +fig, ax = plt.subplots(figsize=(7, 11)) + +city = ('Taipei', 'New Taipei', 'Taoyuan', 'Taichung', 'Tainan', 'Kaohsiung', 'Hsinchu', 'Miaoli', + 'Changhua', 'Nantou', 'Yunlin', 'Chiayi', 'Pingtung', 'Yilan', 'Hualien', 'Taitung') + +y_pos = np.arange(len(city)) + +births = [25042, 31611, 23356, 24338, 13773, 20260, (4287+4953), 3844, 13070, 3336, 4533, (1924+2803), + 4824, 3328, 2372, 1484] + +error = np.random.rand(len(city)) + +horizontal_bar = ax.barh(y_pos, births, xerr=error, align='center') +ax.set_yticks(y_pos, labels=city) +ax.invert_yaxis() # labels read top-to-bottom +ax.set_xlabel("# of births\nReference: https://statis.moi.gov.tw/micst/stmain.jsp?sys=100") +ax.set_title('The number of births in Taiwan by administrative division (2017) ') + +# Label with given captions, custom padding and annotate options +ax.bar_label(horizontal_bar, labels=births, padding=8, color='b', fontsize=14) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=650, alpha=0.9) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html + +# Data: +# https://statis.moi.gov.tw/micst/stmain.jsp?sys=220&ym=10600&ymt=10600&kind=21&type=1&funid=c0120101&cycle=41&outmode=0&compmode=0&outkind=1&fld0=1&codspc0=0,2,3,2,6,1,9,1,12,1,15,14,&rdm=immoqeji diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2017.py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2017.py new file mode 100644 index 00000000..cdf8764f --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2017.py @@ -0,0 +1,32 @@ +import matplotlib.pyplot as plt +import numpy as np +import matplotlib.image as image + +plt.rcdefaults() + +fig, ax = plt.subplots(figsize=(7, 7)) + +city = ('Taipei', 'New Taipei', 'Taoyuan', 'Taichung', 'Tainan', 'Kaohsiung') +y_pos = np.arange(len(city)) +births = [25042, 31611, 23356, 24338, 13773, 20260] +error = np.random.rand(len(city)) + +horizontal_bar = ax.barh(y_pos, births, xerr=error, align='center') +ax.set_yticks(y_pos, labels=city) +ax.invert_yaxis() # labels read top-to-bottom +ax.set_xlabel("# of births\nReference: https://statis.moi.gov.tw/micst/stmain.jsp?sys=100") +ax.set_title('The number of births in Taiwan by city (2017)') + +# Label with given captions, custom padding and annotate options +ax.bar_label(horizontal_bar, labels=births, padding=8, color='b', fontsize=14) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=650, alpha=0.9) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html + +# Data: https://statis.moi.gov.tw/micst/stmain.jsp?sys=220&ym=10600&ymt=10600&kind=21&type=1&funid=c0120101&cycle=41&outmode=0&compmode=0&outkind=1&fld0=1&codspc0=0,2,3,2,6,1,9,1,12,1,15,14,&rdm=immoqeji diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2022 watermark (1).py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2022 watermark (1).py new file mode 100644 index 00000000..c34a095a --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2022 watermark (1).py @@ -0,0 +1,30 @@ +import matplotlib.pyplot as plt +import numpy as np +import matplotlib.image as image + +plt.rcdefaults() + +fig, ax = plt.subplots(figsize=(7, 7)) + +city = ('Taipei', 'New Taipei', 'Taoyuan', 'Taichung', 'Tainan', 'Kaohsiung') +y_pos = np.arange(len(city)) +births = [8297, 12111, 10216, 9955, 5078, 9013] +error = np.random.rand(len(city)) + +horizontal_bar = ax.barh(y_pos, births, xerr=error, align='center') +ax.set_yticks(y_pos, labels=city) +ax.invert_yaxis() # labels read top-to-bottom +ax.set_xlabel("# of births\nReference: https://statis.moi.gov.tw/micst/stmain.jsp?sys=100") +ax.set_title('The number of births in Taiwan by city (2022/01-07) ') + +# Label with given captions, custom padding and annotate options +ax.bar_label(horizontal_bar, labels=births, padding=8, color='b', fontsize=14) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=650, alpha=0.9) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2022 watermark (2).py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2022 watermark (2).py new file mode 100644 index 00000000..fef7a0b6 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2022 watermark (2).py @@ -0,0 +1,35 @@ +import matplotlib.pyplot as plt +import numpy as np +import matplotlib.image as image + +plt.rcdefaults() + +fig, ax = plt.subplots(figsize=(7, 11)) + +city = ('Taipei', 'New Taipei', 'Taoyuan', 'Taichung', 'Tainan', 'Kaohsiung', 'Hsinchu', 'Miaoli', + 'Changhua', 'Nantou', 'Yunlin', 'Chiayi', 'Pingtung', 'Yilan', 'Hualien', 'Taitung') + +y_pos = np.arange(len(city)) + +births = [8297, 12111, 10216, 9955, 5078, 9013, (1732+2320), 1309, 5663, 1340, 1892, (682+1275), 2050, + 1364, 1123, 757] + +error = np.random.rand(len(city)) + +horizontal_bar = ax.barh(y_pos, births, xerr=error, align='center') +ax.set_yticks(y_pos, labels=city) +ax.invert_yaxis() # labels read top-to-bottom +ax.set_xlabel("# of births\nReference: https://statis.moi.gov.tw/micst/stmain.jsp?sys=100") +ax.set_title('The number of births by administrative division (2022/01-07) ') + +# Label with given captions, custom padding and annotate options +ax.bar_label(horizontal_bar, labels=births, padding=8, color='b', fontsize=14) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=650, alpha=0.9) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2022 watermark (3).py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2022 watermark (3).py new file mode 100644 index 00000000..bc0ead69 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2022 watermark (3).py @@ -0,0 +1,35 @@ +import matplotlib.pyplot as plt +import numpy as np +import matplotlib.image as image + +plt.rcdefaults() + +fig, ax = plt.subplots(figsize=(7, 11)) + +city = ('Taipei', 'New Taipei', 'Taoyuan', 'Taichung', 'Tainan', 'Kaohsiung', 'Hsinchu', 'Miaoli', + 'Changhua', 'Nantou', 'Yunlin', 'Chiayi', 'Pingtung', 'Yilan', 'Hualien', 'Taitung') + +y_pos = np.arange(len(city)) + +births = [8297, 12111, 10216, 9955, 5078, 9013, (1732+2320), 1309, 5663, 1340, 1892, (682+1275), 2050, + 1364, 1123, 757] + +error = np.random.rand(len(city)) + +horizontal_bar = ax.barh(y_pos, births, xerr=error, align='center') +ax.set_yticks(y_pos, labels=city) +ax.invert_yaxis() # labels read top-to-bottom +ax.set_xlabel("# of births\nReference: https://statis.moi.gov.tw/micst/stmain.jsp?sys=100") +ax.set_title('The number of births in Taiwan by administrative division (2022/01-07) ') + +# Label with given captions, custom padding and annotate options +ax.bar_label(horizontal_bar, labels=births, padding=8, color='b', fontsize=14) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=650, alpha=0.9) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2022 watermark.py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2022 watermark.py new file mode 100644 index 00000000..cdf19e4f --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2022 watermark.py @@ -0,0 +1,30 @@ +import matplotlib.pyplot as plt +import numpy as np +import matplotlib.image as image + +plt.rcdefaults() + +fig, ax = plt.subplots(figsize=(7, 7)) + +city = ('Taipei', 'New Taipei', 'Taoyuan', 'Taichung', 'Tainan', 'Kaohsiung') +y_pos = np.arange(len(city)) +births = [8297, 12111, 10216, 9955, 5078, 9013] +error = np.random.rand(len(city)) + +horizontal_bar = ax.barh(y_pos, births, xerr=error, align='center') +ax.set_yticks(y_pos, labels=city) +ax.invert_yaxis() # labels read top-to-bottom +ax.set_xlabel("# of births\nReference: https://statis.moi.gov.tw/micst/stmain.jsp?sys=100") +ax.set_title('The number of births by city (2022/01-07) ') + +# Label with given captions, custom padding and annotate options +ax.bar_label(horizontal_bar, labels=births, padding=8, color='b', fontsize=14) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=650, alpha=0.9) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2022.py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2022.py new file mode 100644 index 00000000..944e3cac --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/Annual 2022.py @@ -0,0 +1,25 @@ +import matplotlib.pyplot as plt +import numpy as np + +plt.rcdefaults() + +fig, ax = plt.subplots(figsize=(7, 7)) + +city = ('Taipei', 'New Taipei', 'Taoyuan', 'Taichung', 'Tainan', 'Kaohsiung') +y_pos = np.arange(len(city)) +births = [8297, 12111, 10216, 9955, 5078, 9013] +error = np.random.rand(len(city)) + +horizontal_bar = ax.barh(y_pos, births, xerr=error, align='center') +ax.set_yticks(y_pos, labels=city) +ax.invert_yaxis() # labels read top-to-bottom +ax.set_xlabel("# of births\nReference: https://statis.moi.gov.tw/micst/stmain.jsp?sys=100") +ax.set_title('The number of births by city (2022/01-07) ') + +# Label with given captions, custom padding and annotate options +ax.bar_label(horizontal_bar, labels=births, padding=8, color='b', fontsize=14) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/CC-BY.png b/The attainments and realizations of my dreams/Annual number of births in Taiwan/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Annual number of births in Taiwan/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/CC0.png b/The attainments and realizations of my dreams/Annual number of births in Taiwan/CC0.png new file mode 100644 index 00000000..10986298 Binary files /dev/null and b/The attainments and realizations of my dreams/Annual number of births in Taiwan/CC0.png differ diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022.py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022.py new file mode 100644 index 00000000..219e895e --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022.py @@ -0,0 +1,98 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + + +def gradient_image(ax, extent, direction=0.3, cmap_range=(0, 1), **kwargs): + """ + Draw a gradient image based on a colormap. + + Parameters + ---------- + ax : Axes + The axes to draw on. + extent + The extent of the image as (xmin, xmax, ymin, ymax). + By default, this is in Axes coordinates but may be + changed using the *transform* keyword argument. + direction : float + The direction of the gradient. This is a number in + range 0 (=vertical) to 1 (=horizontal). + cmap_range : float, float + The fraction (cmin, cmax) of the colormap that should be + used for the gradient, where the complete colormap is (0, 1). + **kwargs + Other parameters are passed on to `.Axes.imshow()`. + In particular useful is *cmap*. + """ + phi = direction * np.pi / 2 + v = np.array([np.cos(phi), np.sin(phi)]) + X = np.array([[v @ [1, 0], v @ [1, 1]], + [v @ [0, 0], v @ [0, 1]]]) + a, b = cmap_range + X = a + (b - a) / X.max() * X + im = ax.imshow(X, extent=extent, interpolation='bicubic', + vmin=0, vmax=1, **kwargs) + return im + + +def gradient_bar(ax, x, y, width=0.5, bottom=0): + for left, top in zip(x, y): + right = left + width + gradient_image(ax, extent=(left, right, bottom, top), cmap=plt.cm.Blues_r, cmap_range=(0, 0.8)) + + + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137, 9617, 12788, 11222, 9442, 10943, 10950)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(8, 7)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, '%d' % int(height), + ha='center', va='bottom', fontsize=12) + + +# background image +gradient_image(axe, direction=1, extent=(0, 1, 0, 1), transform=axe.transAxes, cmap=plt.cm.RdYlGn, + cmap_range=(0.2, 0.8), alpha=0.5) + + +# gradient_bar(ax=axe, x=year_number, y=number_of_births, width=0.7) + +axe.set_title(label="1994-2022/07 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) +# axe.set_ylabel("The number of births") +axe.set_xlabel("Year") +axe.set_aspect('auto') + +# xmin, xmax = xlim = 0, 10 +ymin, ymax = ylim = 150000, 330000 + +axe.set(ylim=ylim, autoscale_on=False) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/gallery/lines_bars_and_markers/gradient_bar.html +# 2. https://numpy.org/doc/stable/reference/generated/numpy.arange.html + +# Data: https://statis.moi.gov.tw/micst/stmain.jsp?sys=220&ym=8300&ymt=11000&kind=21&type=1&funid=c0120101&cycle=4&outmode=0&compmode=0&outkind=1&fld0=1&cod00=1&rdm=fu0Necq9 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(10).py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(10).py new file mode 100644 index 00000000..bcee7a84 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(10).py @@ -0,0 +1,56 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np + +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137 + 9617 + 12788 + 11222 + 9442 + 10943 + 10950)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(24, 12)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12, rotation=4) + +axe.set_title(label="1994-2022/07 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) + +# axe.set_ylabel("The number of births") +axe.set_xlabel("Year") + +axe.set_ylim(78000, 330000) + +plt.margins(x=0, y=0, tight=False) # [1][2] +fig.tight_layout() # [3] + +text = fig.text(0.5, 0.7, + 'Reference:https://statis.moi.gov.tw/micst/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +plt.show() + +# References: +# 1. https://www.google.com/search?q=matplotlib+margins +# 2. https://matplotlib.org/3.1.1/gallery/subplots_axes_and_figures/axes_margins.html +# 3. https://stackoverflow.com/a/4046233 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(11).py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(11).py new file mode 100644 index 00000000..cc1f4837 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(11).py @@ -0,0 +1,57 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +import matplotlib.colors as colour + +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137 + 9617 + 12788 + 11222 + 9442 + 10943 + 10950)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(24, 12)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3, color=colour.CSS4_COLORS.get('pink')) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12, rotation=4) + +axe.set_title(label="1994-2022/07 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) + +# axe.set_ylabel("The number of births") +axe.set_xlabel("Year") + +axe.set_ylim(78000, 330000) + +plt.margins(x=0, y=0, tight=False) # [1][2] +fig.tight_layout() # [3] + +text = fig.text(0.5, 0.7, + 'Reference:https://statis.moi.gov.tw/micst/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +plt.show() + +# References: +# 1. https://www.google.com/search?q=matplotlib+margins +# 2. https://matplotlib.org/3.1.1/gallery/subplots_axes_and_figures/axes_margins.html +# 3. https://stackoverflow.com/a/4046233 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(12).py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(12).py new file mode 100644 index 00000000..0446d6c0 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(12).py @@ -0,0 +1,63 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +import matplotlib.colors as colour +import matplotlib.image as image + +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137 + 9617 + 12788 + 11222 + 9442 + 10943 + 10950)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(24, 12)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3, color=colour.CSS4_COLORS.get('pink')) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12, rotation=4) + +axe.set_title(label="1994-2022/07 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) + +# axe.set_ylabel("The number of births") +axe.set_xlabel("Year") + +axe.set_ylim(78000, 330000) + +plt.margins(x=0, y=0, tight=False) # [1][2] +fig.tight_layout() # [3] + +text = fig.text(0.5, 0.7, + 'Reference:https://statis.moi.gov.tw/micst/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=2000, yo=850, alpha=0.9) + +plt.show() + +# References: +# 1. https://www.google.com/search?q=matplotlib+margins +# 2. https://matplotlib.org/3.1.1/gallery/subplots_axes_and_figures/axes_margins.html +# 3. https://stackoverflow.com/a/4046233 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(13).py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(13).py new file mode 100644 index 00000000..88b8d7bd --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(13).py @@ -0,0 +1,63 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +import matplotlib.colors as colour +import matplotlib.image as image + +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137 + 9617 + 12788 + 11222 + 9442 + 10943 + 10950)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(24, 13)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3, color=colour.CSS4_COLORS.get('pink')) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12, rotation=4) + +axe.set_title(label="1994-2022/07 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) + +axe.set_ylabel("The number of births (Unit: 1 baby)") +axe.set_xlabel("Year") + +axe.set_ylim(78000, 330000) + +plt.margins(x=0, y=0, tight=False) # [1][2] +fig.tight_layout() # [3] + +text = fig.text(0.5, 0.7, + 'Reference:https://statis.moi.gov.tw/micst/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=2000, yo=850, alpha=0.9) + +plt.show() + +# References: +# 1. https://www.google.com/search?q=matplotlib+margins +# 2. https://matplotlib.org/3.1.1/gallery/subplots_axes_and_figures/axes_margins.html +# 3. https://stackoverflow.com/a/4046233 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(14).py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(14).py new file mode 100644 index 00000000..a5a9ef67 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(14).py @@ -0,0 +1,63 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +import matplotlib.colors as colour +import matplotlib.image as image + +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137 + 9617 + 12788 + 11222 + 9442 + 10943 + 10950)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(24, 13)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3, color=colour.CSS4_COLORS.get('pink')) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12, rotation=4) + +axe.set_title(label="1994-2022/07 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) + +axe.set_ylabel("The number of births (Unit: 1 baby)") +axe.set_xlabel("Year") + +axe.set_ylim(78000, 330000) + +plt.margins(x=0, y=0, tight=False) # [1][2] +fig.tight_layout() # [3] + +text = fig.text(0.5, 0.7, + 'Reference:https://statis.moi.gov.tw/micst/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=2000, yo=900, alpha=0.9) + +plt.show() + +# References: +# 1. https://www.google.com/search?q=matplotlib+margins +# 2. https://matplotlib.org/3.1.1/gallery/subplots_axes_and_figures/axes_margins.html +# 3. https://stackoverflow.com/a/4046233 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(15).py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(15).py new file mode 100644 index 00000000..5b460e71 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(15).py @@ -0,0 +1,64 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +import matplotlib.colors as colour +import matplotlib.image as image + +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, 138986] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(24, 13)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3, color=colour.CSS4_COLORS.get('pink')) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12, rotation=4) + +axe.set_title(label="1994-2022 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) + +axe.set_ylabel("The number of births (Unit: 1 baby)") +axe.set_xlabel("Year") + +axe.set_ylim(78000, 330000) + +plt.margins(x=0, y=0, tight=False) # [1][2] +fig.tight_layout() # [3] + +text = fig.text(0.5, 0.7, + 'Reference:https://statis.moi.gov.tw/micst/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=2000, yo=900, alpha=0.9) + +plt.show() + +# References: +# 1. https://www.google.com/search?q=matplotlib+margins +# 2. https://matplotlib.org/3.1.1/gallery/subplots_axes_and_figures/axes_margins.html +# 3. https://stackoverflow.com/a/4046233 +# 4. https://megalodon.jp/2023-0111-1850-35/https://www.cna.com.tw:443/news/ahel/202301115001.aspx +# 5. https://megalodon.jp/2023-0111-1851-27/https://www.cna.com.tw:443/news/ahel/202301100042.aspx diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(2).py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(2).py new file mode 100644 index 00000000..5388d49b --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(2).py @@ -0,0 +1,47 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137 + 9617 + 12788 + 11222 + 9442 + 10943 + 10950)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(20, 8)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + + +axe.set_title(label="1994-2022/07 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) + +# axe.set_ylabel("The number of births") +axe.set_xlabel("Year") + +axe.set_ylim(100000, 330000) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/gallery/lines_bars_and_markers/gradient_bar.html +# 2. https://numpy.org/doc/stable/reference/generated/numpy.arange.html + +# Data: https://statis.moi.gov.tw/micst/stmain.jsp?sys=220&ym=8300&ymt=11000&kind=21&type=1&funid=c0120101&cycle=4&outmode=0&compmode=0&outkind=1&fld0=1&cod00=1&rdm=fu0Necq9 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(3).py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(3).py new file mode 100644 index 00000000..f4cb28bb --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(3).py @@ -0,0 +1,45 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137 + 9617 + 12788 + 11222 + 9442 + 10943 + 10950)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(20, 8)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='edge') # Keep bars from cramming themselves into the center. [1][2] + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + + +axe.set_title(label="1994-2022/07 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) + +# axe.set_ylabel("The number of births") +axe.set_xlabel("Year") + +axe.set_ylim(100000, 330000) + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/40575741/ +# 2. https://stackoverflow.com/a/20454355 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(4).py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(4).py new file mode 100644 index 00000000..39d9d83c --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(4).py @@ -0,0 +1,45 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137 + 9617 + 12788 + 11222 + 9442 + 10943 + 10950)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(20, 8)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3) # Keep bars from cramming themselves into the center. [1][2] + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + + +axe.set_title(label="1994-2022/07 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) + +# axe.set_ylabel("The number of births") +axe.set_xlabel("Year") + +axe.set_ylim(100000, 330000) + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/40575741/ +# 2. https://stackoverflow.com/a/20454355 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(5).py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(5).py new file mode 100644 index 00000000..8d26773c --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(5).py @@ -0,0 +1,45 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137 + 9617 + 12788 + 11222 + 9442 + 10943 + 10950)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(24, 10)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3) # Keep bars from cramming themselves into the center. [1][2] + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + + +axe.set_title(label="1994-2022/07 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) + +# axe.set_ylabel("The number of births") +axe.set_xlabel("Year") + +axe.set_ylim(78000, 330000) + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/40575741/ +# 2. https://stackoverflow.com/a/20454355 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(6).py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(6).py new file mode 100644 index 00000000..247fe937 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(6).py @@ -0,0 +1,45 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137 + 9617 + 12788 + 11222 + 9442 + 10943 + 10950)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(24, 10)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3) # Keep bars from cramming themselves into the center. [1][2] + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12, rotation=4) + + +axe.set_title(label="1994-2022/07 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) + +# axe.set_ylabel("The number of births") +axe.set_xlabel("Year") + +axe.set_ylim(78000, 330000) + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/40575741/ +# 2. https://stackoverflow.com/a/20454355 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(7).py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(7).py new file mode 100644 index 00000000..e7a61691 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(7).py @@ -0,0 +1,47 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137 + 9617 + 12788 + 11222 + 9442 + 10943 + 10950)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(24, 10)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12, rotation=4) + + +axe.set_title(label="1994-2022/07 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) + +# axe.set_ylabel("The number of births") +axe.set_xlabel("Year") + +axe.set_ylim(78000, 330000) + +plt.margins(x=0, y=0, tight=False) #[1][2] + +plt.show() + +# References: +# 1. https://www.google.com/search?q=matplotlib+margins +# 2. https://matplotlib.org/3.1.1/gallery/subplots_axes_and_figures/axes_margins.html diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(8).py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(8).py new file mode 100644 index 00000000..5682a43c --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(8).py @@ -0,0 +1,49 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137 + 9617 + 12788 + 11222 + 9442 + 10943 + 10950)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(24, 10)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12, rotation=4) + + +axe.set_title(label="1994-2022/07 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) + +# axe.set_ylabel("The number of births") +axe.set_xlabel("Year") + +axe.set_ylim(78000, 330000) + +plt.margins(x=0, y=0, tight=False) #[1][2] +fig.tight_layout() # [3] + +plt.show() + +# References: +# 1. https://www.google.com/search?q=matplotlib+margins +# 2. https://matplotlib.org/3.1.1/gallery/subplots_axes_and_figures/axes_margins.html +# 3. https://stackoverflow.com/a/4046233 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(9).py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(9).py new file mode 100644 index 00000000..83918baa --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_(9).py @@ -0,0 +1,56 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np + +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137 + 9617 + 12788 + 11222 + 9442 + 10943 + 10950)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(24, 10)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12, rotation=4) + +axe.set_title(label="1994-2022/07 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) + +# axe.set_ylabel("The number of births") +axe.set_xlabel("Year") + +axe.set_ylim(78000, 330000) + +plt.margins(x=0, y=0, tight=False) # [1][2] +fig.tight_layout() # [3] + +text = fig.text(0.5, 0.7, + 'Reference:https://statis.moi.gov.tw/micst/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +plt.show() + +# References: +# 1. https://www.google.com/search?q=matplotlib+margins +# 2. https://matplotlib.org/3.1.1/gallery/subplots_axes_and_figures/axes_margins.html +# 3. https://stackoverflow.com/a/4046233 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_August.py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_August.py new file mode 100644 index 00000000..237c2579 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_August.py @@ -0,0 +1,67 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +import matplotlib.colors as colour +import matplotlib.image as image + +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137 + 9617 + 12788 + 11222 + 9442 + 10943 + 10950 + 11902)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(24, 13)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3, color=colour.CSS4_COLORS.get('pink')) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12, rotation=4) + +axe.set_title(label="1994-2022/08 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) + +axe.set_ylabel("The number of births (Unit: 1 baby)") +axe.set_xlabel("Year") + +axe.set_ylim(78000, 330000) + +plt.margins(x=0, y=0, tight=False) # [1][2] +fig.tight_layout() # [3] + +text = fig.text(0.5, 0.7, + 'Reference:https://statis.moi.gov.tw/micst/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=2000, yo=900, alpha=0.9) + +plt.text(x=0.2, y=0.4, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='30', + transform=axe.transAxes) + +plt.show() + +# References: +# 1. https://www.google.com/search?q=matplotlib+margins +# 2. https://matplotlib.org/3.1.1/gallery/subplots_axes_and_figures/axes_margins.html +# 3. https://stackoverflow.com/a/4046233 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_September.py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_September.py new file mode 100644 index 00000000..beb325e5 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_September.py @@ -0,0 +1,67 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +import matplotlib.colors as colour +import matplotlib.image as image + +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137 + 9617 + 12788 + 11222 + 9442 + 10943 + 10950 + 11902 + 12217)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(24, 13)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3, color=colour.CSS4_COLORS.get('pink')) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12, rotation=4) + +axe.set_title(label="1994-2022/09 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) + +axe.set_ylabel("The number of births (Unit: 1 baby)") +axe.set_xlabel("Year") + +axe.set_ylim(78000, 330000) + +plt.margins(x=0, y=0, tight=False) # [1][2] +fig.tight_layout() # [3] + +text = fig.text(0.5, 0.7, + 'Reference:https://statis.moi.gov.tw/micst/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=2000, yo=900, alpha=0.9) + +plt.text(x=0.2, y=0.4, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='30', + transform=axe.transAxes) + +plt.show() + +# References: +# 1. https://www.google.com/search?q=matplotlib+margins +# 2. https://matplotlib.org/3.1.1/gallery/subplots_axes_and_figures/axes_margins.html +# 3. https://stackoverflow.com/a/4046233 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_September_2.py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_September_2.py new file mode 100644 index 00000000..63e5517e --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2022_September_2.py @@ -0,0 +1,67 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +import matplotlib.colors as colour +import matplotlib.image as image + +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137 + 9617 + 12788 + 11222 + 9442 + 10943 + 10950 + 11902 + 12217)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(24, 13)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3, color=colour.CSS4_COLORS.get('pink')) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12, rotation=4) + +axe.set_title(label="1994-2022/09 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) + +axe.set_ylabel("The number of births (Unit: 1 baby)") +axe.set_xlabel("Year") + +axe.set_ylim(78000, 330000) + +plt.margins(x=0, y=0, tight=False) # [1][2] +fig.tight_layout() # [3] + +text = fig.text(0.5, 0.7, + 'Reference:https://statis.moi.gov.tw/micst/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=2000, yo=900, alpha=0.9) + +plt.text(x=0.2, y=0.4, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=axe.transAxes) + +plt.show() + +# References: +# 1. https://www.google.com/search?q=matplotlib+margins +# 2. https://matplotlib.org/3.1.1/gallery/subplots_axes_and_figures/axes_margins.html +# 3. https://stackoverflow.com/a/4046233 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2024_August.py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2024_August.py new file mode 100644 index 00000000..b33d7dda --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2024_August.py @@ -0,0 +1,67 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +import matplotlib.colors as colour +import matplotlib.image as image + +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, 138986, 135571, + (63874+10424+11643)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22", "23", "24"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(24, 13)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3, color=colour.CSS4_COLORS.get('pink')) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12, rotation=4) + +axe.set_title(label="1994-2024/08 啁撟游漲箇鈭箸稞n Annual number of new-born neonates in Taiwan", fontsize=20) + +axe.set_ylabel("The number of births (Unit: 1 baby)") +axe.set_xlabel("Year") + +axe.set_ylim(78000, 330000) + +plt.margins(x=0, y=0, tight=False) # [1][2] +fig.tight_layout() # [3] + +text = fig.text(0.5, 0.7, + 'References:https://www.ris.gov.tw/app/en/3910\nhttps://www.cna.com.tw/news/ahel/202409100318.aspx\nhttps://www.ris.gov.tw/app/portal/2121?sn=24222733', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + + +img = image.imread('CC0.png') + +plt.figimage(X=img, xo=2000, yo=900, alpha=0.9) + +plt.text(x=0.2, y=0.4, s="CC0 No Copyright\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, #rotation='30', + transform=axe.transAxes) + +plt.show() + +# References: +# 1. https://www.google.com/search?q=matplotlib+margins +# 2. https://matplotlib.org/3.1.1/gallery/subplots_axes_and_figures/axes_margins.html +# 3. https://stackoverflow.com/a/4046233 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2024_July.py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2024_July.py new file mode 100644 index 00000000..9883566f --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2024_July.py @@ -0,0 +1,67 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +import matplotlib.colors as colour +import matplotlib.image as image + +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, 138986, 135571, + (63874+10424)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22", "23", "24"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(24, 13)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3, color=colour.CSS4_COLORS.get('pink')) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12, rotation=4) + +axe.set_title(label="1994-2024/07 啁撟游漲箇鈭箸稞n Annual number of new-born neonates in Taiwan", fontsize=20) + +axe.set_ylabel("The number of births (Unit: 1 baby)") +axe.set_xlabel("Year") + +axe.set_ylim(78000, 330000) + +plt.margins(x=0, y=0, tight=False) # [1][2] +fig.tight_layout() # [3] + +text = fig.text(0.5, 0.7, + 'Reference:https://www.ris.gov.tw/app/en/3910\nhttps://ec.ltn.com.tw/article/paper/1656441\nhttps://www.ris.gov.tw/app/portal/2121?sn=24222733', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=2000, yo=900, alpha=0.9) + +plt.text(x=0.2, y=0.4, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, #rotation='30', + transform=axe.transAxes) + +plt.show() + +# References: +# 1. https://www.google.com/search?q=matplotlib+margins +# 2. https://matplotlib.org/3.1.1/gallery/subplots_axes_and_figures/axes_margins.html +# 3. https://stackoverflow.com/a/4046233 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2024_July_2.py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2024_July_2.py new file mode 100644 index 00000000..2af993f1 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2024_July_2.py @@ -0,0 +1,67 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +import matplotlib.colors as colour +import matplotlib.image as image + +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, 138986, 135571, + (63874+10424)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22", "23", "24"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(24, 13)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3, color=colour.CSS4_COLORS.get('pink')) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12, rotation=4) + +axe.set_title(label="1994-2024/07 啁撟游漲箇鈭箸稞n Annual number of new-born neonates in Taiwan", fontsize=20) + +axe.set_ylabel("The number of births (Unit: 1 baby)") +axe.set_xlabel("Year") + +axe.set_ylim(78000, 330000) + +plt.margins(x=0, y=0, tight=False) # [1][2] +fig.tight_layout() # [3] + +text = fig.text(0.5, 0.7, + 'References:https://www.ris.gov.tw/app/en/3910\nhttps://ec.ltn.com.tw/article/paper/1656441\nhttps://www.ris.gov.tw/app/portal/2121?sn=24222733', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + + +img = image.imread('CC0.png') + +plt.figimage(X=img, xo=2000, yo=900, alpha=0.9) + +plt.text(x=0.2, y=0.4, s="CC0 No Copyright\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, #rotation='30', + transform=axe.transAxes) + +plt.show() + +# References: +# 1. https://www.google.com/search?q=matplotlib+margins +# 2. https://matplotlib.org/3.1.1/gallery/subplots_axes_and_figures/axes_margins.html +# 3. https://stackoverflow.com/a/4046233 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2024_September.py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2024_September.py new file mode 100644 index 00000000..05892f5a --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births 1994-2024_September.py @@ -0,0 +1,67 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np +import matplotlib.colors as colour +import matplotlib.image as image + +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31] + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, 138986, 135571, + (63874+10424+11643+11792)] + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22", "23", "24"] + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(24, 13)) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plot = axe.bar(year_number, number_of_births, align='center', width=0.3, color=colour.CSS4_COLORS.get('pink')) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12, rotation=4) + +axe.set_title(label="1994-2024/09 啁撟游漲箇鈭箸稞n Annual number of new-born neonates in Taiwan", fontsize=20) + +axe.set_ylabel("The number of births (Unit: 1 baby)") +axe.set_xlabel("Year") + +axe.set_ylim(78000, 330000) + +plt.margins(x=0, y=0, tight=False) # [1][2] +fig.tight_layout() # [3] + +text = fig.text(0.5, 0.7, + 'References:https://www.ris.gov.tw/app/en/3910\nhttps://www.ris.gov.tw/app/portal/2121?sn=24222733', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + + +img = image.imread('CC0.png') + +plt.figimage(X=img, xo=2000, yo=900, alpha=0.9) + +plt.text(x=0.2, y=0.4, s="CC0 No Copyright\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, #rotation='30', + transform=axe.transAxes) + +plt.show() + +# References: +# 1. https://www.google.com/search?q=matplotlib+margins +# 2. https://matplotlib.org/3.1.1/gallery/subplots_axes_and_figures/axes_margins.html +# 3. https://stackoverflow.com/a/4046233 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births till 2020.py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births till 2020.py new file mode 100644 index 00000000..4b9c8981 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births till 2020.py @@ -0,0 +1,3 @@ +import pandas as pd +import matplotlib.pyplot as plt + diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births till 2021.py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births till 2021.py new file mode 100644 index 00000000..07311eeb --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births till 2021.py @@ -0,0 +1,105 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np + +matplotlib.rc('font', family="MS Gothic") + + +def gradient_image(ax, extent, direction=0.3, cmap_range=(0, 1), **kwargs): + """ + Draw a gradient image based on a colormap. + + Parameters + ---------- + ax : Axes + The axes to draw on. + extent + The extent of the image as (xmin, xmax, ymin, ymax). + By default, this is in Axes coordinates but may be + changed using the *transform* keyword argument. + direction : float + The direction of the gradient. This is a number in + range 0 (=vertical) to 1 (=horizontal). + cmap_range : float, float + The fraction (cmin, cmax) of the colormap that should be + used for the gradient, where the complete colormap is (0, 1). + **kwargs + Other parameters are passed on to `.Axes.imshow()`. + In particular useful is *cmap*. + """ + phi = direction * np.pi / 2 + v = np.array([np.cos(phi), np.sin(phi)]) + X = np.array([[v @ [1, 0], v @ [1, 1]], + [v @ [0, 0], v @ [0, 1]]]) + a, b = cmap_range + X = a + (b - a) / X.max() * X + im = ax.imshow(X, extent=extent, interpolation='bicubic', + vmin=0, vmax=1, **kwargs) + return im + + +def gradient_bar(ax, x, y, width=0.5, bottom=0): + for left, top in zip(x, y): + right = left + width + gradient_image(ax, extent=(left, right, bottom, top), cmap=plt.cm.Blues_r, cmap_range=(0, 0.8)) + + +# arange automatically balloons into a list with 29 elements from 1 to 28. [2] +year_num = np.arange(1, 30, 1) +print(year_num) + +year_num = list(year_num) + +year_num2 = range(1, 30, 1) +print(year_num2) + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] + +year_number2 = [] + +for i in np.arange(1, 30, 1): + year_number2.append(i) + +print(year_number2) + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137, 9617, 12788, 11222, 9442, 10943, 10950)] + +label_year = np.arange(1994, 2023, 1) +print(label_year) + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +# xmin, xmax = xlim = 0, 10 +ymin, ymax = ylim = 150000, 330000 + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(8, 7)) +axe.set(ylim=ylim, autoscale_on=False) + +# background image +gradient_image(axe, direction=1, extent=(0, 1, 0, 1), transform=axe.transAxes, cmap=plt.cm.RdYlGn, + cmap_range=(0.2, 0.8), alpha=0.5) + + +axe.set_aspect('auto') +axe.set_xlabel("Year") +axe.set_ylabel("The number of births") +axe.set_title(label="1994-2022/07 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) + +plt.xticks(year_num, labels=label_year_text, rotation=7, fontsize=12) +plt.tick_params(axis='y', labelsize=12) + +gradient_bar(ax=axe, x=year_num, y=number_of_births, width=0.7) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/gallery/lines_bars_and_markers/gradient_bar.html +# 2. https://numpy.org/doc/stable/reference/generated/numpy.arange.html + +# Data: https://statis.moi.gov.tw/micst/stmain.jsp?sys=220&ym=8300&ymt=11000&kind=21&type=1&funid=c0120101&cycle=4&outmode=0&compmode=0&outkind=1&fld0=1&cod00=1&rdm=fu0Necq9 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births till 2022.py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births till 2022.py new file mode 100644 index 00000000..ff9c20e1 --- /dev/null +++ b/The attainments and realizations of my dreams/Annual number of births in Taiwan/The number of births till 2022.py @@ -0,0 +1,120 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib +import numpy as np + +matplotlib.rc('font', family="MS Gothic") + + +def gradient_image(ax, extent, direction=0.3, cmap_range=(0, 1), **kwargs): + """ + Draw a gradient image based on a colormap. + + Parameters + ---------- + ax : Axes + The axes to draw on. + extent + The extent of the image as (xmin, xmax, ymin, ymax). + By default, this is in Axes coordinates but may be + changed using the *transform* keyword argument. + direction : float + The direction of the gradient. This is a number in + range 0 (=vertical) to 1 (=horizontal). + cmap_range : float, float + The fraction (cmin, cmax) of the colormap that should be + used for the gradient, where the complete colormap is (0, 1). + **kwargs + Other parameters are passed on to `.Axes.imshow()`. + In particular useful is *cmap*. + """ + phi = direction * np.pi / 2 + v = np.array([np.cos(phi), np.sin(phi)]) + X = np.array([[v @ [1, 0], v @ [1, 1]], + [v @ [0, 0], v @ [0, 1]]]) + a, b = cmap_range + X = a + (b - a) / X.max() * X + im = ax.imshow(X, extent=extent, interpolation='bicubic', + vmin=0, vmax=1, **kwargs) + return im + + +def gradient_bar(ax, x, y, width=0.5, bottom=0): + for left, top in zip(x, y): + right = left + width + gradient_image(ax, extent=(left, right, bottom, top), cmap=plt.cm.Blues_r, cmap_range=(0, 0.8)) + + +# arange automatically balloons into a list with 29 elements from 1 to 28. [2] +year_num = np.arange(1, 30, 1) +print(year_num) + +year_num = list(year_num) + +year_num2 = range(1, 30, 1) +print(year_num2) + +year_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29] + +year_number2 = [] + +for i in np.arange(1, 30, 1): + year_number2.append(i) + +print(year_number2) + +year_number3 = [] + +for i in range(1, 30, 1): + year_number3.append(i) + +print(year_number3) + +number_of_births = [322938, 329581, 325545, 326002, 271450, 283661, 305312, 260354, 247530, 227070, + 216419, 205854, 204459, 204414, 198733, 191310, 166886, 196627, 229481, 199113, + 210383, 213598, 208440, 193844, 181601, 177767, 165249, 153820, + (13137, 9617, 12788, 11222, 9442, 10943, 10950)] + +label_year = np.arange(1994, 2023, 1) +print(label_year) + +label_year_text = ["1994", "'95", "'96", "'97", "'98", "'99", "2000", "'01", "'02", "'03", "'04", "'05", + "'06", "'07", "'08", "'09", "'10", "'11", "'12", "'13", "'14", "'15", "'16", "'17", + "'18", "'19", "'20", "'21", "'22"] + +# xmin, xmax = xlim = 0, 10 +ymin, ymax = ylim = 150000, 330000 + +fig, axe = plt.subplots(nrows=1, ncols=1, figsize=(8, 7)) +axe.set(ylim=ylim, autoscale_on=False) + +# background image +gradient_image(axe, direction=1, extent=(0, 1, 0, 1), transform=axe.transAxes, cmap=plt.cm.RdYlGn, + cmap_range=(0.2, 0.8), alpha=0.5) + + +# gradient_bar(ax=axe, x=year_number, y=number_of_births, width=0.7) + +plot = axe.bar(year_number, number_of_births) + +for rect in plot: + height = rect.get_height() + axe.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, '%d' % int(height), + ha='center', va='bottom', fontsize=12) + + +axe.set_aspect('auto') +axe.set_xlabel("Year") +axe.set_ylabel("The number of births") +axe.set_title(label="1994-2022/07 啁撟游漲箇鈭箸稞n Annual number of births in Taiwan", fontsize=20) +axe.set_xticks(year_number, labels=label_year_text, rotation=7, fontsize=12) +axe.tick_params(axis='y', labelsize=12) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/gallery/lines_bars_and_markers/gradient_bar.html +# 2. https://numpy.org/doc/stable/reference/generated/numpy.arange.html + +# Data: https://statis.moi.gov.tw/micst/stmain.jsp?sys=220&ym=8300&ymt=11000&kind=21&type=1&funid=c0120101&cycle=4&outmode=0&compmode=0&outkind=1&fld0=1&cod00=1&rdm=fu0Necq9 diff --git a/The attainments and realizations of my dreams/Annual number of births in Taiwan/__init__.py b/The attainments and realizations of my dreams/Annual number of births in Taiwan/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Average life expectancy/Year 2021-2.py b/The attainments and realizations of my dreams/Average life expectancy/Year 2021-2.py new file mode 100644 index 00000000..7c2c1781 --- /dev/null +++ b/The attainments and realizations of my dreams/Average life expectancy/Year 2021-2.py @@ -0,0 +1,283 @@ +""" +======================= +The Lifecycle of a Plot +======================= + +This tutorial aims to show the beginning, middle, and end of a single +visualization using Matplotlib. We'll begin with some raw data and +end by saving a figure of a customized visualization. Along the way we try +to highlight some neat features and best-practices using Matplotlib. + +.. currentmodule:: matplotlib + +.. note:: + + This tutorial is based on + `this excellent blog post + `_ + by Chris Moffitt. It was transformed into this tutorial by Chris Holdgraf. + +A note on the explicit vs. implicit interfaces +============================================== + +Matplotlib has two interfaces. For an explanation of the trade-offs between the +explicit and implicit interfaces see :ref:`api_interfaces`. + +In the explicit object-oriented (OO) interface we directly utilize instances of +:class:`axes.Axes` to build up the visualization in an instance of +:class:`figure.Figure`. In the implicit interface, inspired by and modeled on +MATLAB, we use a global state-based interface which is encapsulated in the +:mod:`.pyplot` module to plot to the "current Axes". See the :doc:`pyplot +tutorials ` for a more in-depth look at the +pyplot interface. + +Most of the terms are straightforward but the main thing to remember +is that: + +* The `.Figure` is the final image, and may contain one or more `~.axes.Axes`. +* The `~.axes.Axes` represents an individual plot (not to be confused with + `~.axis.Axis`, which refers to the x-, y-, or z-axis of a plot). + +We call methods that do the plotting directly from the Axes, which gives +us much more flexibility and power in customizing our plot. + +.. note:: + + In general, use the explicit interface over the implicit pyplot interface + for plotting. + +Our data +======== + +We'll use the data from the post from which this tutorial was derived. +It contains sales information for a number of companies. + +""" + +# sphinx_gallery_thumbnail_number = 10 +import numpy as np +import matplotlib.pyplot as plt + + +data = {'Kaohsiung': 79.96, + 'Tainan': 80.55, + 'Taichung': 81.13, + 'Taoyuan': 81.35, + 'New Taipei': 81.74, + 'Taipei': 84.14, + } + +group_data = list(data.values()) +group_names = list(data.keys()) +group_mean = 80.86 + +############################################################################### +# Getting started +# =============== +# +# This data is naturally visualized as a barplot, with one bar per +# group. To do this with the object-oriented approach, we first generate +# an instance of :class:`figure.Figure` and +# :class:`axes.Axes`. The Figure is like a canvas, and the Axes +# is a part of that canvas on which we will make a particular visualization. +# +# .. note:: +# +# Figures can have multiple axes on them. For information on how to do this, +# see the :doc:`Tight Layout tutorial +# `. + +fig, ax = plt.subplots() + +############################################################################### +# Now that we have an Axes instance, we can plot on top of it. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# Controlling the style +# ===================== +# +# There are many styles available in Matplotlib in order to let you tailor +# your visualization to your needs. To see a list of styles, we can use +# :mod:`.style`. + +print(plt.style.available) + +############################################################################### +# You can activate a style with the following: + +plt.style.use('fivethirtyeight') + +############################################################################### +# Now let's remake the above plot to see how it looks: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# The style controls many things, such as color, linewidths, backgrounds, +# etc. +# +# Customizing the plot +# ==================== +# +# Now we've got a plot with the general look that we want, so let's fine-tune +# it so that it's ready for print. First let's rotate the labels on the x-axis +# so that they show up more clearly. We can gain access to these labels +# with the :meth:`axes.Axes.get_xticklabels` method: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() + +############################################################################### +# If we'd like to set the property of many items at once, it's useful to use +# the :func:`pyplot.setp` function. This will take a list (or many lists) of +# Matplotlib objects, and attempt to set some style element of each one. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# It looks like this cut off some of the labels on the bottom. We can +# tell Matplotlib to automatically make room for elements in the figures +# that we create. To do this we set the ``autolayout`` value of our +# rcParams. For more information on controlling the style, layout, and +# other features of plots with rcParams, see +# :doc:`/tutorials/introductory/customizing`. + +plt.rcParams.update({'figure.autolayout': True}) + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# Next, we add labels to the plot. To do this with the OO interface, +# we can use the :meth:`.Artist.set` method to set properties of this +# Axes object. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# We can also adjust the size of this plot using the :func:`pyplot.subplots` +# function. We can do this with the *figsize* keyword argument. +# +# .. note:: +# +# While indexing in NumPy follows the form (row, column), the *figsize* +# keyword argument follows the form (width, height). This follows +# conventions in visualization, which unfortunately are different from those +# of linear algebra. + +fig, ax = plt.subplots(figsize=(8, 4)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# For labels, we can specify custom formatting guidelines in the form of +# functions. Below we define a function that takes an integer as input, and +# returns a string as an output. When used with `.Axis.set_major_formatter` or +# `.Axis.set_minor_formatter`, they will automatically create and use a +# :class:`ticker.FuncFormatter` class. +# +# For this function, the ``x`` argument is the original tick label and ``pos`` +# is the tick position. We will only use ``x`` here but both arguments are +# needed. + + +# def currency(x, pos): +# """The two arguments are the value and tick position""" +# if x >= 1e6: +# s = '${:1.1f}M'.format(x*1e-6) +# else: +# s = '${:1.0f}K'.format(x*1e-3) +# return s + +############################################################################### +# We can then apply this function to the labels on our plot. To do this, +# we use the ``xaxis`` attribute of our axes. This lets you perform +# actions on a specific axis on our plot. + +fig, ax = plt.subplots(figsize=(6, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +# ax.xaxis.set_major_formatter(currency) + +############################################################################### +# Combining multiple visualizations +# ================================= +# +# It is possible to draw multiple plot elements on the same instance of +# :class:`axes.Axes`. To do this we simply need to call another one of +# the plot methods on that axes object. + +fig, ax = plt.subplots(figsize=(8, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +# Add a vertical line, here we set the style in the function call +ax.axvline(x=group_mean, ls='--', color='r') +ax.text(group_mean, 2.45, "Nationwide average", + horizontalalignment='center', fontweight='bold', color='red') + +# Annotate new companies +# for group in [3, 5, 8]: +# ax.text(145000, group, "New Company", fontsize=10, +# verticalalignment="center") + +# Now we move our title up since it's getting a little cramped +ax.title.set(y=1.05) + +ax.set(xlim=[-10, 100], xlabel='Age', ylabel='City', + title='Average Life Expectancy in 2021') + +# ax.xaxis.set_major_formatter(currency) +ax.set_xticks([0, 20, 40, 60, 80, 100]) +fig.subplots_adjust(right=.1) + +plt.show() + +############################################################################### +# Saving our plot +# =============== +# +# Now that we're happy with the outcome of our plot, we want to save it to +# disk. There are many file formats we can save to in Matplotlib. To see +# a list of available options, use: + +print(fig.canvas.get_supported_filetypes()) + +############################################################################### +# We can then use the :meth:`figure.Figure.savefig` in order to save the figure +# to disk. Note that there are several useful flags we show below: +# +# * ``transparent=True`` makes the background of the saved figure transparent +# if the format supports it. +# * ``dpi=80`` controls the resolution (dots per square inch) of the output. +# * ``bbox_inches="tight"`` fits the bounds of the figure to our plot. + +# Uncomment this line to save the figure. +# fig.savefig('sales.png', transparent=False, dpi=80, bbox_inches="tight") + +# References: +# diff --git a/The attainments and realizations of my dreams/Average life expectancy/Year 2021-3.py b/The attainments and realizations of my dreams/Average life expectancy/Year 2021-3.py new file mode 100644 index 00000000..8cc3b76f --- /dev/null +++ b/The attainments and realizations of my dreams/Average life expectancy/Year 2021-3.py @@ -0,0 +1,283 @@ +""" +======================= +The Lifecycle of a Plot +======================= + +This tutorial aims to show the beginning, middle, and end of a single +visualization using Matplotlib. We'll begin with some raw data and +end by saving a figure of a customized visualization. Along the way we try +to highlight some neat features and best-practices using Matplotlib. + +.. currentmodule:: matplotlib + +.. note:: + + This tutorial is based on + `this excellent blog post + `_ + by Chris Moffitt. It was transformed into this tutorial by Chris Holdgraf. + +A note on the explicit vs. implicit interfaces +============================================== + +Matplotlib has two interfaces. For an explanation of the trade-offs between the +explicit and implicit interfaces see :ref:`api_interfaces`. + +In the explicit object-oriented (OO) interface we directly utilize instances of +:class:`axes.Axes` to build up the visualization in an instance of +:class:`figure.Figure`. In the implicit interface, inspired by and modeled on +MATLAB, we use a global state-based interface which is encapsulated in the +:mod:`.pyplot` module to plot to the "current Axes". See the :doc:`pyplot +tutorials ` for a more in-depth look at the +pyplot interface. + +Most of the terms are straightforward but the main thing to remember +is that: + +* The `.Figure` is the final image, and may contain one or more `~.axes.Axes`. +* The `~.axes.Axes` represents an individual plot (not to be confused with + `~.axis.Axis`, which refers to the x-, y-, or z-axis of a plot). + +We call methods that do the plotting directly from the Axes, which gives +us much more flexibility and power in customizing our plot. + +.. note:: + + In general, use the explicit interface over the implicit pyplot interface + for plotting. + +Our data +======== + +We'll use the data from the post from which this tutorial was derived. +It contains sales information for a number of companies. + +""" + +# sphinx_gallery_thumbnail_number = 10 +import numpy as np +import matplotlib.pyplot as plt + + +data = {'Kaohsiung': 79.96, + 'Tainan': 80.55, + 'Taichung': 81.13, + 'Taoyuan': 81.35, + 'New Taipei': 81.74, + 'Taipei': 84.14, + } + +group_data = list(data.values()) +group_names = list(data.keys()) +group_mean = 80.86 + +############################################################################### +# Getting started +# =============== +# +# This data is naturally visualized as a barplot, with one bar per +# group. To do this with the object-oriented approach, we first generate +# an instance of :class:`figure.Figure` and +# :class:`axes.Axes`. The Figure is like a canvas, and the Axes +# is a part of that canvas on which we will make a particular visualization. +# +# .. note:: +# +# Figures can have multiple axes on them. For information on how to do this, +# see the :doc:`Tight Layout tutorial +# `. + +fig, ax = plt.subplots() + +############################################################################### +# Now that we have an Axes instance, we can plot on top of it. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# Controlling the style +# ===================== +# +# There are many styles available in Matplotlib in order to let you tailor +# your visualization to your needs. To see a list of styles, we can use +# :mod:`.style`. + +print(plt.style.available) + +############################################################################### +# You can activate a style with the following: + +plt.style.use('fivethirtyeight') + +############################################################################### +# Now let's remake the above plot to see how it looks: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# The style controls many things, such as color, linewidths, backgrounds, +# etc. +# +# Customizing the plot +# ==================== +# +# Now we've got a plot with the general look that we want, so let's fine-tune +# it so that it's ready for print. First let's rotate the labels on the x-axis +# so that they show up more clearly. We can gain access to these labels +# with the :meth:`axes.Axes.get_xticklabels` method: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() + +############################################################################### +# If we'd like to set the property of many items at once, it's useful to use +# the :func:`pyplot.setp` function. This will take a list (or many lists) of +# Matplotlib objects, and attempt to set some style element of each one. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# It looks like this cut off some of the labels on the bottom. We can +# tell Matplotlib to automatically make room for elements in the figures +# that we create. To do this we set the ``autolayout`` value of our +# rcParams. For more information on controlling the style, layout, and +# other features of plots with rcParams, see +# :doc:`/tutorials/introductory/customizing`. + +plt.rcParams.update({'figure.autolayout': True}) + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# Next, we add labels to the plot. To do this with the OO interface, +# we can use the :meth:`.Artist.set` method to set properties of this +# Axes object. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# We can also adjust the size of this plot using the :func:`pyplot.subplots` +# function. We can do this with the *figsize* keyword argument. +# +# .. note:: +# +# While indexing in NumPy follows the form (row, column), the *figsize* +# keyword argument follows the form (width, height). This follows +# conventions in visualization, which unfortunately are different from those +# of linear algebra. + +fig, ax = plt.subplots(figsize=(8, 4)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# For labels, we can specify custom formatting guidelines in the form of +# functions. Below we define a function that takes an integer as input, and +# returns a string as an output. When used with `.Axis.set_major_formatter` or +# `.Axis.set_minor_formatter`, they will automatically create and use a +# :class:`ticker.FuncFormatter` class. +# +# For this function, the ``x`` argument is the original tick label and ``pos`` +# is the tick position. We will only use ``x`` here but both arguments are +# needed. + + +# def currency(x, pos): +# """The two arguments are the value and tick position""" +# if x >= 1e6: +# s = '${:1.1f}M'.format(x*1e-6) +# else: +# s = '${:1.0f}K'.format(x*1e-3) +# return s + +############################################################################### +# We can then apply this function to the labels on our plot. To do this, +# we use the ``xaxis`` attribute of our axes. This lets you perform +# actions on a specific axis on our plot. + +fig, ax = plt.subplots(figsize=(6, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +# ax.xaxis.set_major_formatter(currency) + +############################################################################### +# Combining multiple visualizations +# ================================= +# +# It is possible to draw multiple plot elements on the same instance of +# :class:`axes.Axes`. To do this we simply need to call another one of +# the plot methods on that axes object. + +fig, ax = plt.subplots(figsize=(8, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +# Add a vertical line, here we set the style in the function call +ax.axvline(x=group_mean, ls='--', color='r') +ax.text(group_mean + 2.5, 1.45, "Nationwide average", rotation=90, + horizontalalignment='center', fontweight='bold', color='red') + +# Annotate new companies +# for group in [3, 5, 8]: +# ax.text(145000, group, "New Company", fontsize=10, +# verticalalignment="center") + +# Now we move our title up since it's getting a little cramped +ax.title.set(y=1.05) + +ax.set(xlim=[-10, 100], xlabel='Age', ylabel='City', + title='Average Life Expectancy in 2021') + +# ax.xaxis.set_major_formatter(currency) +ax.set_xticks([0, 20, 40, 60, 80, 100]) +fig.subplots_adjust(right=.1) + +plt.show() + +############################################################################### +# Saving our plot +# =============== +# +# Now that we're happy with the outcome of our plot, we want to save it to +# disk. There are many file formats we can save to in Matplotlib. To see +# a list of available options, use: + +print(fig.canvas.get_supported_filetypes()) + +############################################################################### +# We can then use the :meth:`figure.Figure.savefig` in order to save the figure +# to disk. Note that there are several useful flags we show below: +# +# * ``transparent=True`` makes the background of the saved figure transparent +# if the format supports it. +# * ``dpi=80`` controls the resolution (dots per square inch) of the output. +# * ``bbox_inches="tight"`` fits the bounds of the figure to our plot. + +# Uncomment this line to save the figure. +# fig.savefig('sales.png', transparent=False, dpi=80, bbox_inches="tight") + +# References: +# diff --git a/The attainments and realizations of my dreams/Average life expectancy/Year 2021-4.py b/The attainments and realizations of my dreams/Average life expectancy/Year 2021-4.py new file mode 100644 index 00000000..4813688e --- /dev/null +++ b/The attainments and realizations of my dreams/Average life expectancy/Year 2021-4.py @@ -0,0 +1,283 @@ +""" +======================= +The Lifecycle of a Plot +======================= + +This tutorial aims to show the beginning, middle, and end of a single +visualization using Matplotlib. We'll begin with some raw data and +end by saving a figure of a customized visualization. Along the way we try +to highlight some neat features and best-practices using Matplotlib. + +.. currentmodule:: matplotlib + +.. note:: + + This tutorial is based on + `this excellent blog post + `_ + by Chris Moffitt. It was transformed into this tutorial by Chris Holdgraf. + +A note on the explicit vs. implicit interfaces +============================================== + +Matplotlib has two interfaces. For an explanation of the trade-offs between the +explicit and implicit interfaces see :ref:`api_interfaces`. + +In the explicit object-oriented (OO) interface we directly utilize instances of +:class:`axes.Axes` to build up the visualization in an instance of +:class:`figure.Figure`. In the implicit interface, inspired by and modeled on +MATLAB, we use a global state-based interface which is encapsulated in the +:mod:`.pyplot` module to plot to the "current Axes". See the :doc:`pyplot +tutorials ` for a more in-depth look at the +pyplot interface. + +Most of the terms are straightforward but the main thing to remember +is that: + +* The `.Figure` is the final image, and may contain one or more `~.axes.Axes`. +* The `~.axes.Axes` represents an individual plot (not to be confused with + `~.axis.Axis`, which refers to the x-, y-, or z-axis of a plot). + +We call methods that do the plotting directly from the Axes, which gives +us much more flexibility and power in customizing our plot. + +.. note:: + + In general, use the explicit interface over the implicit pyplot interface + for plotting. + +Our data +======== + +We'll use the data from the post from which this tutorial was derived. +It contains sales information for a number of companies. + +""" + +# sphinx_gallery_thumbnail_number = 10 +import numpy as np +import matplotlib.pyplot as plt + + +data = {'Kaohsiung': 79.96, + 'Tainan': 80.55, + 'Taichung': 81.13, + 'Taoyuan': 81.35, + 'New Taipei': 81.74, + 'Taipei': 84.14, + } + +group_data = list(data.values()) +group_names = list(data.keys()) +group_mean = 80.86 + +############################################################################### +# Getting started +# =============== +# +# This data is naturally visualized as a barplot, with one bar per +# group. To do this with the object-oriented approach, we first generate +# an instance of :class:`figure.Figure` and +# :class:`axes.Axes`. The Figure is like a canvas, and the Axes +# is a part of that canvas on which we will make a particular visualization. +# +# .. note:: +# +# Figures can have multiple axes on them. For information on how to do this, +# see the :doc:`Tight Layout tutorial +# `. + +fig, ax = plt.subplots() + +############################################################################### +# Now that we have an Axes instance, we can plot on top of it. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# Controlling the style +# ===================== +# +# There are many styles available in Matplotlib in order to let you tailor +# your visualization to your needs. To see a list of styles, we can use +# :mod:`.style`. + +print(plt.style.available) + +############################################################################### +# You can activate a style with the following: + +plt.style.use('fivethirtyeight') + +############################################################################### +# Now let's remake the above plot to see how it looks: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# The style controls many things, such as color, linewidths, backgrounds, +# etc. +# +# Customizing the plot +# ==================== +# +# Now we've got a plot with the general look that we want, so let's fine-tune +# it so that it's ready for print. First let's rotate the labels on the x-axis +# so that they show up more clearly. We can gain access to these labels +# with the :meth:`axes.Axes.get_xticklabels` method: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() + +############################################################################### +# If we'd like to set the property of many items at once, it's useful to use +# the :func:`pyplot.setp` function. This will take a list (or many lists) of +# Matplotlib objects, and attempt to set some style element of each one. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# It looks like this cut off some of the labels on the bottom. We can +# tell Matplotlib to automatically make room for elements in the figures +# that we create. To do this we set the ``autolayout`` value of our +# rcParams. For more information on controlling the style, layout, and +# other features of plots with rcParams, see +# :doc:`/tutorials/introductory/customizing`. + +plt.rcParams.update({'figure.autolayout': True}) + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# Next, we add labels to the plot. To do this with the OO interface, +# we can use the :meth:`.Artist.set` method to set properties of this +# Axes object. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# We can also adjust the size of this plot using the :func:`pyplot.subplots` +# function. We can do this with the *figsize* keyword argument. +# +# .. note:: +# +# While indexing in NumPy follows the form (row, column), the *figsize* +# keyword argument follows the form (width, height). This follows +# conventions in visualization, which unfortunately are different from those +# of linear algebra. + +fig, ax = plt.subplots(figsize=(8, 4)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# For labels, we can specify custom formatting guidelines in the form of +# functions. Below we define a function that takes an integer as input, and +# returns a string as an output. When used with `.Axis.set_major_formatter` or +# `.Axis.set_minor_formatter`, they will automatically create and use a +# :class:`ticker.FuncFormatter` class. +# +# For this function, the ``x`` argument is the original tick label and ``pos`` +# is the tick position. We will only use ``x`` here but both arguments are +# needed. + + +# def currency(x, pos): +# """The two arguments are the value and tick position""" +# if x >= 1e6: +# s = '${:1.1f}M'.format(x*1e-6) +# else: +# s = '${:1.0f}K'.format(x*1e-3) +# return s + +############################################################################### +# We can then apply this function to the labels on our plot. To do this, +# we use the ``xaxis`` attribute of our axes. This lets you perform +# actions on a specific axis on our plot. + +fig, ax = plt.subplots(figsize=(6, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +# ax.xaxis.set_major_formatter(currency) + +############################################################################### +# Combining multiple visualizations +# ================================= +# +# It is possible to draw multiple plot elements on the same instance of +# :class:`axes.Axes`. To do this we simply need to call another one of +# the plot methods on that axes object. + +fig, ax = plt.subplots(figsize=(8, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +# Add a vertical line, here we set the style in the function call +ax.axvline(x=group_mean, ls='--', color='r') +ax.text(group_mean + 2.5, 1.45, "TW average = 80.86", rotation=90, + horizontalalignment='center', fontweight='bold', color='red') + +# Annotate new companies +# for group in [3, 5, 8]: +# ax.text(145000, group, "New Company", fontsize=10, +# verticalalignment="center") + +# Now we move our title up since it's getting a little cramped +ax.title.set(y=1.05) + +ax.set(xlim=[-10, 100], xlabel='Age', ylabel='City', + title='Average Life Expectancy in 2021') + +# ax.xaxis.set_major_formatter(currency) +ax.set_xticks([0, 20, 40, 60, 80, 100]) +fig.subplots_adjust(right=.1) + +plt.show() + +############################################################################### +# Saving our plot +# =============== +# +# Now that we're happy with the outcome of our plot, we want to save it to +# disk. There are many file formats we can save to in Matplotlib. To see +# a list of available options, use: + +print(fig.canvas.get_supported_filetypes()) + +############################################################################### +# We can then use the :meth:`figure.Figure.savefig` in order to save the figure +# to disk. Note that there are several useful flags we show below: +# +# * ``transparent=True`` makes the background of the saved figure transparent +# if the format supports it. +# * ``dpi=80`` controls the resolution (dots per square inch) of the output. +# * ``bbox_inches="tight"`` fits the bounds of the figure to our plot. + +# Uncomment this line to save the figure. +# fig.savefig('sales.png', transparent=False, dpi=80, bbox_inches="tight") + +# References: +# diff --git a/The attainments and realizations of my dreams/Average life expectancy/Year 2021-5.py b/The attainments and realizations of my dreams/Average life expectancy/Year 2021-5.py new file mode 100644 index 00000000..79ba3b0f --- /dev/null +++ b/The attainments and realizations of my dreams/Average life expectancy/Year 2021-5.py @@ -0,0 +1,283 @@ +""" +======================= +The Lifecycle of a Plot +======================= + +This tutorial aims to show the beginning, middle, and end of a single +visualization using Matplotlib. We'll begin with some raw data and +end by saving a figure of a customized visualization. Along the way we try +to highlight some neat features and best-practices using Matplotlib. + +.. currentmodule:: matplotlib + +.. note:: + + This tutorial is based on + `this excellent blog post + `_ + by Chris Moffitt. It was transformed into this tutorial by Chris Holdgraf. + +A note on the explicit vs. implicit interfaces +============================================== + +Matplotlib has two interfaces. For an explanation of the trade-offs between the +explicit and implicit interfaces see :ref:`api_interfaces`. + +In the explicit object-oriented (OO) interface we directly utilize instances of +:class:`axes.Axes` to build up the visualization in an instance of +:class:`figure.Figure`. In the implicit interface, inspired by and modeled on +MATLAB, we use a global state-based interface which is encapsulated in the +:mod:`.pyplot` module to plot to the "current Axes". See the :doc:`pyplot +tutorials ` for a more in-depth look at the +pyplot interface. + +Most of the terms are straightforward but the main thing to remember +is that: + +* The `.Figure` is the final image, and may contain one or more `~.axes.Axes`. +* The `~.axes.Axes` represents an individual plot (not to be confused with + `~.axis.Axis`, which refers to the x-, y-, or z-axis of a plot). + +We call methods that do the plotting directly from the Axes, which gives +us much more flexibility and power in customizing our plot. + +.. note:: + + In general, use the explicit interface over the implicit pyplot interface + for plotting. + +Our data +======== + +We'll use the data from the post from which this tutorial was derived. +It contains sales information for a number of companies. + +""" + +# sphinx_gallery_thumbnail_number = 10 +import numpy as np +import matplotlib.pyplot as plt + + +data = {'Kaohsiung': 79.96, + 'Tainan': 80.55, + 'Taichung': 81.13, + 'Taoyuan': 81.35, + 'New Taipei': 81.74, + 'Taipei': 84.14, + } + +group_data = list(data.values()) +group_names = list(data.keys()) +group_mean = 80.86 + +############################################################################### +# Getting started +# =============== +# +# This data is naturally visualized as a barplot, with one bar per +# group. To do this with the object-oriented approach, we first generate +# an instance of :class:`figure.Figure` and +# :class:`axes.Axes`. The Figure is like a canvas, and the Axes +# is a part of that canvas on which we will make a particular visualization. +# +# .. note:: +# +# Figures can have multiple axes on them. For information on how to do this, +# see the :doc:`Tight Layout tutorial +# `. + +fig, ax = plt.subplots() + +############################################################################### +# Now that we have an Axes instance, we can plot on top of it. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# Controlling the style +# ===================== +# +# There are many styles available in Matplotlib in order to let you tailor +# your visualization to your needs. To see a list of styles, we can use +# :mod:`.style`. + +print(plt.style.available) + +############################################################################### +# You can activate a style with the following: + +plt.style.use('fivethirtyeight') + +############################################################################### +# Now let's remake the above plot to see how it looks: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# The style controls many things, such as color, linewidths, backgrounds, +# etc. +# +# Customizing the plot +# ==================== +# +# Now we've got a plot with the general look that we want, so let's fine-tune +# it so that it's ready for print. First let's rotate the labels on the x-axis +# so that they show up more clearly. We can gain access to these labels +# with the :meth:`axes.Axes.get_xticklabels` method: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() + +############################################################################### +# If we'd like to set the property of many items at once, it's useful to use +# the :func:`pyplot.setp` function. This will take a list (or many lists) of +# Matplotlib objects, and attempt to set some style element of each one. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# It looks like this cut off some of the labels on the bottom. We can +# tell Matplotlib to automatically make room for elements in the figures +# that we create. To do this we set the ``autolayout`` value of our +# rcParams. For more information on controlling the style, layout, and +# other features of plots with rcParams, see +# :doc:`/tutorials/introductory/customizing`. + +plt.rcParams.update({'figure.autolayout': True}) + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# Next, we add labels to the plot. To do this with the OO interface, +# we can use the :meth:`.Artist.set` method to set properties of this +# Axes object. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# We can also adjust the size of this plot using the :func:`pyplot.subplots` +# function. We can do this with the *figsize* keyword argument. +# +# .. note:: +# +# While indexing in NumPy follows the form (row, column), the *figsize* +# keyword argument follows the form (width, height). This follows +# conventions in visualization, which unfortunately are different from those +# of linear algebra. + +fig, ax = plt.subplots(figsize=(8, 4)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# For labels, we can specify custom formatting guidelines in the form of +# functions. Below we define a function that takes an integer as input, and +# returns a string as an output. When used with `.Axis.set_major_formatter` or +# `.Axis.set_minor_formatter`, they will automatically create and use a +# :class:`ticker.FuncFormatter` class. +# +# For this function, the ``x`` argument is the original tick label and ``pos`` +# is the tick position. We will only use ``x`` here but both arguments are +# needed. + + +# def currency(x, pos): +# """The two arguments are the value and tick position""" +# if x >= 1e6: +# s = '${:1.1f}M'.format(x*1e-6) +# else: +# s = '${:1.0f}K'.format(x*1e-3) +# return s + +############################################################################### +# We can then apply this function to the labels on our plot. To do this, +# we use the ``xaxis`` attribute of our axes. This lets you perform +# actions on a specific axis on our plot. + +fig, ax = plt.subplots(figsize=(6, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +# ax.xaxis.set_major_formatter(currency) + +############################################################################### +# Combining multiple visualizations +# ================================= +# +# It is possible to draw multiple plot elements on the same instance of +# :class:`axes.Axes`. To do this we simply need to call another one of +# the plot methods on that axes object. + +fig, ax = plt.subplots(figsize=(8, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +# Add a vertical line, here we set the style in the function call +ax.axvline(x=group_mean, ls='--', color='r') +ax.text(group_mean + 2.5, 1.45, "TW average = 80.86", rotation=90, + horizontalalignment='center', fontweight='light', color='red') + +# Annotate new companies +# for group in [3, 5, 8]: +# ax.text(145000, group, "New Company", fontsize=10, +# verticalalignment="center") + +# Now we move our title up since it's getting a little cramped +ax.title.set(y=1.05) + +ax.set(xlim=[-10, 100], xlabel='Age', ylabel='City', + title='Average Life Expectancy in 2021') + +# ax.xaxis.set_major_formatter(currency) +ax.set_xticks([0, 20, 40, 60, 80, 100]) +fig.subplots_adjust(right=.1) + +plt.show() + +############################################################################### +# Saving our plot +# =============== +# +# Now that we're happy with the outcome of our plot, we want to save it to +# disk. There are many file formats we can save to in Matplotlib. To see +# a list of available options, use: + +print(fig.canvas.get_supported_filetypes()) + +############################################################################### +# We can then use the :meth:`figure.Figure.savefig` in order to save the figure +# to disk. Note that there are several useful flags we show below: +# +# * ``transparent=True`` makes the background of the saved figure transparent +# if the format supports it. +# * ``dpi=80`` controls the resolution (dots per square inch) of the output. +# * ``bbox_inches="tight"`` fits the bounds of the figure to our plot. + +# Uncomment this line to save the figure. +# fig.savefig('sales.png', transparent=False, dpi=80, bbox_inches="tight") + +# References: +# diff --git a/The attainments and realizations of my dreams/Average life expectancy/Year 2021-6.py b/The attainments and realizations of my dreams/Average life expectancy/Year 2021-6.py new file mode 100644 index 00000000..50ada84a --- /dev/null +++ b/The attainments and realizations of my dreams/Average life expectancy/Year 2021-6.py @@ -0,0 +1,287 @@ +""" +======================= +The Lifecycle of a Plot +======================= + +This tutorial aims to show the beginning, middle, and end of a single +visualization using Matplotlib. We'll begin with some raw data and +end by saving a figure of a customized visualization. Along the way we try +to highlight some neat features and best-practices using Matplotlib. + +.. currentmodule:: matplotlib + +.. note:: + + This tutorial is based on + `this excellent blog post + `_ + by Chris Moffitt. It was transformed into this tutorial by Chris Holdgraf. + +A note on the explicit vs. implicit interfaces +============================================== + +Matplotlib has two interfaces. For an explanation of the trade-offs between the +explicit and implicit interfaces see :ref:`api_interfaces`. + +In the explicit object-oriented (OO) interface we directly utilize instances of +:class:`axes.Axes` to build up the visualization in an instance of +:class:`figure.Figure`. In the implicit interface, inspired by and modeled on +MATLAB, we use a global state-based interface which is encapsulated in the +:mod:`.pyplot` module to plot to the "current Axes". See the :doc:`pyplot +tutorials ` for a more in-depth look at the +pyplot interface. + +Most of the terms are straightforward but the main thing to remember +is that: + +* The `.Figure` is the final image, and may contain one or more `~.axes.Axes`. +* The `~.axes.Axes` represents an individual plot (not to be confused with + `~.axis.Axis`, which refers to the x-, y-, or z-axis of a plot). + +We call methods that do the plotting directly from the Axes, which gives +us much more flexibility and power in customizing our plot. + +.. note:: + + In general, use the explicit interface over the implicit pyplot interface + for plotting. + +Our data +======== + +We'll use the data from the post from which this tutorial was derived. +It contains sales information for a number of companies. + +""" + +# sphinx_gallery_thumbnail_number = 10 +import numpy as np +import matplotlib.pyplot as plt + + +data = {'Kaohsiung': 79.96, + 'Tainan': 80.55, + 'Taichung': 81.13, + 'Taoyuan': 81.35, + 'New Taipei': 81.74, + 'Taipei': 84.14, + } + +group_data = list(data.values()) +group_names = list(data.keys()) +group_mean = 80.86 + +############################################################################### +# Getting started +# =============== +# +# This data is naturally visualized as a barplot, with one bar per +# group. To do this with the object-oriented approach, we first generate +# an instance of :class:`figure.Figure` and +# :class:`axes.Axes`. The Figure is like a canvas, and the Axes +# is a part of that canvas on which we will make a particular visualization. +# +# .. note:: +# +# Figures can have multiple axes on them. For information on how to do this, +# see the :doc:`Tight Layout tutorial +# `. + +fig, ax = plt.subplots() + +############################################################################### +# Now that we have an Axes instance, we can plot on top of it. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# Controlling the style +# ===================== +# +# There are many styles available in Matplotlib in order to let you tailor +# your visualization to your needs. To see a list of styles, we can use +# :mod:`.style`. + +print(plt.style.available) + +############################################################################### +# You can activate a style with the following: + +plt.style.use('fivethirtyeight') + +############################################################################### +# Now let's remake the above plot to see how it looks: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# The style controls many things, such as color, linewidths, backgrounds, +# etc. +# +# Customizing the plot +# ==================== +# +# Now we've got a plot with the general look that we want, so let's fine-tune +# it so that it's ready for print. First let's rotate the labels on the x-axis +# so that they show up more clearly. We can gain access to these labels +# with the :meth:`axes.Axes.get_xticklabels` method: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() + +############################################################################### +# If we'd like to set the property of many items at once, it's useful to use +# the :func:`pyplot.setp` function. This will take a list (or many lists) of +# Matplotlib objects, and attempt to set some style element of each one. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# It looks like this cut off some of the labels on the bottom. We can +# tell Matplotlib to automatically make room for elements in the figures +# that we create. To do this we set the ``autolayout`` value of our +# rcParams. For more information on controlling the style, layout, and +# other features of plots with rcParams, see +# :doc:`/tutorials/introductory/customizing`. + +plt.rcParams.update({'figure.autolayout': True}) + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# Next, we add labels to the plot. To do this with the OO interface, +# we can use the :meth:`.Artist.set` method to set properties of this +# Axes object. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# We can also adjust the size of this plot using the :func:`pyplot.subplots` +# function. We can do this with the *figsize* keyword argument. +# +# .. note:: +# +# While indexing in NumPy follows the form (row, column), the *figsize* +# keyword argument follows the form (width, height). This follows +# conventions in visualization, which unfortunately are different from those +# of linear algebra. + +fig, ax = plt.subplots(figsize=(8, 4)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# For labels, we can specify custom formatting guidelines in the form of +# functions. Below we define a function that takes an integer as input, and +# returns a string as an output. When used with `.Axis.set_major_formatter` or +# `.Axis.set_minor_formatter`, they will automatically create and use a +# :class:`ticker.FuncFormatter` class. +# +# For this function, the ``x`` argument is the original tick label and ``pos`` +# is the tick position. We will only use ``x`` here but both arguments are +# needed. + + +# def currency(x, pos): +# """The two arguments are the value and tick position""" +# if x >= 1e6: +# s = '${:1.1f}M'.format(x*1e-6) +# else: +# s = '${:1.0f}K'.format(x*1e-3) +# return s + +############################################################################### +# We can then apply this function to the labels on our plot. To do this, +# we use the ``xaxis`` attribute of our axes. This lets you perform +# actions on a specific axis on our plot. + +fig, ax = plt.subplots(figsize=(6, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +# ax.xaxis.set_major_formatter(currency) + +############################################################################### +# Combining multiple visualizations +# ================================= +# +# It is possible to draw multiple plot elements on the same instance of +# :class:`axes.Axes`. To do this we simply need to call another one of +# the plot methods on that axes object. + +fig, ax = plt.subplots(figsize=(8, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +# Add a vertical line, here we set the style in the function call +ax.axvline(x=group_mean, ls='--', color='r') +ax.text(group_mean + 3.2, 1.45, "Taiwan average = 80.86", rotation=90, + horizontalalignment='center', fontweight='light', color='red') + +# Annotate new companies +# for group in [3, 5, 8]: +# ax.text(145000, group, "New Company", fontsize=10, +# verticalalignment="center") + +# Now we move our title up since it's getting a little cramped +ax.title.set(y=1.05) + +ax.set(xlim=[-10, 100], xlabel='Age', ylabel='City', + title='Average Life Expectancy in 2021') + +# ax.xaxis.set_major_formatter(currency) +ax.set_xticks([0, 20, 40, 60, 80, 100]) +fig.subplots_adjust(right=.1) + +plt.text(x=0.45, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) + +plt.show() + +############################################################################### +# Saving our plot +# =============== +# +# Now that we're happy with the outcome of our plot, we want to save it to +# disk. There are many file formats we can save to in Matplotlib. To see +# a list of available options, use: + +print(fig.canvas.get_supported_filetypes()) + +############################################################################### +# We can then use the :meth:`figure.Figure.savefig` in order to save the figure +# to disk. Note that there are several useful flags we show below: +# +# * ``transparent=True`` makes the background of the saved figure transparent +# if the format supports it. +# * ``dpi=80`` controls the resolution (dots per square inch) of the output. +# * ``bbox_inches="tight"`` fits the bounds of the figure to our plot. + +# Uncomment this line to save the figure. +# fig.savefig('sales.png', transparent=False, dpi=80, bbox_inches="tight") + +# References: +# diff --git a/The attainments and realizations of my dreams/Average life expectancy/Year 2021-7.py b/The attainments and realizations of my dreams/Average life expectancy/Year 2021-7.py new file mode 100644 index 00000000..e3ef8c8c --- /dev/null +++ b/The attainments and realizations of my dreams/Average life expectancy/Year 2021-7.py @@ -0,0 +1,287 @@ +""" +======================= +The Lifecycle of a Plot +======================= + +This tutorial aims to show the beginning, middle, and end of a single +visualization using Matplotlib. We'll begin with some raw data and +end by saving a figure of a customized visualization. Along the way we try +to highlight some neat features and best-practices using Matplotlib. + +.. currentmodule:: matplotlib + +.. note:: + + This tutorial is based on + `this excellent blog post + `_ + by Chris Moffitt. It was transformed into this tutorial by Chris Holdgraf. + +A note on the explicit vs. implicit interfaces +============================================== + +Matplotlib has two interfaces. For an explanation of the trade-offs between the +explicit and implicit interfaces see :ref:`api_interfaces`. + +In the explicit object-oriented (OO) interface we directly utilize instances of +:class:`axes.Axes` to build up the visualization in an instance of +:class:`figure.Figure`. In the implicit interface, inspired by and modeled on +MATLAB, we use a global state-based interface which is encapsulated in the +:mod:`.pyplot` module to plot to the "current Axes". See the :doc:`pyplot +tutorials ` for a more in-depth look at the +pyplot interface. + +Most of the terms are straightforward but the main thing to remember +is that: + +* The `.Figure` is the final image, and may contain one or more `~.axes.Axes`. +* The `~.axes.Axes` represents an individual plot (not to be confused with + `~.axis.Axis`, which refers to the x-, y-, or z-axis of a plot). + +We call methods that do the plotting directly from the Axes, which gives +us much more flexibility and power in customizing our plot. + +.. note:: + + In general, use the explicit interface over the implicit pyplot interface + for plotting. + +Our data +======== + +We'll use the data from the post from which this tutorial was derived. +It contains sales information for a number of companies. + +""" + +# sphinx_gallery_thumbnail_number = 10 +import numpy as np +import matplotlib.pyplot as plt + + +data = {'Kaohsiung': 79.96, + 'Tainan': 80.55, + 'Taichung': 81.13, + 'Taoyuan': 81.35, + 'New Taipei': 81.74, + 'Taipei': 84.14, + } + +group_data = list(data.values()) +group_names = list(data.keys()) +group_mean = 80.86 + +############################################################################### +# Getting started +# =============== +# +# This data is naturally visualized as a barplot, with one bar per +# group. To do this with the object-oriented approach, we first generate +# an instance of :class:`figure.Figure` and +# :class:`axes.Axes`. The Figure is like a canvas, and the Axes +# is a part of that canvas on which we will make a particular visualization. +# +# .. note:: +# +# Figures can have multiple axes on them. For information on how to do this, +# see the :doc:`Tight Layout tutorial +# `. + +fig, ax = plt.subplots() + +############################################################################### +# Now that we have an Axes instance, we can plot on top of it. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# Controlling the style +# ===================== +# +# There are many styles available in Matplotlib in order to let you tailor +# your visualization to your needs. To see a list of styles, we can use +# :mod:`.style`. + +print(plt.style.available) + +############################################################################### +# You can activate a style with the following: + +plt.style.use('fivethirtyeight') + +############################################################################### +# Now let's remake the above plot to see how it looks: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# The style controls many things, such as color, linewidths, backgrounds, +# etc. +# +# Customizing the plot +# ==================== +# +# Now we've got a plot with the general look that we want, so let's fine-tune +# it so that it's ready for print. First let's rotate the labels on the x-axis +# so that they show up more clearly. We can gain access to these labels +# with the :meth:`axes.Axes.get_xticklabels` method: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() + +############################################################################### +# If we'd like to set the property of many items at once, it's useful to use +# the :func:`pyplot.setp` function. This will take a list (or many lists) of +# Matplotlib objects, and attempt to set some style element of each one. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# It looks like this cut off some of the labels on the bottom. We can +# tell Matplotlib to automatically make room for elements in the figures +# that we create. To do this we set the ``autolayout`` value of our +# rcParams. For more information on controlling the style, layout, and +# other features of plots with rcParams, see +# :doc:`/tutorials/introductory/customizing`. + +plt.rcParams.update({'figure.autolayout': True}) + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# Next, we add labels to the plot. To do this with the OO interface, +# we can use the :meth:`.Artist.set` method to set properties of this +# Axes object. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# We can also adjust the size of this plot using the :func:`pyplot.subplots` +# function. We can do this with the *figsize* keyword argument. +# +# .. note:: +# +# While indexing in NumPy follows the form (row, column), the *figsize* +# keyword argument follows the form (width, height). This follows +# conventions in visualization, which unfortunately are different from those +# of linear algebra. + +fig, ax = plt.subplots(figsize=(8, 4)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# For labels, we can specify custom formatting guidelines in the form of +# functions. Below we define a function that takes an integer as input, and +# returns a string as an output. When used with `.Axis.set_major_formatter` or +# `.Axis.set_minor_formatter`, they will automatically create and use a +# :class:`ticker.FuncFormatter` class. +# +# For this function, the ``x`` argument is the original tick label and ``pos`` +# is the tick position. We will only use ``x`` here but both arguments are +# needed. + + +# def currency(x, pos): +# """The two arguments are the value and tick position""" +# if x >= 1e6: +# s = '${:1.1f}M'.format(x*1e-6) +# else: +# s = '${:1.0f}K'.format(x*1e-3) +# return s + +############################################################################### +# We can then apply this function to the labels on our plot. To do this, +# we use the ``xaxis`` attribute of our axes. This lets you perform +# actions on a specific axis on our plot. + +fig, ax = plt.subplots(figsize=(6, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +# ax.xaxis.set_major_formatter(currency) + +############################################################################### +# Combining multiple visualizations +# ================================= +# +# It is possible to draw multiple plot elements on the same instance of +# :class:`axes.Axes`. To do this we simply need to call another one of +# the plot methods on that axes object. + +fig, ax = plt.subplots(figsize=(8, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +# Add a vertical line, here we set the style in the function call +ax.axvline(x=group_mean, ls='--', color='r') +ax.text(group_mean + 3.2, 1.45, "Taiwan average = 80.86", rotation=90, + horizontalalignment='center', fontweight='light', color='red') + +# Annotate new companies +# for group in [3, 5, 8]: +# ax.text(145000, group, "New Company", fontsize=10, +# verticalalignment="center") + +# Now we move our title up since it's getting a little cramped +ax.title.set(y=1.05) + +ax.set(xlim=[-10, 100], xlabel='Age', ylabel='City', + title='Life Expectancy in Taiwan 2021') + +# ax.xaxis.set_major_formatter(currency) +ax.set_xticks([0, 20, 40, 60, 80, 100]) +fig.subplots_adjust(right=.1) + +plt.text(x=0.45, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) + +plt.show() + +############################################################################### +# Saving our plot +# =============== +# +# Now that we're happy with the outcome of our plot, we want to save it to +# disk. There are many file formats we can save to in Matplotlib. To see +# a list of available options, use: + +print(fig.canvas.get_supported_filetypes()) + +############################################################################### +# We can then use the :meth:`figure.Figure.savefig` in order to save the figure +# to disk. Note that there are several useful flags we show below: +# +# * ``transparent=True`` makes the background of the saved figure transparent +# if the format supports it. +# * ``dpi=80`` controls the resolution (dots per square inch) of the output. +# * ``bbox_inches="tight"`` fits the bounds of the figure to our plot. + +# Uncomment this line to save the figure. +# fig.savefig('sales.png', transparent=False, dpi=80, bbox_inches="tight") + +# References: +# diff --git a/The attainments and realizations of my dreams/Average life expectancy/Year 2021-8-2.py b/The attainments and realizations of my dreams/Average life expectancy/Year 2021-8-2.py new file mode 100644 index 00000000..8ba3b3b9 --- /dev/null +++ b/The attainments and realizations of my dreams/Average life expectancy/Year 2021-8-2.py @@ -0,0 +1,290 @@ +""" +======================= +The Lifecycle of a Plot +======================= + +This tutorial aims to show the beginning, middle, and end of a single +visualization using Matplotlib. We'll begin with some raw data and +end by saving a figure of a customized visualization. Along the way we try +to highlight some neat features and best-practices using Matplotlib. + +.. currentmodule:: matplotlib + +.. note:: + + This tutorial is based on + `this excellent blog post + `_ + by Chris Moffitt. It was transformed into this tutorial by Chris Holdgraf. + +A note on the explicit vs. implicit interfaces +============================================== + +Matplotlib has two interfaces. For an explanation of the trade-offs between the +explicit and implicit interfaces see :ref:`api_interfaces`. + +In the explicit object-oriented (OO) interface we directly utilize instances of +:class:`axes.Axes` to build up the visualization in an instance of +:class:`figure.Figure`. In the implicit interface, inspired by and modeled on +MATLAB, we use a global state-based interface which is encapsulated in the +:mod:`.pyplot` module to plot to the "current Axes". See the :doc:`pyplot +tutorials ` for a more in-depth look at the +pyplot interface. + +Most of the terms are straightforward but the main thing to remember +is that: + +* The `.Figure` is the final image, and may contain one or more `~.axes.Axes`. +* The `~.axes.Axes` represents an individual plot (not to be confused with + `~.axis.Axis`, which refers to the x-, y-, or z-axis of a plot). + +We call methods that do the plotting directly from the Axes, which gives +us much more flexibility and power in customizing our plot. + +.. note:: + + In general, use the explicit interface over the implicit pyplot interface + for plotting. + +Our data +======== + +We'll use the data from the post from which this tutorial was derived. +It contains sales information for a number of companies. + +""" + +# sphinx_gallery_thumbnail_number = 10 +import numpy as np +import matplotlib.pyplot as plt + + +data = {'Kaohsiung': 79.96, + 'Tainan': 80.55, + 'Taichung': 81.13, + 'Taoyuan': 81.35, + 'New Taipei': 81.74, + 'Taipei': 84.14, + } + +group_data = list(data.values()) +group_names = list(data.keys()) +group_mean = 80.86 + +############################################################################### +# Getting started +# =============== +# +# This data is naturally visualized as a barplot, with one bar per +# group. To do this with the object-oriented approach, we first generate +# an instance of :class:`figure.Figure` and +# :class:`axes.Axes`. The Figure is like a canvas, and the Axes +# is a part of that canvas on which we will make a particular visualization. +# +# .. note:: +# +# Figures can have multiple axes on them. For information on how to do this, +# see the :doc:`Tight Layout tutorial +# `. + +fig, ax = plt.subplots() + +############################################################################### +# Now that we have an Axes instance, we can plot on top of it. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# Controlling the style +# ===================== +# +# There are many styles available in Matplotlib in order to let you tailor +# your visualization to your needs. To see a list of styles, we can use +# :mod:`.style`. + +print(plt.style.available) + +############################################################################### +# You can activate a style with the following: + +plt.style.use('fivethirtyeight') + +############################################################################### +# Now let's remake the above plot to see how it looks: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# The style controls many things, such as color, linewidths, backgrounds, +# etc. +# +# Customizing the plot +# ==================== +# +# Now we've got a plot with the general look that we want, so let's fine-tune +# it so that it's ready for print. First let's rotate the labels on the x-axis +# so that they show up more clearly. We can gain access to these labels +# with the :meth:`axes.Axes.get_xticklabels` method: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() + +############################################################################### +# If we'd like to set the property of many items at once, it's useful to use +# the :func:`pyplot.setp` function. This will take a list (or many lists) of +# Matplotlib objects, and attempt to set some style element of each one. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# It looks like this cut off some of the labels on the bottom. We can +# tell Matplotlib to automatically make room for elements in the figures +# that we create. To do this we set the ``autolayout`` value of our +# rcParams. For more information on controlling the style, layout, and +# other features of plots with rcParams, see +# :doc:`/tutorials/introductory/customizing`. + +plt.rcParams.update({'figure.autolayout': True}) + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# Next, we add labels to the plot. To do this with the OO interface, +# we can use the :meth:`.Artist.set` method to set properties of this +# Axes object. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# We can also adjust the size of this plot using the :func:`pyplot.subplots` +# function. We can do this with the *figsize* keyword argument. +# +# .. note:: +# +# While indexing in NumPy follows the form (row, column), the *figsize* +# keyword argument follows the form (width, height). This follows +# conventions in visualization, which unfortunately are different from those +# of linear algebra. + +fig, ax = plt.subplots(figsize=(8, 4)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# For labels, we can specify custom formatting guidelines in the form of +# functions. Below we define a function that takes an integer as input, and +# returns a string as an output. When used with `.Axis.set_major_formatter` or +# `.Axis.set_minor_formatter`, they will automatically create and use a +# :class:`ticker.FuncFormatter` class. +# +# For this function, the ``x`` argument is the original tick label and ``pos`` +# is the tick position. We will only use ``x`` here but both arguments are +# needed. + + +# def currency(x, pos): +# """The two arguments are the value and tick position""" +# if x >= 1e6: +# s = '${:1.1f}M'.format(x*1e-6) +# else: +# s = '${:1.0f}K'.format(x*1e-3) +# return s + +############################################################################### +# We can then apply this function to the labels on our plot. To do this, +# we use the ``xaxis`` attribute of our axes. This lets you perform +# actions on a specific axis on our plot. + +fig, ax = plt.subplots(figsize=(6, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +# ax.xaxis.set_major_formatter(currency) + +############################################################################### +# Combining multiple visualizations +# ================================= +# +# It is possible to draw multiple plot elements on the same instance of +# :class:`axes.Axes`. To do this we simply need to call another one of +# the plot methods on that axes object. + +fig, ax = plt.subplots(figsize=(8, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +# Add a vertical line, here we set the style in the function call +ax.axvline(x=group_mean, ls='--', color='r') +ax.text(group_mean + 3.2, 1.45, "Taiwan average = 80.86", rotation=90, + horizontalalignment='center', fontweight='light', color='red') + +# Annotate new companies +# for group in [3, 5, 8]: +# ax.text(145000, group, "New Company", fontsize=10, +# verticalalignment="center") + +# Now we move our title up since it's getting a little cramped +ax.title.set(y=1.05) + +ax.set(xlim=[-10, 100], xlabel='Age', ylabel='City', + title='Life Expectancy in Taiwan 2021') + +# ax.xaxis.set_major_formatter(currency) +ax.set_xticks([0, 20, 40, 60, 80, 100]) +fig.subplots_adjust(right=.1) + +plt.text(x=0.45, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) + +plt.text(x=0.45, y=0.01, s="Reference: https://dep.mohw.gov.tw/DOS/lp-5082-113.html", fontsize=10, + color='black', alpha=0.9, ha='center', va='center', rotation=0, transform=ax.transAxes) + +plt.show() + +############################################################################### +# Saving our plot +# =============== +# +# Now that we're happy with the outcome of our plot, we want to save it to +# disk. There are many file formats we can save to in Matplotlib. To see +# a list of available options, use: + +print(fig.canvas.get_supported_filetypes()) + +############################################################################### +# We can then use the :meth:`figure.Figure.savefig` in order to save the figure +# to disk. Note that there are several useful flags we show below: +# +# * ``transparent=True`` makes the background of the saved figure transparent +# if the format supports it. +# * ``dpi=80`` controls the resolution (dots per square inch) of the output. +# * ``bbox_inches="tight"`` fits the bounds of the figure to our plot. + +# Uncomment this line to save the figure. +# fig.savefig('sales.png', transparent=False, dpi=80, bbox_inches="tight") + +# References: +# https://ws.moi.gov.tw/Download.ashx?u=LzAwMS9VcGxvYWQvNDAwL3JlbGZpbGUvOTAwOS8yNjQ3MjkvMzllMWQ1MDYtMmFhMy00NGVjLWEwZmItZDQ5ODhhOTQyNzM2LnBkZg%3d%3d&n=MTEx5bm056ysMzTpgLHlhafmlL%2fntbHoqIjpgJrloLFf55Sf5ZG96KGo6YCa5aCxLnBkZg%3d%3d diff --git a/The attainments and realizations of my dreams/Average life expectancy/Year 2021-8-3.py b/The attainments and realizations of my dreams/Average life expectancy/Year 2021-8-3.py new file mode 100644 index 00000000..ca494d84 --- /dev/null +++ b/The attainments and realizations of my dreams/Average life expectancy/Year 2021-8-3.py @@ -0,0 +1,290 @@ +""" +======================= +The Lifecycle of a Plot +======================= + +This tutorial aims to show the beginning, middle, and end of a single +visualization using Matplotlib. We'll begin with some raw data and +end by saving a figure of a customized visualization. Along the way we try +to highlight some neat features and best-practices using Matplotlib. + +.. currentmodule:: matplotlib + +.. note:: + + This tutorial is based on + `this excellent blog post + `_ + by Chris Moffitt. It was transformed into this tutorial by Chris Holdgraf. + +A note on the explicit vs. implicit interfaces +============================================== + +Matplotlib has two interfaces. For an explanation of the trade-offs between the +explicit and implicit interfaces see :ref:`api_interfaces`. + +In the explicit object-oriented (OO) interface we directly utilize instances of +:class:`axes.Axes` to build up the visualization in an instance of +:class:`figure.Figure`. In the implicit interface, inspired by and modeled on +MATLAB, we use a global state-based interface which is encapsulated in the +:mod:`.pyplot` module to plot to the "current Axes". See the :doc:`pyplot +tutorials ` for a more in-depth look at the +pyplot interface. + +Most of the terms are straightforward but the main thing to remember +is that: + +* The `.Figure` is the final image, and may contain one or more `~.axes.Axes`. +* The `~.axes.Axes` represents an individual plot (not to be confused with + `~.axis.Axis`, which refers to the x-, y-, or z-axis of a plot). + +We call methods that do the plotting directly from the Axes, which gives +us much more flexibility and power in customizing our plot. + +.. note:: + + In general, use the explicit interface over the implicit pyplot interface + for plotting. + +Our data +======== + +We'll use the data from the post from which this tutorial was derived. +It contains sales information for a number of companies. + +""" + +# sphinx_gallery_thumbnail_number = 10 +import numpy as np +import matplotlib.pyplot as plt + + +data = {'Kaohsiung': 79.96, + 'Tainan': 80.55, + 'Taichung': 81.13, + 'Taoyuan': 81.35, + 'New Taipei': 81.74, + 'Taipei': 84.14, + } + +group_data = list(data.values()) +group_names = list(data.keys()) +group_mean = 80.86 + +############################################################################### +# Getting started +# =============== +# +# This data is naturally visualized as a barplot, with one bar per +# group. To do this with the object-oriented approach, we first generate +# an instance of :class:`figure.Figure` and +# :class:`axes.Axes`. The Figure is like a canvas, and the Axes +# is a part of that canvas on which we will make a particular visualization. +# +# .. note:: +# +# Figures can have multiple axes on them. For information on how to do this, +# see the :doc:`Tight Layout tutorial +# `. + +fig, ax = plt.subplots() + +############################################################################### +# Now that we have an Axes instance, we can plot on top of it. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# Controlling the style +# ===================== +# +# There are many styles available in Matplotlib in order to let you tailor +# your visualization to your needs. To see a list of styles, we can use +# :mod:`.style`. + +print(plt.style.available) + +############################################################################### +# You can activate a style with the following: + +plt.style.use('fivethirtyeight') + +############################################################################### +# Now let's remake the above plot to see how it looks: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# The style controls many things, such as color, linewidths, backgrounds, +# etc. +# +# Customizing the plot +# ==================== +# +# Now we've got a plot with the general look that we want, so let's fine-tune +# it so that it's ready for print. First let's rotate the labels on the x-axis +# so that they show up more clearly. We can gain access to these labels +# with the :meth:`axes.Axes.get_xticklabels` method: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() + +############################################################################### +# If we'd like to set the property of many items at once, it's useful to use +# the :func:`pyplot.setp` function. This will take a list (or many lists) of +# Matplotlib objects, and attempt to set some style element of each one. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# It looks like this cut off some of the labels on the bottom. We can +# tell Matplotlib to automatically make room for elements in the figures +# that we create. To do this we set the ``autolayout`` value of our +# rcParams. For more information on controlling the style, layout, and +# other features of plots with rcParams, see +# :doc:`/tutorials/introductory/customizing`. + +plt.rcParams.update({'figure.autolayout': True}) + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# Next, we add labels to the plot. To do this with the OO interface, +# we can use the :meth:`.Artist.set` method to set properties of this +# Axes object. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# We can also adjust the size of this plot using the :func:`pyplot.subplots` +# function. We can do this with the *figsize* keyword argument. +# +# .. note:: +# +# While indexing in NumPy follows the form (row, column), the *figsize* +# keyword argument follows the form (width, height). This follows +# conventions in visualization, which unfortunately are different from those +# of linear algebra. + +fig, ax = plt.subplots(figsize=(8, 4)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# For labels, we can specify custom formatting guidelines in the form of +# functions. Below we define a function that takes an integer as input, and +# returns a string as an output. When used with `.Axis.set_major_formatter` or +# `.Axis.set_minor_formatter`, they will automatically create and use a +# :class:`ticker.FuncFormatter` class. +# +# For this function, the ``x`` argument is the original tick label and ``pos`` +# is the tick position. We will only use ``x`` here but both arguments are +# needed. + + +# def currency(x, pos): +# """The two arguments are the value and tick position""" +# if x >= 1e6: +# s = '${:1.1f}M'.format(x*1e-6) +# else: +# s = '${:1.0f}K'.format(x*1e-3) +# return s + +############################################################################### +# We can then apply this function to the labels on our plot. To do this, +# we use the ``xaxis`` attribute of our axes. This lets you perform +# actions on a specific axis on our plot. + +fig, ax = plt.subplots(figsize=(6, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +# ax.xaxis.set_major_formatter(currency) + +############################################################################### +# Combining multiple visualizations +# ================================= +# +# It is possible to draw multiple plot elements on the same instance of +# :class:`axes.Axes`. To do this we simply need to call another one of +# the plot methods on that axes object. + +fig, ax = plt.subplots(figsize=(8, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +# Add a vertical line, here we set the style in the function call +ax.axvline(x=group_mean, ls='--', color='r') +ax.text(group_mean + 3.5, 1.45, "Taiwan average = 80.86", rotation=90, + horizontalalignment='center', fontweight='light', color='red') + +# Annotate new companies +# for group in [3, 5, 8]: +# ax.text(145000, group, "New Company", fontsize=10, +# verticalalignment="center") + +# Now we move our title up since it's getting a little cramped +ax.title.set(y=1.05) + +ax.set(xlim=[-10, 100], xlabel='Age', ylabel='City', + title='Life Expectancy in Taiwan 2021') + +# ax.xaxis.set_major_formatter(currency) +ax.set_xticks([0, 20, 40, 60, 80, 100]) +fig.subplots_adjust(right=.1) + +plt.text(x=0.45, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) + +plt.text(x=0.45, y=0.01, s="Reference: https://dep.mohw.gov.tw/DOS/lp-5082-113.html", fontsize=10, + color='black', alpha=0.9, ha='center', va='center', rotation=0, transform=ax.transAxes) + +plt.show() + +############################################################################### +# Saving our plot +# =============== +# +# Now that we're happy with the outcome of our plot, we want to save it to +# disk. There are many file formats we can save to in Matplotlib. To see +# a list of available options, use: + +print(fig.canvas.get_supported_filetypes()) + +############################################################################### +# We can then use the :meth:`figure.Figure.savefig` in order to save the figure +# to disk. Note that there are several useful flags we show below: +# +# * ``transparent=True`` makes the background of the saved figure transparent +# if the format supports it. +# * ``dpi=80`` controls the resolution (dots per square inch) of the output. +# * ``bbox_inches="tight"`` fits the bounds of the figure to our plot. + +# Uncomment this line to save the figure. +# fig.savefig('sales.png', transparent=False, dpi=80, bbox_inches="tight") + +# References: +# https://ws.moi.gov.tw/Download.ashx?u=LzAwMS9VcGxvYWQvNDAwL3JlbGZpbGUvOTAwOS8yNjQ3MjkvMzllMWQ1MDYtMmFhMy00NGVjLWEwZmItZDQ5ODhhOTQyNzM2LnBkZg%3d%3d&n=MTEx5bm056ysMzTpgLHlhafmlL%2fntbHoqIjpgJrloLFf55Sf5ZG96KGo6YCa5aCxLnBkZg%3d%3d diff --git a/The attainments and realizations of my dreams/Average life expectancy/Year 2021-8.py b/The attainments and realizations of my dreams/Average life expectancy/Year 2021-8.py new file mode 100644 index 00000000..73268ae8 --- /dev/null +++ b/The attainments and realizations of my dreams/Average life expectancy/Year 2021-8.py @@ -0,0 +1,290 @@ +""" +======================= +The Lifecycle of a Plot +======================= + +This tutorial aims to show the beginning, middle, and end of a single +visualization using Matplotlib. We'll begin with some raw data and +end by saving a figure of a customized visualization. Along the way we try +to highlight some neat features and best-practices using Matplotlib. + +.. currentmodule:: matplotlib + +.. note:: + + This tutorial is based on + `this excellent blog post + `_ + by Chris Moffitt. It was transformed into this tutorial by Chris Holdgraf. + +A note on the explicit vs. implicit interfaces +============================================== + +Matplotlib has two interfaces. For an explanation of the trade-offs between the +explicit and implicit interfaces see :ref:`api_interfaces`. + +In the explicit object-oriented (OO) interface we directly utilize instances of +:class:`axes.Axes` to build up the visualization in an instance of +:class:`figure.Figure`. In the implicit interface, inspired by and modeled on +MATLAB, we use a global state-based interface which is encapsulated in the +:mod:`.pyplot` module to plot to the "current Axes". See the :doc:`pyplot +tutorials ` for a more in-depth look at the +pyplot interface. + +Most of the terms are straightforward but the main thing to remember +is that: + +* The `.Figure` is the final image, and may contain one or more `~.axes.Axes`. +* The `~.axes.Axes` represents an individual plot (not to be confused with + `~.axis.Axis`, which refers to the x-, y-, or z-axis of a plot). + +We call methods that do the plotting directly from the Axes, which gives +us much more flexibility and power in customizing our plot. + +.. note:: + + In general, use the explicit interface over the implicit pyplot interface + for plotting. + +Our data +======== + +We'll use the data from the post from which this tutorial was derived. +It contains sales information for a number of companies. + +""" + +# sphinx_gallery_thumbnail_number = 10 +import numpy as np +import matplotlib.pyplot as plt + + +data = {'Kaohsiung': 79.96, + 'Tainan': 80.55, + 'Taichung': 81.13, + 'Taoyuan': 81.35, + 'New Taipei': 81.74, + 'Taipei': 84.14, + } + +group_data = list(data.values()) +group_names = list(data.keys()) +group_mean = 80.86 + +############################################################################### +# Getting started +# =============== +# +# This data is naturally visualized as a barplot, with one bar per +# group. To do this with the object-oriented approach, we first generate +# an instance of :class:`figure.Figure` and +# :class:`axes.Axes`. The Figure is like a canvas, and the Axes +# is a part of that canvas on which we will make a particular visualization. +# +# .. note:: +# +# Figures can have multiple axes on them. For information on how to do this, +# see the :doc:`Tight Layout tutorial +# `. + +fig, ax = plt.subplots() + +############################################################################### +# Now that we have an Axes instance, we can plot on top of it. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# Controlling the style +# ===================== +# +# There are many styles available in Matplotlib in order to let you tailor +# your visualization to your needs. To see a list of styles, we can use +# :mod:`.style`. + +print(plt.style.available) + +############################################################################### +# You can activate a style with the following: + +plt.style.use('fivethirtyeight') + +############################################################################### +# Now let's remake the above plot to see how it looks: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# The style controls many things, such as color, linewidths, backgrounds, +# etc. +# +# Customizing the plot +# ==================== +# +# Now we've got a plot with the general look that we want, so let's fine-tune +# it so that it's ready for print. First let's rotate the labels on the x-axis +# so that they show up more clearly. We can gain access to these labels +# with the :meth:`axes.Axes.get_xticklabels` method: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() + +############################################################################### +# If we'd like to set the property of many items at once, it's useful to use +# the :func:`pyplot.setp` function. This will take a list (or many lists) of +# Matplotlib objects, and attempt to set some style element of each one. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# It looks like this cut off some of the labels on the bottom. We can +# tell Matplotlib to automatically make room for elements in the figures +# that we create. To do this we set the ``autolayout`` value of our +# rcParams. For more information on controlling the style, layout, and +# other features of plots with rcParams, see +# :doc:`/tutorials/introductory/customizing`. + +plt.rcParams.update({'figure.autolayout': True}) + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# Next, we add labels to the plot. To do this with the OO interface, +# we can use the :meth:`.Artist.set` method to set properties of this +# Axes object. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# We can also adjust the size of this plot using the :func:`pyplot.subplots` +# function. We can do this with the *figsize* keyword argument. +# +# .. note:: +# +# While indexing in NumPy follows the form (row, column), the *figsize* +# keyword argument follows the form (width, height). This follows +# conventions in visualization, which unfortunately are different from those +# of linear algebra. + +fig, ax = plt.subplots(figsize=(8, 4)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# For labels, we can specify custom formatting guidelines in the form of +# functions. Below we define a function that takes an integer as input, and +# returns a string as an output. When used with `.Axis.set_major_formatter` or +# `.Axis.set_minor_formatter`, they will automatically create and use a +# :class:`ticker.FuncFormatter` class. +# +# For this function, the ``x`` argument is the original tick label and ``pos`` +# is the tick position. We will only use ``x`` here but both arguments are +# needed. + + +# def currency(x, pos): +# """The two arguments are the value and tick position""" +# if x >= 1e6: +# s = '${:1.1f}M'.format(x*1e-6) +# else: +# s = '${:1.0f}K'.format(x*1e-3) +# return s + +############################################################################### +# We can then apply this function to the labels on our plot. To do this, +# we use the ``xaxis`` attribute of our axes. This lets you perform +# actions on a specific axis on our plot. + +fig, ax = plt.subplots(figsize=(6, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +# ax.xaxis.set_major_formatter(currency) + +############################################################################### +# Combining multiple visualizations +# ================================= +# +# It is possible to draw multiple plot elements on the same instance of +# :class:`axes.Axes`. To do this we simply need to call another one of +# the plot methods on that axes object. + +fig, ax = plt.subplots(figsize=(8, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +# Add a vertical line, here we set the style in the function call +ax.axvline(x=group_mean, ls='--', color='r') +ax.text(group_mean + 3.2, 1.45, "Taiwan average = 80.86", rotation=90, + horizontalalignment='center', fontweight='light', color='red') + +# Annotate new companies +# for group in [3, 5, 8]: +# ax.text(145000, group, "New Company", fontsize=10, +# verticalalignment="center") + +# Now we move our title up since it's getting a little cramped +ax.title.set(y=1.05) + +ax.set(xlim=[-10, 100], xlabel='Age', ylabel='City', + title='Life Expectancy in Taiwan 2021') + +# ax.xaxis.set_major_formatter(currency) +ax.set_xticks([0, 20, 40, 60, 80, 100]) +fig.subplots_adjust(right=.1) + +plt.text(x=0.45, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) + +plt.text(x=0.35, y=0.01, s="Reference: https://dep.mohw.gov.tw/DOS/lp-5082-113.html", fontsize=10, + color='black', alpha=0.9, ha='center', va='center', rotation=0, transform=ax.transAxes) + +plt.show() + +############################################################################### +# Saving our plot +# =============== +# +# Now that we're happy with the outcome of our plot, we want to save it to +# disk. There are many file formats we can save to in Matplotlib. To see +# a list of available options, use: + +print(fig.canvas.get_supported_filetypes()) + +############################################################################### +# We can then use the :meth:`figure.Figure.savefig` in order to save the figure +# to disk. Note that there are several useful flags we show below: +# +# * ``transparent=True`` makes the background of the saved figure transparent +# if the format supports it. +# * ``dpi=80`` controls the resolution (dots per square inch) of the output. +# * ``bbox_inches="tight"`` fits the bounds of the figure to our plot. + +# Uncomment this line to save the figure. +# fig.savefig('sales.png', transparent=False, dpi=80, bbox_inches="tight") + +# References: +# diff --git a/The attainments and realizations of my dreams/Average life expectancy/Year 2021.py b/The attainments and realizations of my dreams/Average life expectancy/Year 2021.py new file mode 100644 index 00000000..1e111e02 --- /dev/null +++ b/The attainments and realizations of my dreams/Average life expectancy/Year 2021.py @@ -0,0 +1,279 @@ +""" +======================= +The Lifecycle of a Plot +======================= + +This tutorial aims to show the beginning, middle, and end of a single +visualization using Matplotlib. We'll begin with some raw data and +end by saving a figure of a customized visualization. Along the way we try +to highlight some neat features and best-practices using Matplotlib. + +.. currentmodule:: matplotlib + +.. note:: + + This tutorial is based on + `this excellent blog post + `_ + by Chris Moffitt. It was transformed into this tutorial by Chris Holdgraf. + +A note on the explicit vs. implicit interfaces +============================================== + +Matplotlib has two interfaces. For an explanation of the trade-offs between the +explicit and implicit interfaces see :ref:`api_interfaces`. + +In the explicit object-oriented (OO) interface we directly utilize instances of +:class:`axes.Axes` to build up the visualization in an instance of +:class:`figure.Figure`. In the implicit interface, inspired by and modeled on +MATLAB, we use a global state-based interface which is encapsulated in the +:mod:`.pyplot` module to plot to the "current Axes". See the :doc:`pyplot +tutorials ` for a more in-depth look at the +pyplot interface. + +Most of the terms are straightforward but the main thing to remember +is that: + +* The `.Figure` is the final image, and may contain one or more `~.axes.Axes`. +* The `~.axes.Axes` represents an individual plot (not to be confused with + `~.axis.Axis`, which refers to the x-, y-, or z-axis of a plot). + +We call methods that do the plotting directly from the Axes, which gives +us much more flexibility and power in customizing our plot. + +.. note:: + + In general, use the explicit interface over the implicit pyplot interface + for plotting. + +Our data +======== + +We'll use the data from the post from which this tutorial was derived. +It contains sales information for a number of companies. + +""" + +# sphinx_gallery_thumbnail_number = 10 +import numpy as np +import matplotlib.pyplot as plt + + +data = {'Taipei': 84.14, + 'Kaohsiung': 79.96, + } + +group_data = list(data.values()) +group_names = list(data.keys()) +group_mean = 80.86 + +############################################################################### +# Getting started +# =============== +# +# This data is naturally visualized as a barplot, with one bar per +# group. To do this with the object-oriented approach, we first generate +# an instance of :class:`figure.Figure` and +# :class:`axes.Axes`. The Figure is like a canvas, and the Axes +# is a part of that canvas on which we will make a particular visualization. +# +# .. note:: +# +# Figures can have multiple axes on them. For information on how to do this, +# see the :doc:`Tight Layout tutorial +# `. + +fig, ax = plt.subplots() + +############################################################################### +# Now that we have an Axes instance, we can plot on top of it. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# Controlling the style +# ===================== +# +# There are many styles available in Matplotlib in order to let you tailor +# your visualization to your needs. To see a list of styles, we can use +# :mod:`.style`. + +print(plt.style.available) + +############################################################################### +# You can activate a style with the following: + +plt.style.use('fivethirtyeight') + +############################################################################### +# Now let's remake the above plot to see how it looks: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# The style controls many things, such as color, linewidths, backgrounds, +# etc. +# +# Customizing the plot +# ==================== +# +# Now we've got a plot with the general look that we want, so let's fine-tune +# it so that it's ready for print. First let's rotate the labels on the x-axis +# so that they show up more clearly. We can gain access to these labels +# with the :meth:`axes.Axes.get_xticklabels` method: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() + +############################################################################### +# If we'd like to set the property of many items at once, it's useful to use +# the :func:`pyplot.setp` function. This will take a list (or many lists) of +# Matplotlib objects, and attempt to set some style element of each one. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# It looks like this cut off some of the labels on the bottom. We can +# tell Matplotlib to automatically make room for elements in the figures +# that we create. To do this we set the ``autolayout`` value of our +# rcParams. For more information on controlling the style, layout, and +# other features of plots with rcParams, see +# :doc:`/tutorials/introductory/customizing`. + +plt.rcParams.update({'figure.autolayout': True}) + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# Next, we add labels to the plot. To do this with the OO interface, +# we can use the :meth:`.Artist.set` method to set properties of this +# Axes object. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# We can also adjust the size of this plot using the :func:`pyplot.subplots` +# function. We can do this with the *figsize* keyword argument. +# +# .. note:: +# +# While indexing in NumPy follows the form (row, column), the *figsize* +# keyword argument follows the form (width, height). This follows +# conventions in visualization, which unfortunately are different from those +# of linear algebra. + +fig, ax = plt.subplots(figsize=(8, 4)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# For labels, we can specify custom formatting guidelines in the form of +# functions. Below we define a function that takes an integer as input, and +# returns a string as an output. When used with `.Axis.set_major_formatter` or +# `.Axis.set_minor_formatter`, they will automatically create and use a +# :class:`ticker.FuncFormatter` class. +# +# For this function, the ``x`` argument is the original tick label and ``pos`` +# is the tick position. We will only use ``x`` here but both arguments are +# needed. + + +# def currency(x, pos): +# """The two arguments are the value and tick position""" +# if x >= 1e6: +# s = '${:1.1f}M'.format(x*1e-6) +# else: +# s = '${:1.0f}K'.format(x*1e-3) +# return s + +############################################################################### +# We can then apply this function to the labels on our plot. To do this, +# we use the ``xaxis`` attribute of our axes. This lets you perform +# actions on a specific axis on our plot. + +fig, ax = plt.subplots(figsize=(6, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +# ax.xaxis.set_major_formatter(currency) + +############################################################################### +# Combining multiple visualizations +# ================================= +# +# It is possible to draw multiple plot elements on the same instance of +# :class:`axes.Axes`. To do this we simply need to call another one of +# the plot methods on that axes object. + +fig, ax = plt.subplots(figsize=(8, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +# Add a vertical line, here we set the style in the function call +ax.axvline(x=group_mean, ls='--', color='r') +ax.text(group_mean, 0.5, "Nationwide average", + horizontalalignment='center', fontweight='bold', color='red') + +# Annotate new companies +# for group in [3, 5, 8]: +# ax.text(145000, group, "New Company", fontsize=10, +# verticalalignment="center") + +# Now we move our title up since it's getting a little cramped +ax.title.set(y=1.05) + +ax.set(xlim=[-10, 100], xlabel='Age', ylabel='City', + title='Average Life Expectancy in 2021') + +# ax.xaxis.set_major_formatter(currency) +ax.set_xticks([0, 20, 40, 60, 80, 100]) +fig.subplots_adjust(right=.1) + +plt.show() + +############################################################################### +# Saving our plot +# =============== +# +# Now that we're happy with the outcome of our plot, we want to save it to +# disk. There are many file formats we can save to in Matplotlib. To see +# a list of available options, use: + +print(fig.canvas.get_supported_filetypes()) + +############################################################################### +# We can then use the :meth:`figure.Figure.savefig` in order to save the figure +# to disk. Note that there are several useful flags we show below: +# +# * ``transparent=True`` makes the background of the saved figure transparent +# if the format supports it. +# * ``dpi=80`` controls the resolution (dots per square inch) of the output. +# * ``bbox_inches="tight"`` fits the bounds of the figure to our plot. + +# Uncomment this line to save the figure. +# fig.savefig('sales.png', transparent=False, dpi=80, bbox_inches="tight") + +# References: +# diff --git a/The attainments and realizations of my dreams/Average life expectancy/__init__.py b/The attainments and realizations of my dreams/Average life expectancy/__init__.py new file mode 100644 index 00000000..66379311 --- /dev/null +++ b/The attainments and realizations of my dreams/Average life expectancy/__init__.py @@ -0,0 +1,279 @@ +""" +======================= +The Lifecycle of a Plot +======================= + +This tutorial aims to show the beginning, middle, and end of a single +visualization using Matplotlib. We'll begin with some raw data and +end by saving a figure of a customized visualization. Along the way we try +to highlight some neat features and best-practices using Matplotlib. + +.. currentmodule:: matplotlib + +.. note:: + + This tutorial is based on + `this excellent blog post + `_ + by Chris Moffitt. It was transformed into this tutorial by Chris Holdgraf. + +A note on the explicit vs. implicit interfaces +============================================== + +Matplotlib has two interfaces. For an explanation of the trade-offs between the +explicit and implicit interfaces see :ref:`api_interfaces`. + +In the explicit object-oriented (OO) interface we directly utilize instances of +:class:`axes.Axes` to build up the visualization in an instance of +:class:`figure.Figure`. In the implicit interface, inspired by and modeled on +MATLAB, we use a global state-based interface which is encapsulated in the +:mod:`.pyplot` module to plot to the "current Axes". See the :doc:`pyplot +tutorials ` for a more in-depth look at the +pyplot interface. + +Most of the terms are straightforward but the main thing to remember +is that: + +* The `.Figure` is the final image, and may contain one or more `~.axes.Axes`. +* The `~.axes.Axes` represents an individual plot (not to be confused with + `~.axis.Axis`, which refers to the x-, y-, or z-axis of a plot). + +We call methods that do the plotting directly from the Axes, which gives +us much more flexibility and power in customizing our plot. + +.. note:: + + In general, use the explicit interface over the implicit pyplot interface + for plotting. + +Our data +======== + +We'll use the data from the post from which this tutorial was derived. +It contains sales information for a number of companies. + +""" + +# sphinx_gallery_thumbnail_number = 10 +import numpy as np +import matplotlib.pyplot as plt + + +data = {'Taipei': 84.14, + 'Kaohsiung': 79.96, + } + +group_data = list(data.values()) +group_names = list(data.keys()) +group_mean = 80.86 + +############################################################################### +# Getting started +# =============== +# +# This data is naturally visualized as a barplot, with one bar per +# group. To do this with the object-oriented approach, we first generate +# an instance of :class:`figure.Figure` and +# :class:`axes.Axes`. The Figure is like a canvas, and the Axes +# is a part of that canvas on which we will make a particular visualization. +# +# .. note:: +# +# Figures can have multiple axes on them. For information on how to do this, +# see the :doc:`Tight Layout tutorial +# `. + +fig, ax = plt.subplots() + +############################################################################### +# Now that we have an Axes instance, we can plot on top of it. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# Controlling the style +# ===================== +# +# There are many styles available in Matplotlib in order to let you tailor +# your visualization to your needs. To see a list of styles, we can use +# :mod:`.style`. + +print(plt.style.available) + +############################################################################### +# You can activate a style with the following: + +plt.style.use('fivethirtyeight') + +############################################################################### +# Now let's remake the above plot to see how it looks: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# The style controls many things, such as color, linewidths, backgrounds, +# etc. +# +# Customizing the plot +# ==================== +# +# Now we've got a plot with the general look that we want, so let's fine-tune +# it so that it's ready for print. First let's rotate the labels on the x-axis +# so that they show up more clearly. We can gain access to these labels +# with the :meth:`axes.Axes.get_xticklabels` method: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() + +############################################################################### +# If we'd like to set the property of many items at once, it's useful to use +# the :func:`pyplot.setp` function. This will take a list (or many lists) of +# Matplotlib objects, and attempt to set some style element of each one. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# It looks like this cut off some of the labels on the bottom. We can +# tell Matplotlib to automatically make room for elements in the figures +# that we create. To do this we set the ``autolayout`` value of our +# rcParams. For more information on controlling the style, layout, and +# other features of plots with rcParams, see +# :doc:`/tutorials/introductory/customizing`. + +plt.rcParams.update({'figure.autolayout': True}) + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# Next, we add labels to the plot. To do this with the OO interface, +# we can use the :meth:`.Artist.set` method to set properties of this +# Axes object. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# We can also adjust the size of this plot using the :func:`pyplot.subplots` +# function. We can do this with the *figsize* keyword argument. +# +# .. note:: +# +# While indexing in NumPy follows the form (row, column), the *figsize* +# keyword argument follows the form (width, height). This follows +# conventions in visualization, which unfortunately are different from those +# of linear algebra. + +fig, ax = plt.subplots(figsize=(8, 4)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +############################################################################### +# For labels, we can specify custom formatting guidelines in the form of +# functions. Below we define a function that takes an integer as input, and +# returns a string as an output. When used with `.Axis.set_major_formatter` or +# `.Axis.set_minor_formatter`, they will automatically create and use a +# :class:`ticker.FuncFormatter` class. +# +# For this function, the ``x`` argument is the original tick label and ``pos`` +# is the tick position. We will only use ``x`` here but both arguments are +# needed. + + +# def currency(x, pos): +# """The two arguments are the value and tick position""" +# if x >= 1e6: +# s = '${:1.1f}M'.format(x*1e-6) +# else: +# s = '${:1.0f}K'.format(x*1e-3) +# return s + +############################################################################### +# We can then apply this function to the labels on our plot. To do this, +# we use the ``xaxis`` attribute of our axes. This lets you perform +# actions on a specific axis on our plot. + +fig, ax = plt.subplots(figsize=(6, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +# ax.xaxis.set_major_formatter(currency) + +############################################################################### +# Combining multiple visualizations +# ================================= +# +# It is possible to draw multiple plot elements on the same instance of +# :class:`axes.Axes`. To do this we simply need to call another one of +# the plot methods on that axes object. + +fig, ax = plt.subplots(figsize=(8, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +# Add a vertical line, here we set the style in the function call +ax.axvline(x=group_mean, ls='--', color='r') +ax.text(group_mean, 0.5, "Nationwide average", rotation=90, # [1] + horizontalalignment='center', fontweight='bold', color='red') + +# Annotate new companies +# for group in [3, 5, 8]: +# ax.text(145000, group, "New Company", fontsize=10, +# verticalalignment="center") + +# Now we move our title up since it's getting a little cramped +ax.title.set(y=1.05) + +ax.set(xlim=[-10, 100], xlabel='Average life expectancy', ylabel='City', + title='Average Life Expectancy in 2021') + +# ax.xaxis.set_major_formatter(currency) +ax.set_xticks([0, 20, 40, 60, 80, 100]) +fig.subplots_adjust(right=.1) + +plt.show() + +############################################################################### +# Saving our plot +# =============== +# +# Now that we're happy with the outcome of our plot, we want to save it to +# disk. There are many file formats we can save to in Matplotlib. To see +# a list of available options, use: + +print(fig.canvas.get_supported_filetypes()) + +############################################################################### +# We can then use the :meth:`figure.Figure.savefig` in order to save the figure +# to disk. Note that there are several useful flags we show below: +# +# * ``transparent=True`` makes the background of the saved figure transparent +# if the format supports it. +# * ``dpi=80`` controls the resolution (dots per square inch) of the output. +# * ``bbox_inches="tight"`` fits the bounds of the figure to our plot. + +# Uncomment this line to save the figure. +# fig.savefig('sales.png', transparent=False, dpi=80, bbox_inches="tight") + +# References: +# 1. https://stackoverflow.com/a/70595101/ diff --git a/The attainments and realizations of my dreams/Average life expectancy/lifecycle-2.py b/The attainments and realizations of my dreams/Average life expectancy/lifecycle-2.py new file mode 100644 index 00000000..38e61f0b --- /dev/null +++ b/The attainments and realizations of my dreams/Average life expectancy/lifecycle-2.py @@ -0,0 +1,277 @@ +""" +======================= +The Lifecycle of a Plot +======================= + +This tutorial aims to show the beginning, middle, and end of a single +visualization using Matplotlib. We'll begin with some raw data and +end by saving a figure of a customized visualization. Along the way we try +to highlight some neat features and best-practices using Matplotlib. + +.. currentmodule:: matplotlib + +.. note:: + + This tutorial is based on + `this excellent blog post + `_ + by Chris Moffitt. It was transformed into this tutorial by Chris Holdgraf. + +A note on the explicit vs. implicit interfaces +============================================== + +Matplotlib has two interfaces. For an explanation of the trade-offs between the +explicit and implicit interfaces see :ref:`api_interfaces`. + +In the explicit object-oriented (OO) interface we directly utilize instances of +:class:`axes.Axes` to build up the visualization in an instance of +:class:`figure.Figure`. In the implicit interface, inspired by and modeled on +MATLAB, we use a global state-based interface which is encapsulated in the +:mod:`.pyplot` module to plot to the "current Axes". See the :doc:`pyplot +tutorials ` for a more in-depth look at the +pyplot interface. + +Most of the terms are straightforward but the main thing to remember +is that: + +* The `.Figure` is the final image, and may contain one or more `~.axes.Axes`. +* The `~.axes.Axes` represents an individual plot (not to be confused with + `~.axis.Axis`, which refers to the x-, y-, or z-axis of a plot). + +We call methods that do the plotting directly from the Axes, which gives +us much more flexibility and power in customizing our plot. + +.. note:: + + In general, use the explicit interface over the implicit pyplot interface + for plotting. + +Our data +======== + +We'll use the data from the post from which this tutorial was derived. +It contains sales information for a number of companies. + +""" + +# sphinx_gallery_thumbnail_number = 10 +import numpy as np +import matplotlib.pyplot as plt + + +data = {'Barton LLC': 109438.50, + 'Frami, Hills and Schmidt': 103569.59, + 'Fritsch, Russel and Anderson': 112214.71, + 'Jerde-Hilpert': 112591.43, + 'Keeling LLC': 100934.30, + 'Koepp Ltd': 103660.54, + 'Kulas Inc': 137351.96, + 'Trantow-Barrows': 123381.38, + 'White-Trantow': 135841.99, + 'Will LLC': 104437.60} +group_data = list(data.values()) +group_names = list(data.keys()) +group_mean = np.mean(group_data) + +############################################################################### +# Getting started +# =============== +# +# This data is naturally visualized as a barplot, with one bar per +# group. To do this with the object-oriented approach, we first generate +# an instance of :class:`figure.Figure` and +# :class:`axes.Axes`. The Figure is like a canvas, and the Axes +# is a part of that canvas on which we will make a particular visualization. +# +# .. note:: +# +# Figures can have multiple axes on them. For information on how to do this, +# see the :doc:`Tight Layout tutorial +# `. + +fig, ax = plt.subplots() + +############################################################################### +# Now that we have an Axes instance, we can plot on top of it. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# Controlling the style +# ===================== +# +# There are many styles available in Matplotlib in order to let you tailor +# your visualization to your needs. To see a list of styles, we can use +# :mod:`.style`. + +print(plt.style.available) + +############################################################################### +# You can activate a style with the following: + +plt.style.use('fivethirtyeight') + +############################################################################### +# Now let's remake the above plot to see how it looks: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# The style controls many things, such as color, linewidths, backgrounds, +# etc. +# +# Customizing the plot +# ==================== +# +# Now we've got a plot with the general look that we want, so let's fine-tune +# it so that it's ready for print. First let's rotate the labels on the x-axis +# so that they show up more clearly. We can gain access to these labels +# with the :meth:`axes.Axes.get_xticklabels` method: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() + +############################################################################### +# If we'd like to set the property of many items at once, it's useful to use +# the :func:`pyplot.setp` function. This will take a list (or many lists) of +# Matplotlib objects, and attempt to set some style element of each one. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# It looks like this cut off some of the labels on the bottom. We can +# tell Matplotlib to automatically make room for elements in the figures +# that we create. To do this we set the ``autolayout`` value of our +# rcParams. For more information on controlling the style, layout, and +# other features of plots with rcParams, see +# :doc:`/tutorials/introductory/customizing`. + +plt.rcParams.update({'figure.autolayout': True}) + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# Next, we add labels to the plot. To do this with the OO interface, +# we can use the :meth:`.Artist.set` method to set properties of this +# Axes object. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10000, 140000], xlabel='Total Revenue', ylabel='Company', + title='Company Revenue') + +############################################################################### +# We can also adjust the size of this plot using the :func:`pyplot.subplots` +# function. We can do this with the *figsize* keyword argument. +# +# .. note:: +# +# While indexing in NumPy follows the form (row, column), the *figsize* +# keyword argument follows the form (width, height). This follows +# conventions in visualization, which unfortunately are different from those +# of linear algebra. + +fig, ax = plt.subplots(figsize=(8, 4)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10000, 140000], xlabel='Total Revenue', ylabel='Company', + title='Company Revenue') + +############################################################################### +# For labels, we can specify custom formatting guidelines in the form of +# functions. Below we define a function that takes an integer as input, and +# returns a string as an output. When used with `.Axis.set_major_formatter` or +# `.Axis.set_minor_formatter`, they will automatically create and use a +# :class:`ticker.FuncFormatter` class. +# +# For this function, the ``x`` argument is the original tick label and ``pos`` +# is the tick position. We will only use ``x`` here but both arguments are +# needed. + + +def currency(x, pos): + """The two arguments are the value and tick position""" + if x >= 1e6: + s = '${:1.1f}M'.format(x*1e-6) + else: + s = '${:1.0f}K'.format(x*1e-3) + return s + +############################################################################### +# We can then apply this function to the labels on our plot. To do this, +# we use the ``xaxis`` attribute of our axes. This lets you perform +# actions on a specific axis on our plot. + +fig, ax = plt.subplots(figsize=(6, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +ax.set(xlim=[-10000, 140000], xlabel='Total Revenue', ylabel='Company', + title='Company Revenue') +ax.xaxis.set_major_formatter(currency) + +############################################################################### +# Combining multiple visualizations +# ================================= +# +# It is possible to draw multiple plot elements on the same instance of +# :class:`axes.Axes`. To do this we simply need to call another one of +# the plot methods on that axes object. + +# fig, ax = plt.subplots(figsize=(8, 8)) +# ax.barh(group_names, group_data) +# labels = ax.get_xticklabels() +# plt.setp(labels, rotation=45, horizontalalignment='right') + +# Add a vertical line, here we set the style in the function call +# ax.axvline(group_mean, ls='--', color='r') + +# Annotate new companies +# for group in [3, 5, 8]: +# ax.text(145000, group, "New Company", fontsize=10, +# verticalalignment="center") + +# Now we move our title up since it's getting a little cramped +# ax.title.set(y=1.05) + +# ax.set(xlim=[-10000, 140000], xlabel='Total Revenue', ylabel='Company', title='Company Revenue') +# ax.xaxis.set_major_formatter(currency) +# ax.set_xticks([0, 25e3, 50e3, 75e3, 100e3, 125e3]) +# fig.subplots_adjust(right=.1) + +plt.show() + +############################################################################### +# Saving our plot +# =============== +# +# Now that we're happy with the outcome of our plot, we want to save it to +# disk. There are many file formats we can save to in Matplotlib. To see +# a list of available options, use: + +print(fig.canvas.get_supported_filetypes()) + +############################################################################### +# We can then use the :meth:`figure.Figure.savefig` in order to save the figure +# to disk. Note that there are several useful flags we show below: +# +# * ``transparent=True`` makes the background of the saved figure transparent +# if the format supports it. +# * ``dpi=80`` controls the resolution (dots per square inch) of the output. +# * ``bbox_inches="tight"`` fits the bounds of the figure to our plot. + +# Uncomment this line to save the figure. +# fig.savefig('sales.png', transparent=False, dpi=80, bbox_inches="tight") diff --git a/The attainments and realizations of my dreams/Average life expectancy/lifecycle.py b/The attainments and realizations of my dreams/Average life expectancy/lifecycle.py new file mode 100644 index 00000000..3d3a1036 --- /dev/null +++ b/The attainments and realizations of my dreams/Average life expectancy/lifecycle.py @@ -0,0 +1,278 @@ +""" +======================= +The Lifecycle of a Plot +======================= + +This tutorial aims to show the beginning, middle, and end of a single +visualization using Matplotlib. We'll begin with some raw data and +end by saving a figure of a customized visualization. Along the way we try +to highlight some neat features and best-practices using Matplotlib. + +.. currentmodule:: matplotlib + +.. note:: + + This tutorial is based on + `this excellent blog post + `_ + by Chris Moffitt. It was transformed into this tutorial by Chris Holdgraf. + +A note on the explicit vs. implicit interfaces +============================================== + +Matplotlib has two interfaces. For an explanation of the trade-offs between the +explicit and implicit interfaces see :ref:`api_interfaces`. + +In the explicit object-oriented (OO) interface we directly utilize instances of +:class:`axes.Axes` to build up the visualization in an instance of +:class:`figure.Figure`. In the implicit interface, inspired by and modeled on +MATLAB, we use a global state-based interface which is encapsulated in the +:mod:`.pyplot` module to plot to the "current Axes". See the :doc:`pyplot +tutorials ` for a more in-depth look at the +pyplot interface. + +Most of the terms are straightforward but the main thing to remember +is that: + +* The `.Figure` is the final image, and may contain one or more `~.axes.Axes`. +* The `~.axes.Axes` represents an individual plot (not to be confused with + `~.axis.Axis`, which refers to the x-, y-, or z-axis of a plot). + +We call methods that do the plotting directly from the Axes, which gives +us much more flexibility and power in customizing our plot. + +.. note:: + + In general, use the explicit interface over the implicit pyplot interface + for plotting. + +Our data +======== + +We'll use the data from the post from which this tutorial was derived. +It contains sales information for a number of companies. + +""" + +# sphinx_gallery_thumbnail_number = 10 +import numpy as np +import matplotlib.pyplot as plt + + +data = {'Barton LLC': 109438.50, + 'Frami, Hills and Schmidt': 103569.59, + 'Fritsch, Russel and Anderson': 112214.71, + 'Jerde-Hilpert': 112591.43, + 'Keeling LLC': 100934.30, + 'Koepp Ltd': 103660.54, + 'Kulas Inc': 137351.96, + 'Trantow-Barrows': 123381.38, + 'White-Trantow': 135841.99, + 'Will LLC': 104437.60} +group_data = list(data.values()) +group_names = list(data.keys()) +group_mean = np.mean(group_data) + +############################################################################### +# Getting started +# =============== +# +# This data is naturally visualized as a barplot, with one bar per +# group. To do this with the object-oriented approach, we first generate +# an instance of :class:`figure.Figure` and +# :class:`axes.Axes`. The Figure is like a canvas, and the Axes +# is a part of that canvas on which we will make a particular visualization. +# +# .. note:: +# +# Figures can have multiple axes on them. For information on how to do this, +# see the :doc:`Tight Layout tutorial +# `. + +fig, ax = plt.subplots() + +############################################################################### +# Now that we have an Axes instance, we can plot on top of it. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# Controlling the style +# ===================== +# +# There are many styles available in Matplotlib in order to let you tailor +# your visualization to your needs. To see a list of styles, we can use +# :mod:`.style`. + +print(plt.style.available) + +############################################################################### +# You can activate a style with the following: + +plt.style.use('fivethirtyeight') + +############################################################################### +# Now let's remake the above plot to see how it looks: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# The style controls many things, such as color, linewidths, backgrounds, +# etc. +# +# Customizing the plot +# ==================== +# +# Now we've got a plot with the general look that we want, so let's fine-tune +# it so that it's ready for print. First let's rotate the labels on the x-axis +# so that they show up more clearly. We can gain access to these labels +# with the :meth:`axes.Axes.get_xticklabels` method: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() + +############################################################################### +# If we'd like to set the property of many items at once, it's useful to use +# the :func:`pyplot.setp` function. This will take a list (or many lists) of +# Matplotlib objects, and attempt to set some style element of each one. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# It looks like this cut off some of the labels on the bottom. We can +# tell Matplotlib to automatically make room for elements in the figures +# that we create. To do this we set the ``autolayout`` value of our +# rcParams. For more information on controlling the style, layout, and +# other features of plots with rcParams, see +# :doc:`/tutorials/introductory/customizing`. + +plt.rcParams.update({'figure.autolayout': True}) + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# Next, we add labels to the plot. To do this with the OO interface, +# we can use the :meth:`.Artist.set` method to set properties of this +# Axes object. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10000, 140000], xlabel='Total Revenue', ylabel='Company', + title='Company Revenue') + +############################################################################### +# We can also adjust the size of this plot using the :func:`pyplot.subplots` +# function. We can do this with the *figsize* keyword argument. +# +# .. note:: +# +# While indexing in NumPy follows the form (row, column), the *figsize* +# keyword argument follows the form (width, height). This follows +# conventions in visualization, which unfortunately are different from those +# of linear algebra. + +fig, ax = plt.subplots(figsize=(8, 4)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10000, 140000], xlabel='Total Revenue', ylabel='Company', + title='Company Revenue') + +############################################################################### +# For labels, we can specify custom formatting guidelines in the form of +# functions. Below we define a function that takes an integer as input, and +# returns a string as an output. When used with `.Axis.set_major_formatter` or +# `.Axis.set_minor_formatter`, they will automatically create and use a +# :class:`ticker.FuncFormatter` class. +# +# For this function, the ``x`` argument is the original tick label and ``pos`` +# is the tick position. We will only use ``x`` here but both arguments are +# needed. + + +def currency(x, pos): + """The two arguments are the value and tick position""" + if x >= 1e6: + s = '${:1.1f}M'.format(x*1e-6) + else: + s = '${:1.0f}K'.format(x*1e-3) + return s + +############################################################################### +# We can then apply this function to the labels on our plot. To do this, +# we use the ``xaxis`` attribute of our axes. This lets you perform +# actions on a specific axis on our plot. + +fig, ax = plt.subplots(figsize=(6, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +ax.set(xlim=[-10000, 140000], xlabel='Total Revenue', ylabel='Company', + title='Company Revenue') +ax.xaxis.set_major_formatter(currency) + +############################################################################### +# Combining multiple visualizations +# ================================= +# +# It is possible to draw multiple plot elements on the same instance of +# :class:`axes.Axes`. To do this we simply need to call another one of +# the plot methods on that axes object. + +fig, ax = plt.subplots(figsize=(8, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +# Add a vertical line, here we set the style in the function call +ax.axvline(group_mean, ls='--', color='r') + +# Annotate new companies +for group in [3, 5, 8]: + ax.text(145000, group, "New Company", fontsize=10, + verticalalignment="center") + +# Now we move our title up since it's getting a little cramped +ax.title.set(y=1.05) + +ax.set(xlim=[-10000, 140000], xlabel='Total Revenue', ylabel='Company', + title='Company Revenue') +ax.xaxis.set_major_formatter(currency) +ax.set_xticks([0, 25e3, 50e3, 75e3, 100e3, 125e3]) +fig.subplots_adjust(right=.1) + +plt.show() + +############################################################################### +# Saving our plot +# =============== +# +# Now that we're happy with the outcome of our plot, we want to save it to +# disk. There are many file formats we can save to in Matplotlib. To see +# a list of available options, use: + +print(fig.canvas.get_supported_filetypes()) + +############################################################################### +# We can then use the :meth:`figure.Figure.savefig` in order to save the figure +# to disk. Note that there are several useful flags we show below: +# +# * ``transparent=True`` makes the background of the saved figure transparent +# if the format supports it. +# * ``dpi=80`` controls the resolution (dots per square inch) of the output. +# * ``bbox_inches="tight"`` fits the bounds of the figure to our plot. + +# Uncomment this line to save the figure. +# fig.savefig('sales.png', transparent=False, dpi=80, bbox_inches="tight") diff --git a/The attainments and realizations of my dreams/Birth rate by region/2024_monthly.py b/The attainments and realizations of my dreams/Birth rate by region/2024_monthly.py new file mode 100644 index 00000000..81ba2931 --- /dev/null +++ b/The attainments and realizations of my dreams/Birth rate by region/2024_monthly.py @@ -0,0 +1,279 @@ +""" +======================= +The Lifecycle of a Plot +======================= + +This tutorial aims to show the beginning, middle, and end of a single +visualization using Matplotlib. We'll begin with some raw data and +end by saving a figure of a customized visualization. Along the way we try +to highlight some neat features and best-practices using Matplotlib. + +.. currentmodule:: matplotlib + +.. note:: + + This tutorial is based on + `this excellent blog post + `_ + by Chris Moffitt. It was transformed into this tutorial by Chris Holdgraf. + +A note on the explicit vs. implicit interfaces +============================================== + +Matplotlib has two interfaces. For an explanation of the trade-offs between the +explicit and implicit interfaces see :ref:`api_interfaces`. + +In the explicit object-oriented (OO) interface we directly utilize instances of +:class:`axes.Axes` to build up the visualization in an instance of +:class:`figure.Figure`. In the implicit interface, inspired by and modeled on +MATLAB, we use a global state-based interface which is encapsulated in the +:mod:`.pyplot` module to plot to the "current Axes". See the :doc:`pyplot +tutorials ` for a more in-depth look at the +pyplot interface. + +Most of the terms are straightforward but the main thing to remember +is that: + +* The `.Figure` is the final image, and may contain one or more `~.axes.Axes`. +* The `~.axes.Axes` represents an individual plot (not to be confused with + `~.axis.Axis`, which refers to the x-, y-, or z-axis of a plot). + +We call methods that do the plotting directly from the Axes, which gives +us much more flexibility and power in customizing our plot. + +.. note:: + + In general, use the explicit interface over the implicit pyplot interface + for plotting. + +Our data +======== + +We'll use the data from the post from which this tutorial was derived. +It contains sales information for a number of companies. + +""" + +# sphinx_gallery_thumbnail_number = 10 +import numpy as np +import matplotlib.pyplot as plt + + +data = {'Taipei City': 109438.50, + 'New Taipei City': 103569.59, + 'Fritsch, Russel and Anderson': 112214.71, + 'Jerde-Hilpert': 112591.43, + 'Keeling LLC': 100934.30, + 'Koepp Ltd': 103660.54, + 'Kulas Inc': 137351.96, + 'Trantow-Barrows': 123381.38, + 'White-Trantow': 135841.99, + 'Will LLC': 104437.60} + +group_data = list(data.values()) +group_names = list(data.keys()) +group_mean = np.mean(group_data) + +############################################################################### +# Getting started +# =============== +# +# This data is naturally visualized as a barplot, with one bar per +# group. To do this with the object-oriented approach, we first generate +# an instance of :class:`figure.Figure` and +# :class:`axes.Axes`. The Figure is like a canvas, and the Axes +# is a part of that canvas on which we will make a particular visualization. +# +# .. note:: +# +# Figures can have multiple axes on them. For information on how to do this, +# see the :doc:`Tight Layout tutorial +# `. + +fig, ax = plt.subplots() + +############################################################################### +# Now that we have an Axes instance, we can plot on top of it. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# Controlling the style +# ===================== +# +# There are many styles available in Matplotlib in order to let you tailor +# your visualization to your needs. To see a list of styles, we can use +# :mod:`.style`. + +print(plt.style.available) + +############################################################################### +# You can activate a style with the following: + +plt.style.use('fivethirtyeight') + +############################################################################### +# Now let's remake the above plot to see how it looks: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) + +############################################################################### +# The style controls many things, such as color, linewidths, backgrounds, +# etc. +# +# Customizing the plot +# ==================== +# +# Now we've got a plot with the general look that we want, so let's fine-tune +# it so that it's ready for print. First let's rotate the labels on the x-axis +# so that they show up more clearly. We can gain access to these labels +# with the :meth:`axes.Axes.get_xticklabels` method: + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() + +############################################################################### +# If we'd like to set the property of many items at once, it's useful to use +# the :func:`pyplot.setp` function. This will take a list (or many lists) of +# Matplotlib objects, and attempt to set some style element of each one. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# It looks like this cut off some of the labels on the bottom. We can +# tell Matplotlib to automatically make room for elements in the figures +# that we create. To do this we set the ``autolayout`` value of our +# rcParams. For more information on controlling the style, layout, and +# other features of plots with rcParams, see +# :doc:`/tutorials/introductory/customizing`. + +plt.rcParams.update({'figure.autolayout': True}) + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +############################################################################### +# Next, we add labels to the plot. To do this with the OO interface, +# we can use the :meth:`.Artist.set` method to set properties of this +# Axes object. + +fig, ax = plt.subplots() +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10000, 140000], xlabel='Total Revenue', ylabel='Company', + title='Company Revenue') + +############################################################################### +# We can also adjust the size of this plot using the :func:`pyplot.subplots` +# function. We can do this with the *figsize* keyword argument. +# +# .. note:: +# +# While indexing in NumPy follows the form (row, column), the *figsize* +# keyword argument follows the form (width, height). This follows +# conventions in visualization, which unfortunately are different from those +# of linear algebra. + +fig, ax = plt.subplots(figsize=(8, 4)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') +ax.set(xlim=[-10000, 140000], xlabel='Total Revenue', ylabel='Company', + title='Company Revenue') + +############################################################################### +# For labels, we can specify custom formatting guidelines in the form of +# functions. Below we define a function that takes an integer as input, and +# returns a string as an output. When used with `.Axis.set_major_formatter` or +# `.Axis.set_minor_formatter`, they will automatically create and use a +# :class:`ticker.FuncFormatter` class. +# +# For this function, the ``x`` argument is the original tick label and ``pos`` +# is the tick position. We will only use ``x`` here but both arguments are +# needed. + + +def currency(x, pos): + """The two arguments are the value and tick position""" + if x >= 1e6: + s = '${:1.1f}M'.format(x*1e-6) + else: + s = '${:1.0f}K'.format(x*1e-3) + return s + +############################################################################### +# We can then apply this function to the labels on our plot. To do this, +# we use the ``xaxis`` attribute of our axes. This lets you perform +# actions on a specific axis on our plot. + +fig, ax = plt.subplots(figsize=(6, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +ax.set(xlim=[-10000, 140000], xlabel='Total Revenue', ylabel='Company', + title='Company Revenue') +ax.xaxis.set_major_formatter(currency) + +############################################################################### +# Combining multiple visualizations +# ================================= +# +# It is possible to draw multiple plot elements on the same instance of +# :class:`axes.Axes`. To do this we simply need to call another one of +# the plot methods on that axes object. + +fig, ax = plt.subplots(figsize=(8, 8)) +ax.barh(group_names, group_data) +labels = ax.get_xticklabels() +plt.setp(labels, rotation=45, horizontalalignment='right') + +# Add a vertical line, here we set the style in the function call +ax.axvline(group_mean, ls='--', color='r') + +# Annotate new companies +for group in [3, 5, 8]: + ax.text(145000, group, "New Company", fontsize=10, + verticalalignment="center") + +# Now we move our title up since it's getting a little cramped +ax.title.set(y=1.05) + +ax.set(xlim=[-10000, 140000], xlabel='Total Revenue', ylabel='Company', + title='Company Revenue') +ax.xaxis.set_major_formatter(currency) +ax.set_xticks([0, 25e3, 50e3, 75e3, 100e3, 125e3]) +fig.subplots_adjust(right=.1) + +plt.show() + +############################################################################### +# Saving our plot +# =============== +# +# Now that we're happy with the outcome of our plot, we want to save it to +# disk. There are many file formats we can save to in Matplotlib. To see +# a list of available options, use: + +print(fig.canvas.get_supported_filetypes()) + +############################################################################### +# We can then use the :meth:`figure.Figure.savefig` in order to save the figure +# to disk. Note that there are several useful flags we show below: +# +# * ``transparent=True`` makes the background of the saved figure transparent +# if the format supports it. +# * ``dpi=80`` controls the resolution (dots per square inch) of the output. +# * ``bbox_inches="tight"`` fits the bounds of the figure to our plot. + +# Uncomment this line to save the figure. +# fig.savefig('sales.png', transparent=False, dpi=80, bbox_inches="tight") diff --git a/The attainments and realizations of my dreams/Birth rate by region/__init__.py b/The attainments and realizations of my dreams/Birth rate by region/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Climate change/Average temperatures of Kaohsiung in June as of 2022.py b/The attainments and realizations of my dreams/Climate change/Average temperatures of Kaohsiung in June as of 2022.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Climate change/How warm is Kaohsiung in July.py b/The attainments and realizations of my dreams/Climate change/How warm is Kaohsiung in July.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Climate change/Is December a good time to visit Kaohsiung.py b/The attainments and realizations of my dreams/Climate change/Is December a good time to visit Kaohsiung.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Climate change/What is the average temperature of Kaohsiung in August.py b/The attainments and realizations of my dreams/Climate change/What is the average temperature of Kaohsiung in August.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Climate change/What is the average temperature of Kaohsiung in the summer.py b/The attainments and realizations of my dreams/Climate change/What is the average temperature of Kaohsiung in the summer.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Climate change/Y-O-Y comparison of average temperatures of Kaohsiung in Q1.py b/The attainments and realizations of my dreams/Climate change/Y-O-Y comparison of average temperatures of Kaohsiung in Q1.py new file mode 100644 index 00000000..bdb78abf --- /dev/null +++ b/The attainments and realizations of my dreams/Climate change/Y-O-Y comparison of average temperatures of Kaohsiung in Q1.py @@ -0,0 +1,11 @@ +# Year-over-year comparison of average temperature of Kaohsiung from January to March + +# In comparison with comparing average temperature on month-over-month basis, +# lengthen the counting period has the benefit of attenuating the impact of short-lived noise. + +# For example, although the average number of typhoons that intruded Taiwan in summer over past few +# years is not volatile, + + +# In other words, there might be a heavy concentration of typhoon moving in August than +# July in this year, compared to last year, making this year's August cooler than that of last year. diff --git a/The attainments and realizations of my dreams/Climate change/__init__.py b/The attainments and realizations of my dreams/Climate change/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Days under air pollution/2021 in sum.py b/The attainments and realizations of my dreams/Days under air pollution/2021 in sum.py new file mode 100644 index 00000000..59d9624c --- /dev/null +++ b/The attainments and realizations of my dreams/Days under air pollution/2021 in sum.py @@ -0,0 +1 @@ +# Reference: https://airtw.epa.gov.tw/CHT/Query/Bad_Day.aspx diff --git a/The attainments and realizations of my dreams/Days under air pollution/December (year-over-year comparisons).py b/The attainments and realizations of my dreams/Days under air pollution/December (year-over-year comparisons).py new file mode 100644 index 00000000..f45f3034 --- /dev/null +++ b/The attainments and realizations of my dreams/Days under air pollution/December (year-over-year comparisons).py @@ -0,0 +1,64 @@ +# Reference: https://airtw.epa.gov.tw/CHT/Query/Bad_Day.aspx +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/hat_graph.html#sphx-glr-gallery-lines-bars-and-markers-hat-graph-py +import numpy as np +import matplotlib.pyplot as plt + + +def hat_graph(ax, xlabels, values, group_labels): + """ + Create a hat graph. + + Parameters + ---------- + ax : matplotlib.axes.Axes + The Axes to plot into. + xlabels : list of str + The category names to be displayed on the x-axis. + values : (M, N) array-like + The data values. + Rows are the groups (len(group_labels) == M). + Columns are the categories (len(xlabels) == N). + group_labels : list of str + The group labels displayed in the legend. + """ + + def label_bars(heights, rects): + """Attach a text label on top of each bar.""" + for height, rect in zip(heights, rects): + ax.annotate(f'{height}', + xy=(rect.get_x() + rect.get_width() / 2, height), + xytext=(0, 4), # 4 points vertical offset. + textcoords='offset points', + ha='center', va='bottom') + + values = np.asarray(values) + x = np.arange(values.shape[1]) + ax.set_xticks(x, labels=xlabels) + spacing = 0.3 # spacing between hat groups + width = (1 - spacing) / values.shape[0] + heights0 = values[0] + for i, (heights, group_label) in enumerate(zip(values, group_labels)): + style = {'fill': False} if i == 0 else {'edgecolor': 'black'} + rects = ax.bar(x - spacing/2 + i * width, heights - heights0, + width, bottom=heights0, label=group_label, **style) + label_bars(heights, rects) + + +# initialise labels and a numpy array make sure you have +# N labels of N number of values in the array +xlabels = ['2017', '\'18', '\'19', '\'20', '\'21'] +Taipei = np.array([5, 15, 22, 20, 25]) +Kaohsiung = np.array([25, 32, 34, 30, 27]) + +fig, ax = plt.subplots() +hat_graph(ax, xlabels, [Taipei, Kaohsiung], ['Taipei', 'Kaohsiung']) + +# Add some text for labels, title and custom x-axis tick labels, etc. +ax.set_xlabel('Year\nReference: https://airtw.epa.gov.tw/CHT/Query/Bad_Day.aspx') +ax.set_ylabel('Days polluted by the perilous levels of PM 2.5') +ax.set_ylim(0, 60) +ax.set_title('The number of Days under Hazardous (carcinogenic) PM2.5 Level') +ax.legend() + +fig.tight_layout() +plt.show() \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Days under air pollution/December2021 (year-over-year comparison).py b/The attainments and realizations of my dreams/Days under air pollution/December2021 (year-over-year comparison).py new file mode 100644 index 00000000..e904ee81 --- /dev/null +++ b/The attainments and realizations of my dreams/Days under air pollution/December2021 (year-over-year comparison).py @@ -0,0 +1,64 @@ +# Reference: https://airtw.epa.gov.tw/CHT/Query/Bad_Day.aspx +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/hat_graph.html#sphx-glr-gallery-lines-bars-and-markers-hat-graph-py +import numpy as np +import matplotlib.pyplot as plt + + +def hat_graph(ax, xlabels, values, group_labels): + """ + Create a hat graph. + + Parameters + ---------- + ax : matplotlib.axes.Axes + The Axes to plot into. + xlabels : list of str + The category names to be displayed on the x-axis. + values : (M, N) array-like + The data values. + Rows are the groups (len(group_labels) == M). + Columns are the categories (len(xlabels) == N). + group_labels : list of str + The group labels displayed in the legend. + """ + + def label_bars(heights, rects): + """Attach a text label on top of each bar.""" + for height, rect in zip(heights, rects): + ax.annotate(f'{height}', + xy=(rect.get_x() + rect.get_width() / 2, height), + xytext=(0, 4), # 4 points vertical offset. + textcoords='offset points', + ha='center', va='bottom') + + values = np.asarray(values) + x = np.arange(values.shape[1]) + ax.set_xticks(x, labels=xlabels) + spacing = 0.3 # spacing between hat groups + width = (1 - spacing) / values.shape[0] + heights0 = values[0] + for i, (heights, group_label) in enumerate(zip(values, group_labels)): + style = {'fill': False} if i == 0 else {'edgecolor': 'black'} + rects = ax.bar(x - spacing/2 + i * width, heights - heights0, + width, bottom=heights0, label=group_label, **style) + label_bars(heights, rects) + + +# initialise labels and a numpy array make sure you have +# N labels of N number of values in the array +xlabels = ['2018', '\'19', '\'20', '\'21', '\'22'] +Taipei = np.array([3, 0, 1, 0, 0]) # Taipei + New Taipei +Kaohsiung = np.array([22, 8, 9, 15, 0]) # Kaohsiung + +fig, ax = plt.subplots() +hat_graph(ax, xlabels, [Taipei, Kaohsiung], ['Taipei', 'Kaohsiung']) + +# Add some text for labels, title and custom x-axis tick labels, etc. +ax.set_xlabel('Year\nReference: https://airtw.epa.gov.tw/CHT/Query/Bad_Day.aspx') +ax.set_ylabel('Days polluted by the unsafe levels of AQI') +ax.set_ylim(0, 31) +ax.set_title('The number of Days of December with Air Quality Index > 100') +ax.legend() + +fig.tight_layout() +plt.show() \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Days under air pollution/__init__.py b/The attainments and realizations of my dreams/Days under air pollution/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/FDI/2023 Q4.py b/The attainments and realizations of my dreams/FDI/2023 Q4.py new file mode 100644 index 00000000..32f4a738 --- /dev/null +++ b/The attainments and realizations of my dreams/FDI/2023 Q4.py @@ -0,0 +1,38 @@ +import matplotlib.pyplot as plt +import numpy as np + +fig, ax = plt.subplots(figsize=(7, 3), subplot_kw=dict(aspect="equal")) + +# recipe = ["7.98 USD flour", +# "75 g sugar", +# "250 g butter", +# "300 g berries"] + +# data = [float(x.split()[0]) for x in recipe] +# ingredients = [x.split()[-1] for x in recipe] + +data = [30.25, 2.55] + +ingredients = ["Taipei", "Rest of Taiwan"] + + +def func(pct, allvals): + absolute = int(np.round(pct/100.*np.sum(allvals))) + return f"{pct:.1f}%\n({absolute:d} Million\n of USD)" + + +wedges, texts, autotexts = ax.pie(data, autopct=lambda pct: func(pct, data), + textprops=dict(color="w")) + +ax.legend(wedges, ingredients, + title="City", + loc="center left", + bbox_to_anchor=(1, 0, 0.5, 1)) + +plt.setp(autotexts, size=8, weight="bold") + +ax.set_title("2023 Q4 The distribution of Taiwan's Foreign Direct Investment by Region") + +plt.xlabel("Reference: https://taipeiecon.taipei/Econ/econ_obs?id=5") + +plt.show() diff --git a/The attainments and realizations of my dreams/FDI/2024 Q1 - Q2.py b/The attainments and realizations of my dreams/FDI/2024 Q1 - Q2.py new file mode 100644 index 00000000..432add22 --- /dev/null +++ b/The attainments and realizations of my dreams/FDI/2024 Q1 - Q2.py @@ -0,0 +1,38 @@ +import matplotlib.pyplot as plt +import numpy as np + +fig, ax = plt.subplots(figsize=(7, 3), subplot_kw=dict(aspect="equal")) + +# recipe = ["7.98 USD flour", +# "75 g sugar", +# "250 g butter", +# "300 g berries"] + +# data = [float(x.split()[0]) for x in recipe] +# ingredients = [x.split()[-1] for x in recipe] + +data = [7.98, 15.39, 4.25, 5.87] + +ingredients = ["Taipei Q1", "Taipei Q2", "Rest of TW Q1", "Rest of TW Q2"] + + +def func(pct, allvals): + absolute = int(np.round(pct/100.*np.sum(allvals))) + return f"{pct:.1f}%\n({absolute:d} g)" + + +wedges, texts, autotexts = ax.pie(data, autopct=lambda pct: func(pct, data), + textprops=dict(color="w")) + +ax.legend(wedges, ingredients, + title="Ingredients", + loc="center left", + bbox_to_anchor=(1, 0, 0.5, 1)) + +plt.setp(autotexts, size=8, weight="bold") + +ax.set_title("2024 The distribution of Taiwan's Foreign Direct Investment by Region") + +plt.xlabel("Reference: https://taipeiecon.taipei/Econ/econ_obs?id=5") + +plt.show() diff --git a/The attainments and realizations of my dreams/FDI/2024 Q2.py b/The attainments and realizations of my dreams/FDI/2024 Q2.py new file mode 100644 index 00000000..a9af2c5d --- /dev/null +++ b/The attainments and realizations of my dreams/FDI/2024 Q2.py @@ -0,0 +1,38 @@ +import matplotlib.pyplot as plt +import numpy as np + +fig, ax = plt.subplots(figsize=(7, 3), subplot_kw=dict(aspect="equal")) + +# recipe = ["7.98 USD flour", +# "75 g sugar", +# "250 g butter", +# "300 g berries"] + +# data = [float(x.split()[0]) for x in recipe] +# ingredients = [x.split()[-1] for x in recipe] + +data = [15.39, 5.87] + +ingredients = ["Taipei", "Rest of Taiwan"] + + +def func(pct, allvals): + absolute = int(np.round(pct/100.*np.sum(allvals))) + return f"{pct:.1f}%\n({absolute:d} Million\n of USD)" + + +wedges, texts, autotexts = ax.pie(data, autopct=lambda pct: func(pct, data), + textprops=dict(color="w")) + +ax.legend(wedges, ingredients, + title="City", + loc="center left", + bbox_to_anchor=(1, 0, 0.5, 1)) + +plt.setp(autotexts, size=8, weight="bold") + +ax.set_title("2024 Q2 The distribution of Taiwan's Foreign Direct Investment by Region") + +plt.xlabel("Reference: https://taipeiecon.taipei/Econ/econ_obs?id=5") + +plt.show() diff --git a/The attainments and realizations of my dreams/FDI/__init__.py b/The attainments and realizations of my dreams/FDI/__init__.py new file mode 100644 index 00000000..e69de29b diff --git "a/The attainments and realizations of my dreams/FDI/\345\216\237\345\247\213\350\263\207\346\226\231_\345\203\221\345\244\226\346\212\225\350\263\207\351\207\221\351\241\215(xlsx).xlsx" "b/The attainments and realizations of my dreams/FDI/\345\216\237\345\247\213\350\263\207\346\226\231_\345\203\221\345\244\226\346\212\225\350\263\207\351\207\221\351\241\215(xlsx).xlsx" new file mode 100644 index 00000000..9c45afec Binary files /dev/null and "b/The attainments and realizations of my dreams/FDI/\345\216\237\345\247\213\350\263\207\346\226\231_\345\203\221\345\244\226\346\212\225\350\263\207\351\207\221\351\241\215(xlsx).xlsx" differ diff --git "a/The attainments and realizations of my dreams/FDI/\345\216\237\345\247\213\350\263\207\346\226\231_\345\203\221\345\244\226\346\212\225\350\263\207\351\207\221\351\241\215_2025_02.xlsx" "b/The attainments and realizations of my dreams/FDI/\345\216\237\345\247\213\350\263\207\346\226\231_\345\203\221\345\244\226\346\212\225\350\263\207\351\207\221\351\241\215_2025_02.xlsx" new file mode 100644 index 00000000..7940c2cd Binary files /dev/null and "b/The attainments and realizations of my dreams/FDI/\345\216\237\345\247\213\350\263\207\346\226\231_\345\203\221\345\244\226\346\212\225\350\263\207\351\207\221\351\241\215_2025_02.xlsx" differ diff --git a/The attainments and realizations of my dreams/Heading_to_the_top_universities_in_the_world_2010.xlsx b/The attainments and realizations of my dreams/Heading_to_the_top_universities_in_the_world_2010.xlsx index e9154901..e9801682 100644 Binary files a/The attainments and realizations of my dreams/Heading_to_the_top_universities_in_the_world_2010.xlsx and b/The attainments and realizations of my dreams/Heading_to_the_top_universities_in_the_world_2010.xlsx differ diff --git a/The attainments and realizations of my dreams/Heading_to_the_top_universities_in_the_world_2013.xlsx b/The attainments and realizations of my dreams/Heading_to_the_top_universities_in_the_world_2013.xlsx index 0c215d35..83e80c42 100644 Binary files a/The attainments and realizations of my dreams/Heading_to_the_top_universities_in_the_world_2013.xlsx and b/The attainments and realizations of my dreams/Heading_to_the_top_universities_in_the_world_2013.xlsx differ diff --git a/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 10.py b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 10.py new file mode 100644 index 00000000..0937856c --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 10.py @@ -0,0 +1,151 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np +import pandas as pd + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +totality = [] + +for i in range(0, 19, 1): + totality.append(northTW[i] + centralTW[i] + southTW[i] + eastTW[i] + outlyingTW[i]) + + +print(totality) + +df2 = pd.DataFrame(data=totality, index=year, columns=["Total"]) + +print(df2) + +df3 = df.append(df2.transpose()) + +print(df3) + +transposed_df = df.transpose() + +ax = transposed_df.plot(kind='barh', stacked=True, figsize=(8, 6)) + +for c in ax.containers: + print(type(c)) + c = int(c) + totality = northTW + centralTW + southTW + eastTW + outlyingTW + percent = (c / totality) * 100 + ax.bar_label(percent, fmt='%.2f%%', label_type='center') + + +plt.show() \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 2.py b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 2.py new file mode 100644 index 00000000..1e9a4c1a --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 2.py @@ -0,0 +1,132 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np +import pandas as pd + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +transposed_df = df.transpose() + +ax = transposed_df.plot(kind='barh', stacked=True, figsize=(8, 6)) + +for c in ax.containers: + ax.bar_label(c, fmt='%.2f%%', label_type='center') + + +plt.show() + diff --git a/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 3.py b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 3.py new file mode 100644 index 00000000..d761ab84 --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 3.py @@ -0,0 +1,130 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np +import pandas as pd + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +ax = df.plot(kind='bar', stacked=True, figsize=(8, 6)) + +for c in ax.containers: + ax.bar_label(c, fmt='%.2f%%', label_type='center') + + +plt.show() + diff --git a/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 4.py b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 4.py new file mode 100644 index 00000000..78131d81 --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 4.py @@ -0,0 +1,131 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np +import pandas as pd + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +transposed_df = df.transpose() + +ax = df.plot(kind='bar', stacked=True, figsize=(8, 6)) + +for c in ax.containers: + ax.bar_label(c, fmt='%.2f%%', label_type='center') + + +plt.show() diff --git a/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 5.py b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 5.py new file mode 100644 index 00000000..db00b59b --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 5.py @@ -0,0 +1,132 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np +import pandas as pd + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +transposed_df = df.transpose() + +ax = transposed_df.plot(kind='barh', stacked=True, figsize=(8, 6)) + +for c in ax.containers: + ax.bar_label(c, fmt='%.2f%', label_type='center') + + +plt.show() + diff --git a/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 6.py b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 6.py new file mode 100644 index 00000000..327de79b --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 6.py @@ -0,0 +1,158 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np +import pandas as pd + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +totality = [] + +for i in range(0, 19, 1): + totality.append(northTW[i] + centralTW[i] + southTW[i] + eastTW[i] + outlyingTW[i]) + + +print(totality) + +s = pd.Series(data=totality) +s.name = "Total" # The name of the Series becomes the index of the row in the DataFrame. +print(s) + +df = df.append(s) + +print(df) + +df2 = pd.DataFrame(data=totality, index=["Total"], columns=year) + +print(df2) + +transposed_df = df.transpose() + +ax = transposed_df.plot(kind='barh', stacked=True, figsize=(8, 6)) + +for c in ax.containers: + print(type(c)) + c = int(c) + totality = northTW + centralTW + southTW + eastTW + outlyingTW + percent = (c / totality) * 100 + ax.bar_label(percent, fmt='%.2f%', label_type='center') + + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/16824696/ diff --git a/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 7.py b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 7.py new file mode 100644 index 00000000..170be657 --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 7.py @@ -0,0 +1,137 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np +import pandas as pd + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +totality = [] + +for i in range(0, 19, 1): + totality.append(northTW[i] + centralTW[i] + southTW[i] + eastTW[i] + outlyingTW[i]) + + +print(totality) + +df2 = pd.DataFrame(data=totality, index=year, columns=["Total"]) + +print(df2) + +df = df.append(df2.transpose()) + +print(df) diff --git a/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 8.py b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 8.py new file mode 100644 index 00000000..9efbeec9 --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 8.py @@ -0,0 +1,147 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np +import pandas as pd + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +totality = [] + +for i in range(0, 19, 1): + totality.append(northTW[i] + centralTW[i] + southTW[i] + eastTW[i] + outlyingTW[i]) + + +print(totality) + +df2 = pd.DataFrame(data=totality, index=year, columns=["Total"]) + +print(df2) + +df = df.append(df2.transpose()) + +print(df) + +transposed_df = df.transpose() + +ax = transposed_df.plot(kind='barh', stacked=True, figsize=(8, 6)) + +for c in ax.containers: + ax.bar_label(c, fmt='%.2f%%', label_type='center') + + +plt.show() \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 9.py b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 9.py new file mode 100644 index 00000000..0b8e510c --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame 9.py @@ -0,0 +1,147 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np +import pandas as pd + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +totality = [] + +for i in range(0, 19, 1): + totality.append(northTW[i] + centralTW[i] + southTW[i] + eastTW[i] + outlyingTW[i]) + + +print(totality) + +df2 = pd.DataFrame(data=totality, index=year, columns=["Total"]) + +print(df2) + +df3 = df.append(df2.transpose()) + +print(df3) + +transposed_df = df.transpose() + +ax = transposed_df.plot(kind='barh', stacked=True, figsize=(8, 6)) + +for c in ax.containers: + ax.bar_label(c, fmt='%.2f%%', label_type='center') + + +plt.show() \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame.py b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame.py new file mode 100644 index 00000000..cd359535 --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/Percentage using data frame.py @@ -0,0 +1,130 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np +import pandas as pd + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +ax = df.plot(kind='barh', stacked=True, figsize=(8, 6)) + +for c in ax.containers: + ax.bar_label(c, fmt='%.2f%%', label_type='center') + + +plt.show() + diff --git a/The attainments and realizations of my dreams/Historical population composition/Population composition in history 10 (2022_first_half).py b/The attainments and realizations of my dreams/Historical population composition/Population composition in history 10 (2022_first_half).py new file mode 100644 index 00000000..e0d3e753 --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/Population composition in history 10 (2022_first_half).py @@ -0,0 +1,169 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +print(south) +print(central) +print(north) +print(east) +print(outlying) + +Total1940 = south[0] + central[0] + north[0] + east[0] + outlying[0] +Total1956 = south[1] + central[1] + north[1] + east[1] + outlying[1] +Total1960 = south[2] + central[2] + north[2] + east[2] + outlying[2] +Total1970 = south[3] + central[3] + north[3] + east[3] + outlying[3] +Total1980 = south[4] + central[4] + north[4] + east[4] + outlying[4] +Total1990 = south[5] + central[5] + north[5] + east[5] + outlying[5] +Total2000 = south[6] + central[6] + north[6] + east[6] + outlying[6] +Total2010 = south[7] + central[7] + north[7] + east[7] + outlying[7] +Total2015 = south[12] + central[12] + north[12] + east[12] + outlying[12] +Total2020 = south[17] + central[17] + north[17] + east[17] + outlying[17] +Total2021 = south[18] + central[18] + north[18] + east[18] + outlying[18] + +totality = [Total1940, Total1956, Total1960, Total1970, Total1980, Total1990, Total2000, Total2010, Total2020, Total2021] + +print(totality) + +cm = 1 / 2.54 + +plt.figure(figsize=(28 * cm, 15 * cm)) + +plt.bar(year, south, color='g', label="South Taiwan", align='edge', + width=0.3) # Adjusting the spacing between bars. [1] +plt.bar(year, central, color='y', bottom=south, label="Central Taiwan", align='edge', width=0.3) +plt.bar(year, north, color='b', bottom=south + central, label="North Taiwan", align='edge', width=0.3) +plt.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan", align='edge', width=0.3) +plt.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands", align='edge', + width=0.3) + +# get the current axes and store it to ax +axes = plt.gca() + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/40575741/14900011 diff --git a/The attainments and realizations of my dreams/Historical population composition/Population composition in history 7.py b/The attainments and realizations of my dreams/Historical population composition/Population composition in history 7.py new file mode 100644 index 00000000..4b49cdf5 --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/Population composition in history 7.py @@ -0,0 +1,170 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +print(south) +print(central) +print(north) +print(east) +print(outlying) + +Total1940 = south[0] + central[0] + north[0] + east[0] + outlying[0] +Total1956 = south[1] + central[1] + north[1] + east[1] + outlying[1] +Total1960 = south[2] + central[2] + north[2] + east[2] + outlying[2] +Total1970 = south[3] + central[3] + north[3] + east[3] + outlying[3] +Total1980 = south[4] + central[4] + north[4] + east[4] + outlying[4] +Total1990 = south[5] + central[5] + north[5] + east[5] + outlying[5] +Total2000 = south[6] + central[6] + north[6] + east[6] + outlying[6] +Total2010 = south[7] + central[7] + north[7] + east[7] + outlying[7] +Total2015 = south[12] + central[12] + north[12] + east[12] + outlying[12] +Total2020 = south[17] + central[17] + north[17] + east[17] + outlying[17] +Total2021 = south[18] + central[18] + north[18] + east[18] + outlying[18] + +totality = [Total1940, Total1956, Total1960, Total1970, Total1980, Total1990, Total2000, Total2010, Total2020, Total2021] + +print(totality) + +cm = 1 / 2.54 + +plt.figure(figsize=(28 * cm, 15 * cm)) + +plt.bar(year, south, color='g', label="South Taiwan", align='edge', + width=0.3) # Adjusting the spacing between bars. [1] +plt.bar(year, central, color='y', bottom=south, label="Central Taiwan", align='edge', width=0.3) +plt.bar(year, north, color='b', bottom=south + central, label="North Taiwan", align='edge', width=0.3) +plt.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan", align='edge', width=0.3) +plt.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands", align='edge', + width=0.3) + +# get the current axes and store it to ax +axes = plt.gca() + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/40575741/14900011 diff --git a/The attainments and realizations of my dreams/Historical population composition/Population composition in history 8.py b/The attainments and realizations of my dreams/Historical population composition/Population composition in history 8.py new file mode 100644 index 00000000..e0d3e753 --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/Population composition in history 8.py @@ -0,0 +1,169 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +print(south) +print(central) +print(north) +print(east) +print(outlying) + +Total1940 = south[0] + central[0] + north[0] + east[0] + outlying[0] +Total1956 = south[1] + central[1] + north[1] + east[1] + outlying[1] +Total1960 = south[2] + central[2] + north[2] + east[2] + outlying[2] +Total1970 = south[3] + central[3] + north[3] + east[3] + outlying[3] +Total1980 = south[4] + central[4] + north[4] + east[4] + outlying[4] +Total1990 = south[5] + central[5] + north[5] + east[5] + outlying[5] +Total2000 = south[6] + central[6] + north[6] + east[6] + outlying[6] +Total2010 = south[7] + central[7] + north[7] + east[7] + outlying[7] +Total2015 = south[12] + central[12] + north[12] + east[12] + outlying[12] +Total2020 = south[17] + central[17] + north[17] + east[17] + outlying[17] +Total2021 = south[18] + central[18] + north[18] + east[18] + outlying[18] + +totality = [Total1940, Total1956, Total1960, Total1970, Total1980, Total1990, Total2000, Total2010, Total2020, Total2021] + +print(totality) + +cm = 1 / 2.54 + +plt.figure(figsize=(28 * cm, 15 * cm)) + +plt.bar(year, south, color='g', label="South Taiwan", align='edge', + width=0.3) # Adjusting the spacing between bars. [1] +plt.bar(year, central, color='y', bottom=south, label="Central Taiwan", align='edge', width=0.3) +plt.bar(year, north, color='b', bottom=south + central, label="North Taiwan", align='edge', width=0.3) +plt.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan", align='edge', width=0.3) +plt.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands", align='edge', + width=0.3) + +# get the current axes and store it to ax +axes = plt.gca() + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/40575741/14900011 diff --git a/The attainments and realizations of my dreams/Historical population composition/Population composition in history 9.py b/The attainments and realizations of my dreams/Historical population composition/Population composition in history 9.py new file mode 100644 index 00000000..e0d3e753 --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/Population composition in history 9.py @@ -0,0 +1,169 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +print(south) +print(central) +print(north) +print(east) +print(outlying) + +Total1940 = south[0] + central[0] + north[0] + east[0] + outlying[0] +Total1956 = south[1] + central[1] + north[1] + east[1] + outlying[1] +Total1960 = south[2] + central[2] + north[2] + east[2] + outlying[2] +Total1970 = south[3] + central[3] + north[3] + east[3] + outlying[3] +Total1980 = south[4] + central[4] + north[4] + east[4] + outlying[4] +Total1990 = south[5] + central[5] + north[5] + east[5] + outlying[5] +Total2000 = south[6] + central[6] + north[6] + east[6] + outlying[6] +Total2010 = south[7] + central[7] + north[7] + east[7] + outlying[7] +Total2015 = south[12] + central[12] + north[12] + east[12] + outlying[12] +Total2020 = south[17] + central[17] + north[17] + east[17] + outlying[17] +Total2021 = south[18] + central[18] + north[18] + east[18] + outlying[18] + +totality = [Total1940, Total1956, Total1960, Total1970, Total1980, Total1990, Total2000, Total2010, Total2020, Total2021] + +print(totality) + +cm = 1 / 2.54 + +plt.figure(figsize=(28 * cm, 15 * cm)) + +plt.bar(year, south, color='g', label="South Taiwan", align='edge', + width=0.3) # Adjusting the spacing between bars. [1] +plt.bar(year, central, color='y', bottom=south, label="Central Taiwan", align='edge', width=0.3) +plt.bar(year, north, color='b', bottom=south + central, label="North Taiwan", align='edge', width=0.3) +plt.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan", align='edge', width=0.3) +plt.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands", align='edge', + width=0.3) + +# get the current axes and store it to ax +axes = plt.gca() + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/40575741/14900011 diff --git a/The attainments and realizations of my dreams/Historical population composition/Put data into data frame 2.py b/The attainments and realizations of my dreams/Historical population composition/Put data into data frame 2.py new file mode 100644 index 00000000..af5af6d3 --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/Put data into data frame 2.py @@ -0,0 +1,121 @@ +import numpy as np +import pandas as pd + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +df.to_csv("The composition of Taiwan's population in history.csv") diff --git a/The attainments and realizations of my dreams/Historical population composition/Put data into data frame.py b/The attainments and realizations of my dreams/Historical population composition/Put data into data frame.py new file mode 100644 index 00000000..e2d0a906 --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/Put data into data frame.py @@ -0,0 +1,150 @@ +import numpy as np +import pandas as pd + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +print(south) +print(central) +print(north) +print(east) +print(outlying) + +Total1940 = south[0] + central[0] + north[0] + east[0] + outlying[0] +Total1956 = south[1] + central[1] + north[1] + east[1] + outlying[1] +Total1960 = south[2] + central[2] + north[2] + east[2] + outlying[2] +Total1970 = south[3] + central[3] + north[3] + east[3] + outlying[3] +Total1980 = south[4] + central[4] + north[4] + east[4] + outlying[4] +Total1990 = south[5] + central[5] + north[5] + east[5] + outlying[5] +Total2000 = south[6] + central[6] + north[6] + east[6] + outlying[6] +Total2010 = south[7] + central[7] + north[7] + east[7] + outlying[7] +Total2015 = south[12] + central[12] + north[12] + east[12] + outlying[12] +Total2020 = south[17] + central[17] + north[17] + east[17] + outlying[17] +Total2021 = south[18] + central[18] + north[18] + east[18] + outlying[18] + +totality = [Total1940, Total1956, Total1960, Total1970, Total1980, Total1990, Total2000, Total2010, Total2020, Total2021] + +print(totality) + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + + diff --git a/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population in history.csv b/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population in history.csv new file mode 100644 index 00000000..3ba7f786 --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population in history.csv @@ -0,0 +1,6 @@ +,1940,56,60,70,80,90,2000,2010,'11,'12,'13,'14,'15,'16,'17,'18,'19,'20,'21/08 +North,1661638,2809383,3364068,5061373,6961776,8625648,9608750,10291178,10357405,10427504,10477807,10528933,10587558,10637131,10679329,10713182,10748581,10745030,10690537 +Central,1960847,2935425,3304823,4120651,4636221,5102974,5615237,5760817,5765806,5779924,5788242,5798112,5806552,5813610,5814759,5813634,5808940,5797752,5777006 +South,1950383,3091090,3565789,4747227,5463631,5919376,6303682,6336424,6325427,6323688,6315472,6306859,6295917,6286390,6273953,6258460,6244091,6218993,6188763 +East,234596,788170,460536,627560,636396,609036,598942,569478,565128,561442,558718,557862,554397,551713,548777,546887,543028,539633,536462 +Outlying,264786,85886,96986,197397,167984,144271,150061,204226,211146,223264,233278,241987,247650,250972,254409,256769,258481,259828,259069 diff --git a/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population.py b/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population.py new file mode 100644 index 00000000..a0c0a1d5 --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population.py @@ -0,0 +1,154 @@ +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +cm = 1 / 2.54 + +figure, axes = plt.subplots(figsize=(28 * cm, 15 * cm)) + +p1 = axes.bar(year, south, color='g', label="South Taiwan", align='edge', width=0.3) # Adjusting the spacing between bars. [1] +p2 = axes.bar(year, central, color='y', bottom=south, label="Central Taiwan", align='edge', width=0.3) +p3 = axes.bar(year, north, color='b', bottom=south + central, label="North Taiwan", align='edge', width=0.3) +p4 = axes.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan", align='edge', width=0.3) +p5 = axes.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands", align='edge', width=0.3) + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +# Label with label_type 'center' instead of the default 'edge' +axes.bar_label(p1, label_type='center') +axes.bar_label(p2, label_type='center') +axes.bar_label(p3, label_type='center') +axes.bar_label(p5) + +plt.show() diff --git a/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population2.py b/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population2.py new file mode 100644 index 00000000..393f2031 --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population2.py @@ -0,0 +1,154 @@ +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +cm = 1 / 2.54 + +figure, axes = plt.subplots(figsize=(28 * cm, 15 * cm)) + +p1 = axes.bar(year, south, color='g', label="South Taiwan", align='edge', width=0.3) # Adjusting the spacing between bars. [1] +p2 = axes.bar(year, central, color='y', bottom=south, label="Central Taiwan", align='edge', width=0.3) +p3 = axes.bar(year, north, color='b', bottom=south + central, label="North Taiwan", align='edge', width=0.3) +p4 = axes.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan", align='edge', width=0.3) +p5 = axes.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands", align='edge', width=0.3) + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +# Label with label_type 'center' instead of the default 'edge' +axes.bar_label(p1, label_type='center', fmt='%.2f') +axes.bar_label(p2, label_type='center', fmt='%.2f') +axes.bar_label(p3, label_type='center', fmt='%.2f') +axes.bar_label(p5) + +plt.show() diff --git a/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population3.py b/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population3.py new file mode 100644 index 00000000..56cba7c8 --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population3.py @@ -0,0 +1,154 @@ +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +cm = 1 / 2.54 + +figure, axes = plt.subplots(figsize=(28 * cm, 15 * cm)) + +p1 = axes.bar(year, south, color='g', label="South Taiwan", align='edge') +p2 = axes.bar(year, central, color='y', bottom=south, label="Central Taiwan", align='edge') +p3 = axes.bar(year, north, color='b', bottom=south + central, label="North Taiwan", align='edge') +p4 = axes.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan", align='edge') +p5 = axes.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands", align='edge') + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +# Label with label_type 'center' instead of the default 'edge' +axes.bar_label(p1, label_type='center', fmt='%.2f') +axes.bar_label(p2, label_type='center', fmt='%.2f') +axes.bar_label(p3, label_type='center', fmt='%.2f') +axes.bar_label(p5) + +plt.show() diff --git a/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population4.py b/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population4.py new file mode 100644 index 00000000..7ad3d1bc --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population4.py @@ -0,0 +1,157 @@ +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +cm = 1 / 2.54 + +figure, axes = plt.subplots(figsize=(28 * cm, 15 * cm)) + +p1 = axes.bar(year, south, color='g', label="South Taiwan") +p2 = axes.bar(year, central, color='y', bottom=south, label="Central Taiwan") +p3 = axes.bar(year, north, color='b', bottom=south + central, label="North Taiwan") +p4 = axes.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan") +p5 = axes.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands") + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +# Label with label_type 'center' instead of the default 'edge' +axes.bar_label(p1, label_type='center', fmt='%.2f') # [1] +axes.bar_label(p2, label_type='center', fmt='%.2f') +axes.bar_label(p3, label_type='center', fmt='%.2f') +axes.bar_label(p5) + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/64797097/14900011 diff --git a/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population4_1.py b/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population4_1.py new file mode 100644 index 00000000..e272ad25 --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population4_1.py @@ -0,0 +1,159 @@ +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +total = south + central + north + east + outlying + +cm = 1 / 2.54 + +figure, axes = plt.subplots(figsize=(28 * cm, 15 * cm)) + +p1 = axes.bar(year, south, color='g', label="South Taiwan") +p2 = axes.bar(year, central, color='y', bottom=south, label="Central Taiwan") +p3 = axes.bar(year, north, color='b', bottom=south + central, label="North Taiwan") +p4 = axes.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan") +p5 = axes.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands") + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +# Label with label_type 'center' instead of the default 'edge' +axes.bar_label(p1 / total * 100, label_type='center', fmt='%.2f') # [1] +axes.bar_label(p2 / total * 100, label_type='center', fmt='%.2f') +axes.bar_label(p3 / total * 100, label_type='center', fmt='%.2f') +axes.bar_label(p5 / total * 100) + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/64797097/14900011 diff --git a/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population4_2.py b/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population4_2.py new file mode 100644 index 00000000..855d4e99 --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population4_2.py @@ -0,0 +1,159 @@ +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +total = south + central + north + east + outlying + +cm = 1 / 2.54 + +figure, axes = plt.subplots(figsize=(28 * cm, 15 * cm)) + +p1 = axes.bar(year, south, color='g', label="South Taiwan") +p2 = axes.bar(year, central, color='y', bottom=south, label="Central Taiwan") +p3 = axes.bar(year, north, color='b', bottom=south + central, label="North Taiwan") +p4 = axes.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan") +p5 = axes.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands") + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +# Label with label_type 'center' instead of the default 'edge' +axes.bar_label(p1 / (p1 + p2 + p3 + p4 + p5), label_type='center', fmt='%.2f') # [1] +axes.bar_label(p2 / (p1 + p2 + p3 + p4 + p5), label_type='center', fmt='%.2f') +axes.bar_label(p3 / (p1 + p2 + p3 + p4 + p5), label_type='center', fmt='%.2f') +axes.bar_label(p5 /(p1 + p2 + p3 + p4 + p5)) + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/64797097/14900011 diff --git a/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population5.py b/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population5.py new file mode 100644 index 00000000..e270d653 --- /dev/null +++ b/The attainments and realizations of my dreams/Historical population composition/The composition of Taiwan's population5.py @@ -0,0 +1,195 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np +import pandas as pd + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +cm = 1 / 2.54 + +figure, axes = plt.subplots(figsize=(28 * cm, 15 * cm)) + +p1 = axes.bar(year, south, color='g', label="South Taiwan") +p2 = axes.bar(year, central, color='y', bottom=south, label="Central Taiwan") +p3 = axes.bar(year, north, color='b', bottom=south + central, label="North Taiwan") +p4 = axes.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan") +p5 = axes.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands") + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +# Label with label_type 'center' instead of the default 'edge' +# axes.bar_label(p1, label_type='center', fmt='%.2f') # [1] +# axes.bar_label(p2, label_type='center', fmt='%.2f') +# axes.bar_label(p3, label_type='center', fmt='%.2f') +# axes.bar_label(p5) + +for c in p1: + labels = [] + for v in c: + w = v.get_width() + if w > 0: + labels.append(f'{w:.2f}%') + else: + labels.append('') + + axes.bar_label(c, labels=labels, label_type='center') + + +for c in p2: + labels = [] + for v in c: + w = v.get_width() + if w > 0: + labels.append(f'{w:.2f}%') + else: + labels.append('') + + axes.bar_label(c, labels=labels, label_type='center') + + +for c in p3: + labels = [] + for v in c: + w = v.get_width() + if w > 0: + labels.append(f'{w:.2f}%') + else: + labels.append('') + + axes.bar_label(c, labels=labels, label_type='center') + + +axes.bar_label(p5) + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/64797097/14900011 diff --git a/The attainments and realizations of my dreams/Historical population composition/__init__.py b/The attainments and realizations of my dreams/Historical population composition/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly remuneration.py b/The attainments and realizations of my dreams/Monthly remuneration.py new file mode 100644 index 00000000..8da34729 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly remuneration.py @@ -0,0 +1 @@ +# Average monthly salary by metro \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Monthly remuneration/2023.py b/The attainments and realizations of my dreams/Monthly remuneration/2023.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly remuneration/__init__.py b/The attainments and realizations of my dreams/Monthly remuneration/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2021/CC-BY.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2021/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2021/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2021/September_metro_EN_ZH.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2021/September_metro_EN_ZH.py new file mode 100644 index 00000000..3623ecea --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2021/September_metro_EN_ZH.py @@ -0,0 +1,37 @@ +import matplotlib.pyplot as plt +import matplotlib +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [140966, 72721, 61138, 31208, 31440] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) # [1] +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) # [1] + +plt.title("2021/09 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) # [1] + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20210927094609/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(30000, 130000) + +plt.show() + +# Reference: +# 1. https://stackoverflow.com/a/12444777/ +# 2. https://stackoverflow.com/a/11386056/ \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2021/September_metro_EN_ZH_watermark.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2021/September_metro_EN_ZH_watermark.py new file mode 100644 index 00000000..8034999a --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2021/September_metro_EN_ZH_watermark.py @@ -0,0 +1,47 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.image as image + +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [140966, 72721, 61138, 31208, 31440] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) # [1] +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) # [1] + +plt.title("2021/09 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) # [1] + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20210927094609/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(30000, 130000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='30', + transform=ax.transAxes) + +plt.show() + +# Reference: +# 1. https://stackoverflow.com/a/12444777/ +# 2. https://stackoverflow.com/a/11386056/ \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2021/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2021/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/April/Borough.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/April/Borough.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/April/Borough_ZH_JP.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/April/Borough_ZH_JP.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/April/Metro_area.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/April/Metro_area.py new file mode 100644 index 00000000..701dd604 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/April/Metro_area.py @@ -0,0 +1,27 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [179197, 89380, 76630, 39687, 40032] + +label = ["Greater Taipei", "Taoyuan\nHsinchu\nMiaoli", "Taichung\nChanghua\nNantou", + "Yunlin\nChiayi\nTainan", "Kaohsiung\nPingtung"] + +fig, ax = plt.subplots(figsize=(9, 8)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2022/04 the number of job openings in Taiwan by metro") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20220428163845/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(35000, 165000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/April/Metro_area_EN_ZH_JP.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/April/Metro_area_EN_ZH_JP.py new file mode 100644 index 00000000..d3ab00c3 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/April/Metro_area_EN_ZH_JP.py @@ -0,0 +1,37 @@ +import matplotlib.pyplot as plt +import matplotlib +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [179197, 89380, 76630, 39687, 40032] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) # [1] +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) # [1] + +plt.title("2022/04 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) # [1] + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20220428163845/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(35000, 165000) + +plt.show() + +# Reference: +# 1. https://stackoverflow.com/a/12444777/ +# 2. https://stackoverflow.com/a/11386056/ \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/April/Metro_area_ZH_JP.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/April/Metro_area_ZH_JP.py new file mode 100644 index 00000000..051b45d4 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/April/Metro_area_ZH_JP.py @@ -0,0 +1,37 @@ +import matplotlib.pyplot as plt +import matplotlib +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [179197, 89380, 76630, 39687, 40032] + +label = ["憭批啣", "獢\n啁姘\n", "唬葉\n敶啣\n", + "脫\n蝢坼n啣", "擃\n撅"] + +fig, ax = plt.subplots(figsize=(9, 8)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) # [1] +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) # [1] + +plt.title("2022/04 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) # [1] + +# plt.ylabel("") +plt.xlabel("鞈: https://web.archive.org/web/20220428163845/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(35000, 165000) + +plt.show() + +# Reference: +# 1. https://stackoverflow.com/a/12444777/ +# 2. https://stackoverflow.com/a/11386056/ \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/April/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/April/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/August/CC-BY.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/August/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/August/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/August/Metro_areas_EN_ZH_JP.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/August/Metro_areas_EN_ZH_JP.py new file mode 100644 index 00000000..38478aef --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/August/Metro_areas_EN_ZH_JP.py @@ -0,0 +1,37 @@ +import matplotlib.pyplot as plt +import matplotlib +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [180741, 89132, 74250, 38822, 41763] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) # [1] +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) # [1] + +plt.title("2022/08 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) # [1] + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20220820070855/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(38000, 165000) + +plt.show() + +# Reference: +# 1. https://stackoverflow.com/a/12444777/ +# 2. https://stackoverflow.com/a/11386056/ \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/August/Metro_areas_EN_ZH_JP_humbling_watermark.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/August/Metro_areas_EN_ZH_JP_humbling_watermark.py new file mode 100644 index 00000000..b63bd005 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/August/Metro_areas_EN_ZH_JP_humbling_watermark.py @@ -0,0 +1,58 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [180741, 89132, 74250, 38822, 41763] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/08 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20220820070855/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(38000, 165000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='30', + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/August/Metro_areas_EN_ZH_JP_text watermark.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/August/Metro_areas_EN_ZH_JP_text watermark.py new file mode 100644 index 00000000..c7f0a837 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/August/Metro_areas_EN_ZH_JP_text watermark.py @@ -0,0 +1,58 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [180741, 89132, 74250, 38822, 41763] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/08 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20220820070855/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(38000, 165000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0 @Beipiao", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='30', + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/August/Metro_areas_EN_ZH_JP_watermark.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/August/Metro_areas_EN_ZH_JP_watermark.py new file mode 100644 index 00000000..794e7d8d --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/August/Metro_areas_EN_ZH_JP_watermark.py @@ -0,0 +1,47 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [180741, 89132, 74250, 38822, 41763] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/08 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20220820070855/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(38000, 165000) + +img = image.imread('CC-BY.png') # Load image. [1] + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) # Insert watermark image. [2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/tutorials/introductory/images.html +# 2. https://matplotlib.org/stable/gallery/images_contours_and_fields/watermark_image.html + +# Handy websites for choosing the CC license (image). +# 1. https://commons.wikimedia.org/wiki/Commons:Licensing#Well-known_licenses +# 2. https://creativecommons.org/choose/ \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/August/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/August/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/CC-BY.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/City_EN_ZH_JP_bi-polar_colar.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/City_EN_ZH_JP_bi-polar_colar.py new file mode 100644 index 00000000..58c4c674 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/City_EN_ZH_JP_bi-polar_colar.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [108202, 60340, 44310, 54606, 25545, 35594] + +label = ["啣撣\nTaipei", "啣撣\nNew Taipei", "獢\nTaoyuan", "唬葉\nTaichung", "啣\nTainan", "擃\n Kaohsiung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/12 啁撣瑞撩稞n the number of job openings in Taiwan by city", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20221223175247/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(25500, 100000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/Dark_theme.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/Dark_theme.py new file mode 100644 index 00000000..c824e2cc --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/Dark_theme.py @@ -0,0 +1,68 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +plt.style.use('dark_background') + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2003+108202+60340+4188, 44310+32291+6166, 54606+3483+9098, 4193+6351+25545, 35594+4417] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/12 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20221223175247/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(36500, 160000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/Metro_area_EN_ZH_JP_bi-polar_colored_bars.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/Metro_area_EN_ZH_JP_bi-polar_colored_bars.py new file mode 100644 index 00000000..ab932dfe --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/Metro_area_EN_ZH_JP_bi-polar_colored_bars.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2003+108202+60340+4188, 44310+32291+6166, 54606+3483+9098, 4193+6351+25545, 35594+4417] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='green', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/12 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20221223175247/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(36500, 160000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/Metro_area_EN_ZH_JP_bi-polar_colored_bars_2.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/Metro_area_EN_ZH_JP_bi-polar_colored_bars_2.py new file mode 100644 index 00000000..6314f1a8 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/Metro_area_EN_ZH_JP_bi-polar_colored_bars_2.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2003+108202+60340+4188, 44310+32291+6166, 54606+3483+9098, 4193+6351+25545, 35594+4417] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='red', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/12 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20221223175247/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(36500, 160000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/Metro_area_EN_ZH_JP_bi-polar_colored_bars_3.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/Metro_area_EN_ZH_JP_bi-polar_colored_bars_3.py new file mode 100644 index 00000000..ffc18c7c --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/Metro_area_EN_ZH_JP_bi-polar_colored_bars_3.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2003+108202+60340+4188, 44310+32291+6166, 54606+3483+9098, 4193+6351+25545, 35594+4417] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/12 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20221223175247/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(36500, 160000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/December/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/July/Metro_area_EN_ZH_JP.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/July/Metro_area_EN_ZH_JP.py new file mode 100644 index 00000000..083050aa --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/July/Metro_area_EN_ZH_JP.py @@ -0,0 +1,37 @@ +import matplotlib.pyplot as plt +import matplotlib +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [180263, 89334, 74194, 39046, 41424] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) # [1] +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) # [1] + +plt.title("2022/07 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) # [1] + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20220730070406/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(35000, 165000) + +plt.show() + +# Reference: +# 1. https://stackoverflow.com/a/12444777/ +# 2. https://stackoverflow.com/a/11386056/ \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/July/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/July/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/June/Metro_area_EN_ZH_JP.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/June/Metro_area_EN_ZH_JP.py new file mode 100644 index 00000000..5c746ab7 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/June/Metro_area_EN_ZH_JP.py @@ -0,0 +1,37 @@ +import matplotlib.pyplot as plt +import matplotlib +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [178202, 89216, 74059, 39413, 40549] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) # [1] +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) # [1] + +plt.title("2022/06 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) # [1] + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20220624160139/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(35000, 165000) + +plt.show() + +# Reference: +# 1. https://stackoverflow.com/a/12444777/ +# 2. https://stackoverflow.com/a/11386056/ \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/June/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/June/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/May/Metro_area_EN_ZH_JP.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/May/Metro_area_EN_ZH_JP.py new file mode 100644 index 00000000..9cc57bca --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/May/Metro_area_EN_ZH_JP.py @@ -0,0 +1,37 @@ +import matplotlib.pyplot as plt +import matplotlib +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [176040, 87874, 74498, 38787, 39508] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) # [1] +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) # [1] + +plt.title("2022/05 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) # [1] + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20220520164749/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(35000, 165000) + +plt.show() + +# Reference: +# 1. https://stackoverflow.com/a/12444777/ +# 2. https://stackoverflow.com/a/11386056/ \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/May/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/May/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/November/CC-BY.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/November/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/November/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/November/Metro_area_EN_ZH_JP.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/November/Metro_area_EN_ZH_JP.py new file mode 100644 index 00000000..cd7fc54b --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/November/Metro_area_EN_ZH_JP.py @@ -0,0 +1,58 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [1986+109298+61910+4247, 45574+32736+6243, 56198+3569+9591, 4316+6449+26284, 36088+4379] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/11 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20221125151358/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(38000, 165000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='30', + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/November/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/November/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/CC-BY.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Dark_sheet_2.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Dark_sheet_2.py new file mode 100644 index 00000000..da3e419c --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Dark_sheet_2.py @@ -0,0 +1,70 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +plt.style.use('dark_background') # [7][8] + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [1973+109860+62930+4205, 45938+33983+6435, 57369+3550+10081, 4296+6530+27058, 36903+4374] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='green', color=[colour.CSS4_COLORS.get('pink'), + colour.CSS4_COLORS.get('sandybrown'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('olivedrab'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/10 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20221022155046/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(38000, 165000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='30', + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://www.google.com/search?q=matplotlib+dark+theme +# 8. https://matplotlib.org/stable/gallery/style_sheets/dark_background.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Dark_sheet_2_.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Dark_sheet_2_.py new file mode 100644 index 00000000..41c9832b --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Dark_sheet_2_.py @@ -0,0 +1,70 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +plt.style.use('dark_background') # [7][8] + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [1973+109860+62930+4205, 45938+33983+6435, 57369+3550+10081, 4296+6530+27058, 36903+4374] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='green', color=[colour.CSS4_COLORS.get('pink'), + colour.CSS4_COLORS.get('sandybrown'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('olivedrab'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/10 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20221022155046/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(38000, 165000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://www.google.com/search?q=matplotlib+dark+theme +# 8. https://matplotlib.org/stable/gallery/style_sheets/dark_background.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Metro_area_EN_ZH_JP.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Metro_area_EN_ZH_JP.py new file mode 100644 index 00000000..4d89c1ce --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Metro_area_EN_ZH_JP.py @@ -0,0 +1,58 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [1973+109860+62930+4205, 45938+33983+6435, 57369+3550+10081, 4296+6530+27058, 36903+4374] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/10 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20221022155046/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(38000, 165000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='30', + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Metro_area_EN_ZH_JP_bi-polar_colored_bars.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Metro_area_EN_ZH_JP_bi-polar_colored_bars.py new file mode 100644 index 00000000..e1e3ebb5 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Metro_area_EN_ZH_JP_bi-polar_colored_bars.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [1973+109860+62930+4205, 45938+33983+6435, 57369+3550+10081, 4296+6530+27058, 36903+4374] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='green', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/10 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20221022155046/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(38000, 165000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='30', + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Metro_area_EN_ZH_JP_bipolar2.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Metro_area_EN_ZH_JP_bipolar2.py new file mode 100644 index 00000000..d08f739d --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Metro_area_EN_ZH_JP_bipolar2.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [1973+109860+62930+4205, 45938+33983+6435, 57369+3550+10081, 4296+6530+27058, 36903+4374] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='red', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/10 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20221022155046/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(38000, 165000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='30', + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Metro_area_EN_ZH_JP_colorful_bars.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Metro_area_EN_ZH_JP_colorful_bars.py new file mode 100644 index 00000000..95a06612 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Metro_area_EN_ZH_JP_colorful_bars.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [1973+109860+62930+4205, 45938+33983+6435, 57369+3550+10081, 4296+6530+27058, 36903+4374] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='green', color=[colour.CSS4_COLORS.get('pink'), + colour.CSS4_COLORS.get('sandybrown'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('olivedrab'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/10 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20221022155046/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(38000, 165000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='30', + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Metro_area_EN_ZH_JP_edge.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Metro_area_EN_ZH_JP_edge.py new file mode 100644 index 00000000..2e03cb5d --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/Metro_area_EN_ZH_JP_edge.py @@ -0,0 +1,58 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [1973+109860+62930+4205, 45938+33983+6435, 57369+3550+10081, 4296+6530+27058, 36903+4374] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='green') + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/10 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20221022155046/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(38000, 165000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='30', + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/dark_sheet.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/dark_sheet.py new file mode 100644 index 00000000..17e514c3 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/dark_sheet.py @@ -0,0 +1,70 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +plt.style.use('dark_background') # [7][8] + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [1973+109860+62930+4205, 45938+33983+6435, 57369+3550+10081, 4296+6530+27058, 36903+4374] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='red', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/10 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20221022155046/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(38000, 165000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='30', + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://www.google.com/search?q=matplotlib+dark+theme +# 8. https://matplotlib.org/stable/gallery/style_sheets/dark_background.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/dark_sheet_.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/dark_sheet_.py new file mode 100644 index 00000000..4e9a3bf6 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/October/dark_sheet_.py @@ -0,0 +1,70 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +plt.style.use('dark_background') # [7][8] + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [1973+109860+62930+4205, 45938+33983+6435, 57369+3550+10081, 4296+6530+27058, 36903+4374] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='red', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/10 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20221022155046/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(38000, 165000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://www.google.com/search?q=matplotlib+dark+theme +# 8. https://matplotlib.org/stable/gallery/style_sheets/dark_background.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/September/CC-BY.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/September/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/September/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/September/Metro_area_EN_ZH_JP.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/September/Metro_area_EN_ZH_JP.py new file mode 100644 index 00000000..6fa9ddb6 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/September/Metro_area_EN_ZH_JP.py @@ -0,0 +1,58 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2093+110672+63695+4272, 46489+34685+6557, 59061+3512+10472, 4346+6630+27509, 37149+4361] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2022/09 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20220924052436/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(38000, 165000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='30', + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/September/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/September/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2022/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/April_at_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/April_at_metro_level.py new file mode 100644 index 00000000..5790e47c --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/April_at_metro_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2282+120678+68698+4679, 46762+33071+6512, 62270+3708+10651, 4619+7100+27670, 38818+4833] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/04 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://web.archive.org/web/20230428143149/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(39000, 180000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/August_at_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/August_at_metro_level.py new file mode 100644 index 00000000..119f9f2c --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/August_at_metro_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2330+120454+70222+4816, 46557+32080+6382, 61457+3735+10472, 4729+6992+27009, 39056+4658] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/08 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://web.archive.org/web/20230825175852/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(39000, 180000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/CC-BY.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Colored_background.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Colored_background.py new file mode 100644 index 00000000..619f46c5 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Colored_background.py @@ -0,0 +1,57 @@ +import matplotlib.pyplot as plt +import numpy as np +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [107229, 59148, 43509, 54374, 24843, 34872] + +label = ["啣撣\nTaipei", "啣撣\nNew Taipei", "獢\nTaoyuan", "唬葉\nTaichung", "啣\nTainan", "擃\n Kaohsiung"] + +fig, ax = plt.subplots(figsize=(9, 9), facecolor=(.18, .31, .31)) # [1] +ax.set_facecolor('#eafff5') # [1] + +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/01 啁撣瑞撩稞n the number of job openings in Taiwan by city", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20230121040108/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(24500, 100000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) + + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/color/color_demo.html#sphx-glr-gallery-color-color-demo-py diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/December at metro level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/December at metro level.py new file mode 100644 index 00000000..3816c073 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/December at metro level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2245+115424+66623+4440, 44604+31263+6311, 57794+3654+9769, 4478+6632+25388, 37581+4444] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/12 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://web.archive.org/web/20231224055127/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(39000, 180000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/February_at_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/February_at_metro_level.py new file mode 100644 index 00000000..24d67165 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/February_at_metro_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2159+117112+66887+4481, 46293+33280+6473, 61241+3584+10497, 4497+7045+28025, 38586+4701] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('dimgrey'), + colour.CSS4_COLORS.get('dimgrey'), + colour.CSS4_COLORS.get('dimgrey'), + colour.CSS4_COLORS.get('dimgrey'), + colour.CSS4_COLORS.get('dimgrey')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/02 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://web.archive.org/web/20230225170349/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(39000, 180000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Gradients.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Gradients.py new file mode 100644 index 00000000..63cfbee4 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Gradients.py @@ -0,0 +1,64 @@ +import matplotlib.pyplot as plt +import numpy as np + +np.random.seed(19680801) + + +def gradient_image(ax, extent, direction=0.3, cmap_range=(0, 1), **kwargs): + """ + Draw a gradient image based on a colormap. + + Parameters + ---------- + ax : Axes + The axes to draw on. + extent + The extent of the image as (xmin, xmax, ymin, ymax). + By default, this is in Axes coordinates but may be + changed using the *transform* keyword argument. + direction : float + The direction of the gradient. This is a number in + range 0 (=vertical) to 1 (=horizontal). + cmap_range : float, float + The fraction (cmin, cmax) of the colormap that should be + used for the gradient, where the complete colormap is (0, 1). + **kwargs + Other parameters are passed on to `.Axes.imshow()`. + In particular useful is *cmap*. + """ + phi = direction * np.pi / 2 + v = np.array([np.cos(phi), np.sin(phi)]) + X = np.array([[v @ [1, 0], v @ [1, 1]], + [v @ [0, 0], v @ [0, 1]]]) + a, b = cmap_range + X = a + (b - a) / X.max() * X + im = ax.imshow(X, extent=extent, interpolation='bicubic', + vmin=0, vmax=1, **kwargs) + return im + + +def gradient_bar(ax, x, y, width=0.5, bottom=0): + for left, top in zip(x, y): + right = left + width + gradient_image(ax, extent=(left, right, bottom, top), + cmap=plt.cm.Blues_r, cmap_range=(0, 0.8)) + + +xmin, xmax = xlim = 0, 10 +ymin, ymax = ylim = 0, 1 + +fig, ax = plt.subplots() +ax.set(xlim=xlim, ylim=ylim, autoscale_on=False) + +# background image +gradient_image(ax, direction=1, extent=(0, 1, 0, 1), transform=ax.transAxes, + cmap=plt.cm.RdYlGn, cmap_range=(0.2, 0.8), alpha=0.5) + +N = 10 +x = np.arange(N) + 0.15 +y = np.random.rand(N) +gradient_bar(ax, x, y, width=0.7) +ax.set_aspect('auto') +plt.show() + +# Source: https://matplotlib.org/stable/gallery/lines_bars_and_markers/gradient_bar.html#sphx-glr-gallery-lines-bars-and-markers-gradient-bar-py diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Gray_style.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Gray_style.py new file mode 100644 index 00000000..29cc6b27 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Gray_style.py @@ -0,0 +1,57 @@ +import matplotlib.pyplot as plt +import numpy as np +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") +plt.style.use('grayscale') # [1] + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [107229, 59148, 43509, 54374, 24843, 34872] + +label = ["啣撣\nTaipei", "啣撣\nNew Taipei", "獢\nTaoyuan", "唬葉\nTaichung", "啣\nTainan", "擃\n Kaohsiung"] + +fig, ax = plt.subplots(figsize=(9, 9)) + +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/01 啁撣瑞撩稞n the number of job openings in Taiwan by city", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20230121040108/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(24500, 100000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) + + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/style_sheets/grayscale.html diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Gray_style_.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Gray_style_.py new file mode 100644 index 00000000..711b764d --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Gray_style_.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [1956+107229+59148+4074, 43509+31609+6060, 54374+3290+9152, 4148+6256+24843, 34872+4328] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('dimgrey'), + colour.CSS4_COLORS.get('dimgrey'), + colour.CSS4_COLORS.get('dimgrey'), + colour.CSS4_COLORS.get('dimgrey'), + colour.CSS4_COLORS.get('dimgrey')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/01 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 https://web.archive.org/web/20230121040108/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(35000, 160000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/January_at_city_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/January_at_city_level.py new file mode 100644 index 00000000..f7ec24d6 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/January_at_city_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [107229, 59148, 43509, 54374, 24843, 34872] + +label = ["啣撣\nTaipei", "啣撣\nNew Taipei", "獢\nTaoyuan", "唬葉\nTaichung", "啣\nTainan", "擃\n Kaohsiung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/01 啁撣瑞撩稞n the number of job openings in Taiwan by city", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://web.archive.org/web/20230121040108/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(24500, 100000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/January_at_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/January_at_metro_level.py new file mode 100644 index 00000000..50ae6994 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/January_at_metro_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [1956+107229+59148+4074, 43509+31609+6060, 54374+3290+9152, 4148+6256+24843, 34872+4328] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/01 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 https://web.archive.org/web/20230121040108/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(35000, 160000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/July_at_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/July_at_metro_level.py new file mode 100644 index 00000000..2645d011 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/July_at_metro_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2273+120972+70445+4696, 46704+32199+6462, 62522+3700+10519, 4735+7019+27428, 39162+4949] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/07 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://web.archive.org/web/20230724175106/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(39000, 180000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/June_at_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/June_at_metro_level.py new file mode 100644 index 00000000..85a55d2b --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/June_at_metro_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2229+121265+69465+4756, 46302+32673+6346, 62546+3741+10493, 4634+7086+27386, 38660+4915] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/06 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://web.archive.org/web/20230624081015/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(39000, 180000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/March_at_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/March_at_metro_level.py new file mode 100644 index 00000000..bfe79580 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/March_at_metro_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2218+118537+67748+4572, 46204+32949+6326, 61701+3690+10576, 4496+6995+27400, 38365+4660] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('dimgrey'), + colour.CSS4_COLORS.get('dimgrey'), + colour.CSS4_COLORS.get('dimgrey'), + colour.CSS4_COLORS.get('dimgrey'), + colour.CSS4_COLORS.get('dimgrey')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/03 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://web.archive.org/web/20230326054107/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(39000, 180000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/May_at_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/May_at_metro_level.py new file mode 100644 index 00000000..cc093b76 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/May_at_metro_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2272+121546+69579+4789, 46355+33109+6432, 63498+3754+10801, 4714+7123+28015, 39181+4925] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/05 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://web.archive.org/web/20230526102541/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(39000, 180000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/November_at_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/November_at_metro_level.py new file mode 100644 index 00000000..4e27b208 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/November_at_metro_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2252+117404+67476+4504, 45617+31468+6351, 58717+3709+10012, 4459+6837+25912, 37960+4495] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/11 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://web.archive.org/web/20231124162552/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(39000, 180000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/October_at_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/October_at_metro_level.py new file mode 100644 index 00000000..5b94ae62 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/October_at_metro_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2253+118394+68186+4594, 45794+31743+6269, 59514+3718+10102, 4517+6926+26601, 38377+4517] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/10 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://web.archive.org/web/20231025065031/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(39000, 180000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/September_at_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/September_at_metro_level.py new file mode 100644 index 00000000..1384dd08 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/September_at_metro_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2248+119915+69679+4742, 47773+31910+6417, 60475+3709+10272, 4722+6891+26719, 38928+4570] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/09 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://web.archive.org/web/20230926041705/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(39000, 180000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Taipei_v_Kaohsiung_June.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Taipei_v_Kaohsiung_June.py new file mode 100644 index 00000000..3e4d5d1f --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Taipei_v_Kaohsiung_June.py @@ -0,0 +1,65 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2] +position_vacancies = [121265, 38660] + +label = ["啣撣\nTaipei City", "擃撣\nKaohsiung City"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/06 啁鈭撣瑞撩稞n the number of job openings in Taipei & Kaohsiung of Taiwan", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://web.archive.org/web/20230624081015/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(30000, 130000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=700, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Taipei_v_Kaohsiung_Nov_colored.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Taipei_v_Kaohsiung_Nov_colored.py new file mode 100644 index 00000000..6010c1dc --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Taipei_v_Kaohsiung_Nov_colored.py @@ -0,0 +1,65 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2] +position_vacancies = [117404, 37960] + +label = ["啣撣\nTaipei City", "擃撣\nKaohsiung City"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('blue'), + colour.CSS4_COLORS.get('green'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/11 啁鈭撣瑞撩稞n the number of job openings in Taipei & Kaohsiung of Taiwan", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://web.archive.org/web/20231124162552/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(30000, 130000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=700, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Taipei_v_Kaohsiung_November.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Taipei_v_Kaohsiung_November.py new file mode 100644 index 00000000..01d7fb6e --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Taipei_v_Kaohsiung_November.py @@ -0,0 +1,65 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2] +position_vacancies = [117404, 37960] + +label = ["啣撣\nTaipei City", "擃撣\nKaohsiung City"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/11 啁鈭撣瑞撩稞n the number of job openings in Taipei & Kaohsiung of Taiwan", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://web.archive.org/web/20231124162552/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(30000, 130000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=700, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Taipei_v_Kaohsiung_October.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Taipei_v_Kaohsiung_October.py new file mode 100644 index 00000000..3fff1b1e --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/Taipei_v_Kaohsiung_October.py @@ -0,0 +1,65 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2] +position_vacancies = [118394, 38377] + +label = ["啣撣\nTaipei City", "擃撣\nKaohsiung City"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2023/10 啁鈭撣瑞撩稞n the number of job openings in Taipei & Kaohsiung of Taiwan", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://web.archive.org/web/20231025065031/https://www.104.com.tw/jobs/main/category/?jobsource=category") + +plt.ylim(30000, 130000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=700, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2023/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/April/April_at_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/April/April_at_metro_level.py new file mode 100644 index 00000000..2e9715b2 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/April/April_at_metro_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2424+126989+74305+4715, 49849+34463+6907, 65629+11258+3980, 4791+7315+28894, 41321+4896] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/04 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/OTLpz") + +plt.ylim(39000, 190000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/April/April_at_selected_cities.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/April/April_at_selected_cities.py new file mode 100644 index 00000000..b172d5c4 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/April/April_at_selected_cities.py @@ -0,0 +1,65 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3] +position_vacancies = [126989, 49849, 41321] + +label = ["啣撣\nTaipei City", "獢撣\nTaoyuan City", "擃撣\nKaohsiung City"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/04 啁撣瑞撩稞n the number of job openings in selected cities of Taiwan", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/OTLpz") + +plt.ylim(30000, 130000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=700, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/April/CC-BY.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/April/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/April/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/April/Taipei_v_Kaohsiung_II.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/April/Taipei_v_Kaohsiung_II.py new file mode 100644 index 00000000..489c7d78 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/April/Taipei_v_Kaohsiung_II.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2] +position_vacancies = [126989, 41321] + +label = ["啣撣 Taipei City\n(Temporary Capital City \nof Republic of China)", + "擃撣 Kaohsiung City\n(Capital City of the US \npolitical system in Taiwan)"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=0, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/04 啁鈭撣瑞撩稞n the number of job openings in Taipei & Kaohsiung of Taiwan", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/OTLpz") + +plt.ylim(30000, 130000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=700, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/April/Taipei_v_Kaosiung.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/April/Taipei_v_Kaosiung.py new file mode 100644 index 00000000..21f8fbf8 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/April/Taipei_v_Kaosiung.py @@ -0,0 +1,65 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2] +position_vacancies = [126989, 41321] + +label = ["啣撣\nTaipei City", "擃撣\nKaohsiung City"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/04 啁鈭撣瑞撩稞n the number of job openings in Taipei & Kaohsiung of Taiwan", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/OTLpz") + +plt.ylim(30000, 130000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=700, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/April/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/April/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/August/August_at_city_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/August/August_at_city_level.py new file mode 100644 index 00000000..5a057bb1 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/August/August_at_city_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [126957, 75446, 51052, 66953, 29165, 41923] + +label = ["啣撣\nTaipei", "啣撣\nNew Taipei", "獢\nTaoyuan", "唬葉\nTaichung", "啣\nTainan", "擃\n Kaohsiung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/08 啁渲撣瑞撩稞n the number of job openings in Taiwan by city", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://archive.ph/1k2LD") + +plt.ylim(29000, 120000) + +img = image.imread('CC0.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Free clip art\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/August/August_at_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/August/August_at_metro_level.py new file mode 100644 index 00000000..3ba31379 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/August/August_at_metro_level.py @@ -0,0 +1,67 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2496+126957+75446+4622, 51052+34783+6937, 66953+11542+3795, 5007+7515+29165, 41932+5178] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/08 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/1k2LD") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC0 Public Domain\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/August/CC0.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/August/CC0.png new file mode 100644 index 00000000..10986298 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/August/CC0.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/August/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/August/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/CC-BY.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/December/At city level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/December/At city level.py new file mode 100644 index 00000000..000d1686 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/December/At city level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [119996, 71805, 49495, 61844, 27652, 40108] + +label = ["啣撣\nTaipei", "啣撣\nNew Taipei", "獢\nTaoyuan", "唬葉\nTaichung", "啣\nTainan", "擃\n Kaohsiung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/12 啁渲撣瑞撩稞n the number of job openings in Taiwan by city", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://archive.ph/oHkAG") + +plt.ylim(25000, 115000) + +img = image.imread('CC0.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Free clip art\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/December/At metro level stained.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/December/At metro level stained.py new file mode 100644 index 00000000..561e48e4 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/December/At metro level stained.py @@ -0,0 +1,67 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2368+119996+71805+4210, 49495+33978+6655, 61844+11051+3587, 4801+7172+27652, 40108+4779] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('cyan'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/12 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/oHkAG") + +plt.ylim(39000, 190000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC0 Public Domain\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/December/At metro level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/December/At metro level.py new file mode 100644 index 00000000..763cccbc --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/December/At metro level.py @@ -0,0 +1,67 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2368+119996+71805+4210, 49495+33978+6655, 61844+11051+3587, 4801+7172+27652, 40108+4779] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/12 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/oHkAG") + +plt.ylim(39000, 190000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC0 Public Domain\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/December/CC0.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/December/CC0.png new file mode 100644 index 00000000..10986298 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/December/CC0.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/December/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/December/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/February_at_city_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/February_at_city_level.py new file mode 100644 index 00000000..d4685938 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/February_at_city_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [120654, 69852, 46792, 63539, 27385, 39865] + +label = ["啣撣\nTaipei", "啣撣\nNew Taipei", "獢\nTaoyuan", "唬葉\nTaichung", "啣\nTainan", "擃\n Kaohsiung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/02 啁撣瑞撩稞n the number of job openings in Taiwan by city", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://archive.ph/LPccQ") + +plt.ylim(25000, 110000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/February_at_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/February_at_metro_level.py new file mode 100644 index 00000000..1b08eb5b --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/February_at_metro_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2309+120654+69852+4581, 46792+32468+6475, 62539+10650+3860, 4681+7101+27385, 39865+4742] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/02 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/LPccQ") + +plt.ylim(39000, 180000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/February_selected_cities.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/February_selected_cities.py new file mode 100644 index 00000000..4ea0b6e7 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/February_selected_cities.py @@ -0,0 +1,65 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3] +position_vacancies = [120654, 46792, 39865] + +label = ["啣撣\nTaipei City", "獢撣\nTaoyuan City", "擃撣\nKaohsiung City"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/02 啁撣瑞撩稞n the number of job openings in selected cities of Taiwan", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/LPccQ") + +plt.ylim(30000, 130000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=700, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/July/CC0.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/July/CC0.png new file mode 100644 index 00000000..10986298 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/July/CC0.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/July/July_at_city_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/July/July_at_city_level.py new file mode 100644 index 00000000..840a2177 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/July/July_at_city_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [128332, 76131, 51385, 67834, 29583, 42558] + +label = ["啣撣\nTaipei", "啣撣\nNew Taipei", "獢\nTaoyuan", "唬葉\nTaichung", "啣\nTainan", "擃\n Kaohsiung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/07 啁渲撣瑞撩稞n the number of job openings in Taiwan by city", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://archive.ph/y83Zk") + +plt.ylim(29000, 120000) + +img = image.imread('CC0.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Free clip art\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/July/July_at_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/July/July_at_metro_level.py new file mode 100644 index 00000000..05d0474d --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/July/July_at_metro_level.py @@ -0,0 +1,67 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2491+128332+76131+4689, 51385+34823+6945, 67834+11667+3871, 4983+7684+29583, 42558+5161] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/07 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/y83Zk") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC0 Public Domain\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/July/July_at_metro_level_2.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/July/July_at_metro_level_2.py new file mode 100644 index 00000000..73bb4ea3 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/July/July_at_metro_level_2.py @@ -0,0 +1,67 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2491+128332+76131+4689, 51385+34823+6945, 67834+11667+3871, 4983+7684+29583, 42558+5161] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/07 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/y83Zk") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC0 No Copyright\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/July/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/July/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/July/cc-zero.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/July/cc-zero.png new file mode 100644 index 00000000..03d281cb Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/July/cc-zero.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/June/CC-BY.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/June/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/June/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/June/June_at_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/June/June_at_metro_level.py new file mode 100644 index 00000000..7fd05f2a --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/June/June_at_metro_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2550+128831+76220+4804, 51404+35238+7004, 67413+11783+3960, 4991+7755+29815, 42698+5253] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/06 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/5VB0A") + +plt.ylim(40000, 200000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/June/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/June/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/March_at_city_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/March_at_city_level.py new file mode 100644 index 00000000..25cae813 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/March_at_city_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [125781, 73316, 49119, 65388, 28689, 41028] + +label = ["啣撣\nTaipei", "啣撣\nNew Taipei", "獢\nTaoyuan", "唬葉\nTaichung", "啣\nTainan", "擃\n Kaohsiung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/03 啁撣瑞撩稞n the number of job openings in Taiwan by city", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://archive.ph/2tZVM") + +plt.ylim(27000, 120000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/March_at_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/March_at_metro_level.py new file mode 100644 index 00000000..0ac98c8e --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/March_at_metro_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2389+125781+73316+4680, 49119+33992+6788, 65388+11072+3969, 4751+7130+28689, 41028+4772] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/03 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/2tZVM") + +plt.ylim(39000, 190000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/March_selected_cities.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/March_selected_cities.py new file mode 100644 index 00000000..653210a2 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/March_selected_cities.py @@ -0,0 +1,65 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3] +position_vacancies = [125781, 49119, 41082] + +label = ["啣撣\nTaipei City", "獢撣\nTaoyuan City", "擃撣\nKaohsiung City"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/03 啁撣瑞撩稞n the number of job openings in selected cities of Taiwan", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/2tZVM") + +plt.ylim(30000, 130000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=700, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/May/CC-BY.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/May/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/May/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/May/May_at_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/May/May_at_metro_level.py new file mode 100644 index 00000000..d9b5a6c6 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/May/May_at_metro_level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2464+127764+75057+4738, 50702+34801+7110, 66764+11576+4078, 4900+7655+29402, 42027+5057] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/05 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/akuc4") + +plt.ylim(39000, 190000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/May/May_at_metro_level2.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/May/May_at_metro_level2.py new file mode 100644 index 00000000..c6c7bbd0 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/May/May_at_metro_level2.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2464+127764+75057+4738, 50702+34801+7110, 66764+11576+4078, 4900+7655+29402, 42027+5057] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/05 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/akuc4") + +plt.ylim(39500, 195000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/May/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/May/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/November/At city level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/November/At city level.py new file mode 100644 index 00000000..922342a3 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/November/At city level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [120852, 72141, 49778, 63245, 27751, 40524] + +label = ["啣撣\nTaipei", "啣撣\nNew Taipei", "獢\nTaoyuan", "唬葉\nTaichung", "啣\nTainan", "擃\n Kaohsiung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/11 啁渲撣瑞撩稞n the number of job openings in Taiwan by city", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://archive.ph/RJysO") + +plt.ylim(28500, 115000) + +img = image.imread('CC0.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Free clip art\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/November/At metro level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/November/At metro level.py new file mode 100644 index 00000000..1890f483 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/November/At metro level.py @@ -0,0 +1,67 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2393+120852+72141+4192, 49778+34158+6679, 63245+11172+3637, 4836+7225+27751, 40524+4772] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/11 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/RJysO") + +plt.ylim(40000, 190000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC0 Public Domain\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/November/CC0.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/November/CC0.png new file mode 100644 index 00000000..10986298 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/November/CC0.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/November/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/November/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/October/CC0.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/October/CC0.png new file mode 100644 index 00000000..10986298 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/October/CC0.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/October/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/October/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/October/at city level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/October/at city level.py new file mode 100644 index 00000000..b0fafc2c --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/October/at city level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [122309, 73368, 50482, 64063, 28336, 41160] + +label = ["啣撣\nTaipei", "啣撣\nNew Taipei", "獢\nTaoyuan", "唬葉\nTaichung", "啣\nTainan", "擃\n Kaohsiung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/10 啁渲撣瑞撩稞n the number of job openings in Taiwan by city", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://archive.ph/cgPju") + +plt.ylim(28500, 115000) + +img = image.imread('CC0.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Free clip art\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/October/at metro level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/October/at metro level.py new file mode 100644 index 00000000..15dafda2 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/October/at metro level.py @@ -0,0 +1,67 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2457+122625+73277+4385, 50629+34417+6723, 64162+11297+3722, 4929+7221+28352, 41259+4967] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/10 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/HbvM1") + +plt.ylim(40000, 190000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC0 Public Domain\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/September/CC0.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/September/CC0.png new file mode 100644 index 00000000..10986298 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/September/CC0.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/September/September at metro level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/September/September at metro level.py new file mode 100644 index 00000000..e9c638bc --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/September/September at metro level.py @@ -0,0 +1,67 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2479+125456+74867+4649, 50727+34653+6936, 65562+11664+3830, 4844+7443+28934, 41770+5043] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/09 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/QkgSJ") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC0 Public Domain\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/September/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/September/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/September/at city level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/September/at city level.py new file mode 100644 index 00000000..a852d3e3 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/September/at city level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [125456, 74867, 50727, 65562, 28934, 41770] + +label = ["啣撣\nTaipei", "啣撣\nNew Taipei", "獢\nTaoyuan", "唬葉\nTaichung", "啣\nTainan", "擃\n Kaohsiung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/09 啁渲撣瑞撩稞n the number of job openings in Taiwan by city", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://archive.ph/QkgSJ") + +plt.ylim(29000, 120000) + +img = image.imread('CC0.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Free clip art\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/Taipei_v_Kaohsiung_February.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/Taipei_v_Kaohsiung_February.py new file mode 100644 index 00000000..ee688f6d --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/Taipei_v_Kaohsiung_February.py @@ -0,0 +1,65 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2] +position_vacancies = [120654, 39865] + +label = ["啣撣\nTaipei City", "擃撣\nKaohsiung City"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/02 啁鈭撣瑞撩稞n the number of job openings in Taipei & Kaohsiung of Taiwan", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/LPccQ") + +plt.ylim(30000, 130000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=700, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/Taipei_v_Kaohsiung_February_II.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/Taipei_v_Kaohsiung_February_II.py new file mode 100644 index 00000000..6812f3b4 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/Taipei_v_Kaohsiung_February_II.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2] +position_vacancies = [120654, 39865] + +label = ["啣撣 Taipei City\n(Temporary Capital City \nof Republic of China)", + "擃撣 Kaohsiung City\n(Capital City of the US \npolitical system in Taiwan)"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=0, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/02 啁鈭撣瑞撩稞n the number of job openings in Taipei & Kaohsiung of Taiwan", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/LPccQ") + +plt.ylim(30000, 130000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=700, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/Taipei_v_Kaohsiung_March.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/Taipei_v_Kaohsiung_March.py new file mode 100644 index 00000000..3d551cbd --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/Taipei_v_Kaohsiung_March.py @@ -0,0 +1,65 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2] +position_vacancies = [125781, 41082] + +label = ["啣撣\nTaipei City", "擃撣\nKaohsiung City"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/03 啁鈭撣瑞撩稞n the number of job openings in Taipei & Kaohsiung of Taiwan", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/2tZVM") + +plt.ylim(30000, 130000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=700, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/Taipei_v_Kaohsiung_March_II.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/Taipei_v_Kaohsiung_March_II.py new file mode 100644 index 00000000..056488c0 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/Taipei_v_Kaohsiung_March_II.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2] +position_vacancies = [125781, 41028] + +label = ["啣撣 Taipei City\n(Temporary Capital City \nof Republic of China)", + "擃撣 Kaohsiung City\n(Capital City of the US \npolitical system in Taiwan)"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=0, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/03 啁鈭撣瑞撩稞n the number of job openings in Taipei & Kaohsiung of Taiwan", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/2tZVM") + +plt.ylim(30000, 130000) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=600, yo=700, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2024/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/April/At city level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/April/At city level.py new file mode 100644 index 00000000..6c00bbce --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/April/At city level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [128675, 78059, 54148, 66678, 30806, 43275] + +label = ["啣撣\nTaipei", "啣撣\nNew Taipei", "獢\nTaoyuan", "唬葉\nTaichung", "啣\nTainan", "擃\n Kaohsiung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/4 啁渲撣瑞撩稞n the number of job openings in Taiwan by city", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://archive.ph/WHbv4") + +plt.ylim(30000, 120000) + +img = image.imread('CC0.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Free clip art\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/April/At metro level color gradient.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/April/At metro level color gradient.py new file mode 100644 index 00000000..e8c91069 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/April/At metro level color gradient.py @@ -0,0 +1,103 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import numpy as np +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2660+128675+78059+4316, 54148+36073+7249, 66678+12235+3914, 5088+7870+30806, 43275+5021] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('darkblue'), + colour.CSS4_COLORS.get('mediumblue'), + colour.CSS4_COLORS.get('blue'), + 'none', + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/04 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/WHbv4") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Non-copyrighted image\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +cmap = matplotlib.colormaps.get_cmap('winter') # [8][9] + +counter = 0 + +for rect in plot: # [8][9] + + if rect is not None: + + counter = counter + 1 + + if counter == 4: + + # Bar position and size + x = rect.get_x() + width = rect.get_width() + height = rect.get_height() + + # Create a grid inside the bar + nx = 100 # Number of divisions horizontally + ny = 100 # Number of divisions vertically + X = np.linspace(x, x + width, nx) + Y = np.linspace(0, height, ny) + X, Y = np.meshgrid(X, Y) + + # Color based on horizontal position (left to right) + Z = (X - x) / width # Normalize X inside the bar (0 to 1) + + # Draw gradient + ax.pcolormesh(X, Y, Z, cmap=cmap, shading='auto') + + + + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ +# 8. https://chatgpt.com/c/680c6f49-95b4-8008-85f4-3941744f62e4 +# 9. Untitled5.ipynb @ my Google Colab. + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/April/CC0.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/April/CC0.png new file mode 100644 index 00000000..10986298 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/April/CC0.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/April/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/April/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/August/At city level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/August/At city level.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/August/At_metro_level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/August/At_metro_level.py new file mode 100644 index 00000000..73386c02 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/August/At_metro_level.py @@ -0,0 +1,103 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import numpy as np +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2548+125333+77120+4472, 54232+35557+7123, 64774+11679+3769, 4984+7987+30050, 42510+4816] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('darkblue'), + colour.CSS4_COLORS.get('mediumblue'), + colour.CSS4_COLORS.get('blue'), + 'none', + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/08 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/pMkqg") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Non-copyrighted image\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +cmap = matplotlib.colormaps.get_cmap('winter') # [8][9] + +counter = 0 + +for rect in plot: # [8][9] + + if rect is not None: + + counter = counter + 1 + + if counter == 4: + + # Bar position and size + x = rect.get_x() + width = rect.get_width() + height = rect.get_height() + + # Create a grid inside the bar + nx = 100 # Number of divisions horizontally + ny = 100 # Number of divisions vertically + X = np.linspace(x, x + width, nx) + Y = np.linspace(0, height, ny) + X, Y = np.meshgrid(X, Y) + + # Color based on horizontal position (left to right) + Z = (X - x) / width # Normalize X inside the bar (0 to 1) + + # Draw gradient + ax.pcolormesh(X, Y, Z, cmap=cmap, shading='auto') + + + + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ +# 8. https://chatgpt.com/c/680c6f49-95b4-8008-85f4-3941744f62e4 +# 9. Untitled5.ipynb @ my Google Colab. + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/August/CC0.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/August/CC0.png new file mode 100644 index 00000000..10986298 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/August/CC0.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/August/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/August/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/February/At city level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/February/At city level.py new file mode 100644 index 00000000..6d99d01c --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/February/At city level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [128075, 78000, 53560, 67473, 30503, 43279] + +label = ["啣撣\nTaipei", "啣撣\nNew Taipei", "獢\nTaoyuan", "唬葉\nTaichung", "啣\nTainan", "擃\n Kaohsiung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/2 啁渲撣瑞撩稞n the number of job openings in Taiwan by city", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://archive.ph/ApRE7") + +plt.ylim(30000, 120000) + +img = image.imread('CC0.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Free clip art\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/February/At metro level color.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/February/At metro level color.py new file mode 100644 index 00000000..2105c9a4 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/February/At metro level color.py @@ -0,0 +1,67 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2633+128075+78000+4404, 53560+35893+7092, 67473+12257+3859, 5151+7741+30503, 43279+5105] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('darkblue'), + colour.CSS4_COLORS.get('mediumblue'), + colour.CSS4_COLORS.get('blue'), + colour.CSS4_COLORS.get('darkturquoise'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/02 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/ApRE7") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Non-copyrighted image\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/February/CC0.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/February/CC0.png new file mode 100644 index 00000000..10986298 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/February/CC0.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/February/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/February/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/January/At city level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/January/At city level.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/January/At metro level color.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/January/At metro level color.py new file mode 100644 index 00000000..2c698fb9 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/January/At metro level color.py @@ -0,0 +1,67 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2382+118969+70387+4144, 48672+33781+6576, 61256+10843+3623, 4751+7051+27705, 39792+4811] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('cyan'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/01 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/Bjrvq") + +plt.ylim(40000, 190000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC0 Public Domain\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/January/At metro level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/January/At metro level.py new file mode 100644 index 00000000..32e38440 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/January/At metro level.py @@ -0,0 +1,67 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2382+118969+70387+4144, 48672+33781+6576, 61256+10843+3623, 4751+7051+27705, 39792+4811] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'), + colour.CSS4_COLORS.get('darkslateblue'), + colour.CSS4_COLORS.get('mediumpurple'), + colour.CSS4_COLORS.get('rebeccapurple')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/01 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/Bjrvq") + +plt.ylim(40000, 190000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="CC0 Public Domain\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/January/CC-BY.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/January/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/January/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/January/CC0.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/January/CC0.png new file mode 100644 index 00000000..10986298 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/January/CC0.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/January/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/January/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/July/At city level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/July/At city level.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/July/CC0.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/July/CC0.png new file mode 100644 index 00000000..10986298 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/July/CC0.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/July/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/July/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/June/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/June/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/Amended_Sample.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/Amended_Sample.py new file mode 100644 index 00000000..b5fbe160 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/Amended_Sample.py @@ -0,0 +1,52 @@ +import matplotlib.pyplot as plt +import numpy as np + +cmaps = [('Perceptually Uniform Sequential', [ + 'viridis', 'plasma', 'inferno', 'magma', 'cividis']), + ('Sequential', [ + 'Greys', 'Purples', 'Blues', 'Greens', 'Oranges', 'Reds', + 'YlOrBr', 'YlOrRd', 'OrRd', 'PuRd', 'RdPu', 'BuPu', + 'GnBu', 'PuBu', 'YlGnBu', 'PuBuGn', 'BuGn', 'YlGn']), + ('Sequential (2)', [ + 'binary', 'gist_yarg', 'gist_gray', 'gray', 'bone', 'pink', + 'spring', 'summer', 'autumn', 'winter', 'cool', 'Wistia', + 'hot', 'afmhot', 'gist_heat', 'copper']), + ('Diverging', [ + 'PiYG', 'PRGn', 'BrBG', 'PuOr', 'RdGy', 'RdBu', + 'RdYlBu', 'RdYlGn', 'Spectral', 'coolwarm', 'bwr', 'seismic', + 'berlin', 'managua', 'vanimo']), + ('Cyclic', ['twilight', 'twilight_shifted', 'hsv']), + ('Qualitative', [ + 'Pastel1', 'Pastel2', 'Paired', 'Accent', + 'Dark2', 'Set1', 'Set2', 'Set3', + 'tab10', 'tab20', 'tab20b', 'tab20c']), + ('Miscellaneous', [ + 'flag', 'prism', 'ocean', 'gist_earth', 'terrain', 'gist_stern', + 'gnuplot', 'gnuplot2', 'CMRmap', 'cubehelix', 'brg', + 'gist_rainbow', 'rainbow', 'jet', 'turbo', 'nipy_spectral', + 'gist_ncar'])] + +gradient = np.linspace(0, 1, 256) +gradient = np.vstack((gradient, gradient)) + + +def plot_color_gradients(cmap_list): + # Create figure and adjust figure height to number of colormaps + nrows = len(cmap_list) + figh = 0.35 + 0.15 + (nrows + (nrows-1)*0.1)*0.22 + fig, axs = plt.subplots(nrows=nrows, figsize=(6.4, figh)) + fig.subplots_adjust(top=1-.35/figh, bottom=.15/figh, left=0.2, right=0.99) + + for ax, cmap_name in zip(axs, cmap_list): + ax.imshow(gradient, aspect='auto', cmap=cmap_name) + ax.text(-.01, .5, cmap_name, va='center', ha='right', fontsize=10, + transform=ax.transAxes) + + # Turn off *all* ticks & spines, not just the ones with colormaps. + for ax in axs: + ax.set_axis_off() + + + + +# Source: https://matplotlib.org/stable/gallery/color/colormap_reference.html \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At city level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At city level.py new file mode 100644 index 00000000..6d99d01c --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At city level.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [128075, 78000, 53560, 67473, 30503, 43279] + +label = ["啣撣\nTaipei", "啣撣\nNew Taipei", "獢\nTaoyuan", "唬葉\nTaichung", "啣\nTainan", "擃\n Kaohsiung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/2 啁渲撣瑞撩稞n the number of job openings in Taiwan by city", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://archive.ph/ApRE7") + +plt.ylim(30000, 120000) + +img = image.imread('CC0.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Free clip art\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 10.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 10.py new file mode 100644 index 00000000..d953eb38 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 10.py @@ -0,0 +1,92 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import numpy as np +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2619+130037+78967+4367, 54586+36351+7237, 67632+12384+3872, 5138+7802+31252, 43547+5087] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('darkblue'), + colour.CSS4_COLORS.get('mediumblue'), + colour.CSS4_COLORS.get('blue'), + colour.CSS4_COLORS.get('darkturquoise'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/03 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/iEfAC") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Non-copyrighted image\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + + + + +counter = 0 + +for rect in plot: + + if rect is not None: + + counter = counter + 1 + + if counter == 4: + + bar_center = rect.get_x() + rect.get_width() / 2. + bar_height = rect.get_height() + + # Create a gradient image using "winter" colormap + gradient = np.linspace(start=0, stop=1, num=256).reshape(1, -1) # 1 row, 256 columns + + ax.imshow(X=gradient, cmap='winter', extent=(bar_center - 0.01, bar_center + 0.01, 0, bar_height), aspect='auto' ) + + + + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 11.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 11.py new file mode 100644 index 00000000..f3feaa0c --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 11.py @@ -0,0 +1,92 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import numpy as np +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2619+130037+78967+4367, 54586+36351+7237, 67632+12384+3872, 5138+7802+31252, 43547+5087] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('darkblue'), + colour.CSS4_COLORS.get('mediumblue'), + colour.CSS4_COLORS.get('blue'), + colour.CSS4_COLORS.get('darkturquoise'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/03 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/iEfAC") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Non-copyrighted image\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + + +plt.show() + +counter = 0 + +for rect in plot: + + if rect is not None: + + counter = counter + 1 + + if counter == 4: + + bar_center = rect.get_x() + rect.get_width() / 2. + bar_height = rect.get_height() + + # Create a gradient image using "winter" colormap + gradient = np.linspace(start=0, stop=1, num=256).reshape(1, -1) # 1 row, 256 columns + + ax.imshow(X=gradient, cmap='winter', extent=(bar_center - 0.01, bar_center + 0.01, 0, bar_height), aspect='auto' ) + + + + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 12.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 12.py new file mode 100644 index 00000000..39da4790 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 12.py @@ -0,0 +1,92 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import numpy as np +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2619+130037+78967+4367, 54586+36351+7237, 67632+12384+3872, 5138+7802+31252, 43547+5087] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('darkblue'), + colour.CSS4_COLORS.get('mediumblue'), + colour.CSS4_COLORS.get('blue'), + 'none', + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/03 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/iEfAC") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Non-copyrighted image\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + + +plt.show() + +counter = 0 + +for rect in plot: + + if rect is not None: + + counter = counter + 1 + + if counter == 4: + + bar_center = rect.get_x() + rect.get_width() / 2. + bar_height = rect.get_height() + + # Create a gradient image using "winter" colormap + gradient = np.linspace(start=0, stop=1, num=256).reshape(1, -1) # 1 row, 256 columns + + ax.imshow(X=gradient, cmap='winter', extent=(bar_center - 0.01, bar_center + 0.01, 0, bar_height), aspect='auto' ) + + + + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 13.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 13.py new file mode 100644 index 00000000..6302095d --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 13.py @@ -0,0 +1,101 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import numpy as np +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2619+130037+78967+4367, 54586+36351+7237, 67632+12384+3872, 5138+7802+31252, 43547+5087] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('darkblue'), + colour.CSS4_COLORS.get('mediumblue'), + colour.CSS4_COLORS.get('blue'), + 'none', + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/03 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/iEfAC") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Non-copyrighted image\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +cmap = matplotlib.cm.get_cmap('winter') + +counter = 0 + +for rect in plot: + + if rect is not None: + + counter = counter + 1 + + if counter == 4: + + # Bar position and size + x = rect.get_x() + width = rect.get_width() + height = rect.get_height() + + # Create a grid inside the bar + nx = 100 # Number of divisions horizontally + ny = 100 # Number of divisions vertically + X = np.linspace(x, x + width, nx) + Y = np.linspace(0, height, ny) + X, Y = np.meshgrid(X, Y) + + # Color based on horizontal position (left to right) + Z = (X - x) / width # Normalize X inside the bar (0 to 1) + + # Draw gradient + ax.pcolormesh(X, Y, Z, cmap=cmap, shading='auto') + + + + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 14.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 14.py new file mode 100644 index 00000000..528d7f31 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 14.py @@ -0,0 +1,103 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import numpy as np +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2619+130037+78967+4367, 54586+36351+7237, 67632+12384+3872, 5138+7802+31252, 43547+5087] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('darkblue'), + colour.CSS4_COLORS.get('mediumblue'), + colour.CSS4_COLORS.get('blue'), + 'none', + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/03 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/iEfAC") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Non-copyrighted image\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +cmap = matplotlib.colormaps.get_cmap('winter') # [8][9] + +counter = 0 + +for rect in plot: # [8][9] + + if rect is not None: + + counter = counter + 1 + + if counter == 4: + + # Bar position and size + x = rect.get_x() + width = rect.get_width() + height = rect.get_height() + + # Create a grid inside the bar + nx = 100 # Number of divisions horizontally + ny = 100 # Number of divisions vertically + X = np.linspace(x, x + width, nx) + Y = np.linspace(0, height, ny) + X, Y = np.meshgrid(X, Y) + + # Color based on horizontal position (left to right) + Z = (X - x) / width # Normalize X inside the bar (0 to 1) + + # Draw gradient + ax.pcolormesh(X, Y, Z, cmap=cmap, shading='auto') + + + + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ +# 8. https://chatgpt.com/c/680c6f49-95b4-8008-85f4-3941744f62e4 +# 9. Untitled5.ipynb @ my Google Colab. + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 2.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 2.py new file mode 100644 index 00000000..e7adaade --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 2.py @@ -0,0 +1,70 @@ +import Amended_Sample as AS +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2619+130037+78000+4404, 53560+35893+7092, 67473+12257+3859, 5151+7741+30503, 43279+5105] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +cmap = matplotlib.colormaps['winter'] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('darkblue'), + colour.CSS4_COLORS.get('mediumblue'), + colour.CSS4_COLORS.get('blue'), + matplotlib.cm.ScalarMappable(norm=colour.Normalize(vmin=0, vmax=1), cmap='winter'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/03 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/ApRE7") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Non-copyrighted image\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 3.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 3.py new file mode 100644 index 00000000..21f2dde7 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 3.py @@ -0,0 +1,70 @@ +import Amended_Sample as AS +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2619+130037+78000+4404, 53560+35893+7092, 67473+12257+3859, 5151+7741+30503, 43279+5105] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +cmap = matplotlib.colormaps['winter'] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('darkblue'), + colour.CSS4_COLORS.get('mediumblue'), + colour.CSS4_COLORS.get('blue'), + matplotlib.cm.ScalarMappable(norm=colour.Normalize(vmin=0, vmax=1), cmap=cmap), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/03 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/ApRE7") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Non-copyrighted image\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 4.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 4.py new file mode 100644 index 00000000..159a7ce9 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 4.py @@ -0,0 +1,75 @@ +import Amended_Sample as AS +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2619+130037+78000+4404, 53560+35893+7092, 67473+12257+3859, 5151+7741+30503, 43279+5105] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +cmap = matplotlib.colormaps['winter'] + +clist = [(0, "blue"), (0.125, "skyblue"), (0.25, "green"), (0.5, "green"), + (0.7, "green"), (0.75, "green"), (1, "green")] + +rvb = colour.LinearSegmentedColormap.from_list("", clist) + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('darkblue'), + colour.CSS4_COLORS.get('mediumblue'), + colour.CSS4_COLORS.get('blue'), + rvb, + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/03 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/ApRE7") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Non-copyrighted image\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 5.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 5.py new file mode 100644 index 00000000..1e8055fc --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 5.py @@ -0,0 +1,67 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2619+130037+78967+4367, 54586+36351+7237, 67632+12384+3872, 5138+7802+31252, 43547+5087] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('darkblue'), + colour.CSS4_COLORS.get('mediumblue'), + colour.CSS4_COLORS.get('blue'), + matplotlib.colormaps['winter'], + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/03 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/iEfAC") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Non-copyrighted image\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 6.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 6.py new file mode 100644 index 00000000..ac759a61 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 6.py @@ -0,0 +1,70 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import numpy as np +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2619+130037+78967+4367, 54586+36351+7237, 67632+12384+3872, 5138+7802+31252, 43547+5087] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +cmap = plt.get_cmap('winter') + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('darkblue'), + colour.CSS4_COLORS.get('mediumblue'), + colour.CSS4_COLORS.get('blue'), + cmap(np.linspace(0, 1, 200)), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/03 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/iEfAC") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Non-copyrighted image\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 7.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 7.py new file mode 100644 index 00000000..43dab46d --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 7.py @@ -0,0 +1,89 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import numpy as np +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2619+130037+78967+4367, 54586+36351+7237, 67632+12384+3872, 5138+7802+31252, 43547+5087] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('darkblue'), + colour.CSS4_COLORS.get('mediumblue'), + colour.CSS4_COLORS.get('blue'), + colour.CSS4_COLORS.get('darkturquoise'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + + +counter = 0 + +for rect in plot: + + if rect is not None: + + counter = counter + 1 + + if counter == 4: + + bar_width = rect.get_width() + bar_height = rect.get_height() + + # Create a gradient image using "winter" colormap + gradient = np.linspace(start=0, stop=1, num=256).reshape(1, -1) # 1 row, 256 columns + + ax.imshow(X=gradient, cmap='winter', extent=(0 - bar_width/2, 0 + bar_width/2, 0, bar_height), aspect='auto' ) + + + +plt.title("2025/03 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/iEfAC") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Non-copyrighted image\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 8.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 8.py new file mode 100644 index 00000000..302ce2ca --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 8.py @@ -0,0 +1,89 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import numpy as np +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2619+130037+78967+4367, 54586+36351+7237, 67632+12384+3872, 5138+7802+31252, 43547+5087] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('darkblue'), + colour.CSS4_COLORS.get('mediumblue'), + colour.CSS4_COLORS.get('blue'), + colour.CSS4_COLORS.get('darkturquoise'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + + +counter = 0 + +for rect in plot: + + if rect is not None: + + counter = counter + 1 + + if counter == 4: + + bar_width = rect.get_width() + bar_height = position_vacancies[3] + + # Create a gradient image using "winter" colormap + gradient = np.linspace(start=0, stop=1, num=256).reshape(1, -1) # 1 row, 256 columns + + ax.imshow(X=gradient, cmap='winter', extent=(0 - bar_width/2, 0 + bar_width/2, 0, bar_height), aspect='auto' ) + + + +plt.title("2025/03 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/iEfAC") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Non-copyrighted image\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 9.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 9.py new file mode 100644 index 00000000..d0761bbb --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient 9.py @@ -0,0 +1,89 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import numpy as np +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2619+130037+78967+4367, 54586+36351+7237, 67632+12384+3872, 5138+7802+31252, 43547+5087] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('darkblue'), + colour.CSS4_COLORS.get('mediumblue'), + colour.CSS4_COLORS.get('blue'), + colour.CSS4_COLORS.get('darkturquoise'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + + +counter = 0 + +for rect in plot: + + if rect is not None: + + counter = counter + 1 + + if counter == 4: + + bar_center = rect.get_x() + rect.get_width() / 2. + bar_height = rect.get_height() + + # Create a gradient image using "winter" colormap + gradient = np.linspace(start=0, stop=1, num=256).reshape(1, -1) # 1 row, 256 columns + + ax.imshow(X=gradient, cmap='winter', extent=(bar_center - 0.01, bar_center + 0.01, 0, bar_height), aspect='auto' ) + + + +plt.title("2025/03 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/iEfAC") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Non-copyrighted image\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient.py new file mode 100644 index 00000000..04942cf9 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color gradient.py @@ -0,0 +1,70 @@ +import Amended_Sample as AS +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2619+130037+78000+4404, 53560+35893+7092, 67473+12257+3859, 5151+7741+30503, 43279+5105] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +cmap = matplotlib.colormaps['winter'] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('darkblue'), + colour.CSS4_COLORS.get('mediumblue'), + colour.CSS4_COLORS.get('blue'), + matplotlib.cm.get_cmap('winter'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/03 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/ApRE7") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Non-copyrighted image\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color.py new file mode 100644 index 00000000..8f667dfd --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/At metro level color.py @@ -0,0 +1,67 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [2619+130037+78967+4367, 54586+36351+7237, 67632+12384+3872, 5138+7802+31252, 43547+5087] + +label = ["憭批啣 Greater\nTaipei", "獢 Taoyuan\n啁姘 Hsinchu\n Miaoli", "唬葉 Taichung\n敶啣 Changhua\n Nantou", + "脫 Yunlin\n蝢 Chiayi\n啣 Tainan", "擃 Kaohsiung\n撅 Pingtung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('darkblue'), + colour.CSS4_COLORS.get('mediumblue'), + colour.CSS4_COLORS.get('blue'), + colour.CSS4_COLORS.get('darkturquoise'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/03 啁瘣餃瑞撩稞n the number of job openings in Taiwan by metro", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/iEfAC") + +plt.ylim(40000, 200000) + +img = image.imread('CC0.png') # CC0.png downloaded from [7]. + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.6, y=0.7, s="Non-copyrighted image\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html +# 7. https://creativecommons.org/public-domain/cc0/ + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/CC0.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/CC0.png new file mode 100644 index 00000000..10986298 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/CC0.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/Sample.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/Sample.py new file mode 100644 index 00000000..72323bbc --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/Sample.py @@ -0,0 +1,57 @@ +import matplotlib.pyplot as plt +import numpy as np + +cmaps = [('Perceptually Uniform Sequential', [ + 'viridis', 'plasma', 'inferno', 'magma', 'cividis']), + ('Sequential', [ + 'Greys', 'Purples', 'Blues', 'Greens', 'Oranges', 'Reds', + 'YlOrBr', 'YlOrRd', 'OrRd', 'PuRd', 'RdPu', 'BuPu', + 'GnBu', 'PuBu', 'YlGnBu', 'PuBuGn', 'BuGn', 'YlGn']), + ('Sequential (2)', [ + 'binary', 'gist_yarg', 'gist_gray', 'gray', 'bone', 'pink', + 'spring', 'summer', 'autumn', 'winter', 'cool', 'Wistia', + 'hot', 'afmhot', 'gist_heat', 'copper']), + ('Diverging', [ + 'PiYG', 'PRGn', 'BrBG', 'PuOr', 'RdGy', 'RdBu', + 'RdYlBu', 'RdYlGn', 'Spectral', 'coolwarm', 'bwr', 'seismic', + 'berlin', 'managua', 'vanimo']), + ('Cyclic', ['twilight', 'twilight_shifted', 'hsv']), + ('Qualitative', [ + 'Pastel1', 'Pastel2', 'Paired', 'Accent', + 'Dark2', 'Set1', 'Set2', 'Set3', + 'tab10', 'tab20', 'tab20b', 'tab20c']), + ('Miscellaneous', [ + 'flag', 'prism', 'ocean', 'gist_earth', 'terrain', 'gist_stern', + 'gnuplot', 'gnuplot2', 'CMRmap', 'cubehelix', 'brg', + 'gist_rainbow', 'rainbow', 'jet', 'turbo', 'nipy_spectral', + 'gist_ncar'])] + +gradient = np.linspace(0, 1, 256) +gradient = np.vstack((gradient, gradient)) + + +def plot_color_gradients(cmap_category, cmap_list): + # Create figure and adjust figure height to number of colormaps + nrows = len(cmap_list) + figh = 0.35 + 0.15 + (nrows + (nrows-1)*0.1)*0.22 + fig, axs = plt.subplots(nrows=nrows, figsize=(6.4, figh)) + fig.subplots_adjust(top=1-.35/figh, bottom=.15/figh, left=0.2, right=0.99) + + axs[0].set_title(f"{cmap_category} colormaps", fontsize=14) + + for ax, cmap_name in zip(axs, cmap_list): + ax.imshow(gradient, aspect='auto', cmap=cmap_name) + ax.text(-.01, .5, cmap_name, va='center', ha='right', fontsize=10, + transform=ax.transAxes) + + # Turn off *all* ticks & spines, not just the ones with colormaps. + for ax in axs: + ax.set_axis_off() + + +for cmap_category, cmap_list in cmaps: + plot_color_gradients(cmap_category, cmap_list) + + + +# Source: https://matplotlib.org/stable/gallery/color/colormap_reference.html \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/To feed Chat GPT 2.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/To feed Chat GPT 2.py new file mode 100644 index 00000000..160da188 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/To feed Chat GPT 2.py @@ -0,0 +1,31 @@ +import matplotlib.pyplot as plt +import matplotlib.colors as colour + +region_num = [1, 2] +position_vacancies = [120654, 39865] + +label = ["Taipei City", + "Kaohsiung City"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=0, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue'), + colour.CSS4_COLORS.get('slateblue'),]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/02 \n the number of job openings in Taipei & Kaohsiung of Taiwan", fontsize=20) + +# plt.ylabel("") +plt.xlabel("Reference https://archive.ph/LPccQ") + +plt.ylim(30000, 130000) + +plt.show() + diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/To feed Chat GPT.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/To feed Chat GPT.py new file mode 100644 index 00000000..acf246dc --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/To feed Chat GPT.py @@ -0,0 +1,36 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1] +position_vacancies = [39865] + +label = ["擃撣\nKaohsiung City"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='black', color=[colour.CSS4_COLORS.get('mediumslateblue')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2024/02 啁鈭撣瑞撩稞n the number of job openings in Taipei & Kaohsiung of Taiwan", fontsize=20) + +# plt.ylabel("") +plt.xlabel("鞈 Reference https://archive.ph/LPccQ") + +plt.ylim(30000, 130000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/bar color gradient.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/bar color gradient.py new file mode 100644 index 00000000..3e4a5bd1 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/March/bar color gradient.py @@ -0,0 +1,49 @@ +import matplotlib.pyplot as plt +import numpy as np + +def gradient_image(ax, direction=0.3, cmap_range=(0, 1), **kwargs): + """Draw a gradient image based on a colormap.""" + v = np.array([np.cos(direction * np.pi / 2), np.sin(direction * np.pi / 2)]) + X = np.array([[0, 0], [v[0], v[1]]]) + Y = np.array([[0, 0], [-v[1], v[0]]]) + extent = (np.min(X), np.max(X), np.min(Y), np.max(Y)) + + Z = np.empty((100, 100)) + for i in range(100): + for j in range(100): + Z[i, j] = (i/99)*v[0] + (j/99)*v[1] + + img = ax.imshow(Z, extent=extent, aspect='auto', cmap=plt.get_cmap('viridis'), vmin=cmap_range[0], vmax=cmap_range[1], origin='lower', **kwargs) + return img + + + +# Sample data +x = np.arange(5) +y = np.random.rand(5) + +fig, ax = plt.subplots() + +# Create the gradient image +gradient = gradient_image(ax, direction=1) +gradient.set_clip_path(ax.patch) # Clip the gradient to the axes + +# Create bars and set facecolor to "none" to allow gradient visibility +bars = ax.bar(x, y) +for bar in bars: + bar.set_facecolor("none") + xpos = bar.get_x() + width = bar.get_width() + height = bar.get_height() + + # Add a clipped image for each bar + ax.imshow(gradient.get_array(), extent=[xpos, xpos+width, 0, height], aspect='auto', cmap=plt.get_cmap('viridis'), vmin=0, vmax=1, clip_on=True) + +ax.set_xticks(x) +ax.set_xticklabels(['A', 'B', 'C', 'D', 'E']) +ax.set_ylabel('Values') +ax.set_title('Bar Chart with Gradient Colors') + +plt.show() + +# Source: https://www.google.com/search?q=matplotlib+bar+color+gradient \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/May/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/May/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/October/At city level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/October/At city level.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/October/At metro level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/October/At metro level.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/October/CC0.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/October/CC0.png new file mode 100644 index 00000000..10986298 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/October/CC0.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/October/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/October/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/September/At metro level.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/September/At metro level.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/September/At_city_level_h_bar.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/September/At_city_level_h_bar.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/September/CC0.png b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/September/CC0.png new file mode 100644 index 00000000..10986298 Binary files /dev/null and b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/September/CC0.png differ diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/September/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/September/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/2025/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/April2014_metro.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/April2014_metro.py new file mode 100644 index 00000000..f35a5d41 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/April2014_metro.py @@ -0,0 +1,27 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [96973, 39547, 26732+5221+1628, 1797+2514+11186, 15584+1740] + +label = ["Greater Taipei", "Taoyuan\nHsinchu\nMiaoli", "Taichung\nChanghua\nNantou", + "Yunlin\nChiayi\nTainan", "Kaohsiung\nPingtung"] + +fig, ax = plt.subplots(figsize=(9, 8)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2014/04 the number of job openings in Taiwan by metro") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20140403201635/http://www.104.com.tw:80/jb/category/?cat=2") + +plt.ylim(10000, 100000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/August2014_metro.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/August2014_metro.py new file mode 100644 index 00000000..9e3eef2a --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/August2014_metro.py @@ -0,0 +1,27 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [102374, 41655, 27355+5579+1760, 1829+2691+11944, 16107+1852] + +label = ["Greater Taipei", "Taoyuan\nHsinchu\nMiaoli", "Taichung\nChanghua\nNantou", + "Yunlin\nChiayi\nTainan", "Kaohsiung\nPingtung"] + +fig, ax = plt.subplots(figsize=(9, 8)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2014/08 the number of job openings in Taiwan by metro") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20140803070255/http://www.104.com.tw:80/jb/category/?cat=2") + +plt.ylim(10000, 100000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/December2021.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/December2021.py new file mode 100644 index 00000000..21a2a185 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/December2021.py @@ -0,0 +1,26 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5, 6, 7] +position_vacancies = [93322, 53419, 39619, 31983, 51453, 23935, 29993] + +label = ["Taipei", "New Taipei", "Taoyuan", "Hsinchu", "Taichung", "Tainan", "Kaohsiung"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/12 the number of job openings in Taiwan by region") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20211231064231/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(20000, 90000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/December2021_metro.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/December2021_metro.py new file mode 100644 index 00000000..c44254e0 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/December2021_metro.py @@ -0,0 +1,27 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [151771, 77456, 64269, 33182, 33945] + +label = ["Greater Taipei", "Taoyuan\nHsinchu\nMiaoli", "Taichung\nChanghua\nNantou", + "Yunlin\nChiayi\nTainan", "Kaohsiung\nPingtung"] + +fig, ax = plt.subplots(figsize=(9, 8)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/12 the number of job openings in Taiwan by metro") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20211231064231/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(30000, 150000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/February2022.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/February2022.py new file mode 100644 index 00000000..b5999e94 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/February2022.py @@ -0,0 +1,26 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5, 6, 7] +position_vacancies = [105740, 61783, 44534, 35054, 59418, 27771, 34083] + +label = ["Taipei", "New Taipei", "Taoyuan", "Hsinchu", "Taichung", "Tainan", "Kaohsiung"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2022/02 the number of job openings in Taiwan by region") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20220226163214/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(27500, 100500) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/February2022_metro.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/February2022_metro.py new file mode 100644 index 00000000..cba4b80a --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/February2022_metro.py @@ -0,0 +1,27 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [173152, 86229, 74105, 38453, 38373] + +label = ["Greater Taipei", "Taoyuan\nHsinchu\nMiaoli", "Taichung\nChanghua\nNantou", + "Yunlin\nChiayi\nTainan", "Kaohsiung\nPingtung"] + +fig, ax = plt.subplots(figsize=(9, 8)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2022/02 the number of job openings in Taiwan by metro") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20220226163214/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(30000, 160000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/January2022.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/January2022.py new file mode 100644 index 00000000..a656a2fd --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/January2022.py @@ -0,0 +1,26 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5, 6, 7] +position_vacancies = [94107, 52597, 38864, 32089, 50772, 23918, 30356] + +label = ["Taipei", "New Taipei", "Taoyuan", "Hsinchu", "Taichung", "Tainan", "Kaohsiung"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2022/01 the number of job openings in Taiwan by region") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20220130184455/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(20000, 90000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/January2022_metro.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/January2022_metro.py new file mode 100644 index 00000000..db176ef7 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/January2022_metro.py @@ -0,0 +1,27 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [151796, 77042, 63362, 32980, 34233] + +label = ["Greater Taipei", "Taoyuan\nHsinchu\nMiaoli", "Taichung\nChanghua\nNantou", + "Yunlin\nChiayi\nTainan", "Kaohsiung\nPingtung"] + +fig, ax = plt.subplots(figsize=(9, 8)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2022/01 the number of job openings in Taiwan by metro") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20220130184455/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(30000, 150000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/July2014_metro.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/July2014_metro.py new file mode 100644 index 00000000..dfc744b6 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/July2014_metro.py @@ -0,0 +1,27 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [103968, 42281, 28171+5630+1821, 1903+2806+12377, 16746+1861] + +label = ["Greater Taipei", "Taoyuan\nHsinchu\nMiaoli", "Taichung\nChanghua\nNantou", + "Yunlin\nChiayi\nTainan", "Kaohsiung\nPingtung"] + +fig, ax = plt.subplots(figsize=(9, 8)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2014/07 the number of job openings in Taiwan by metro") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20140702121714/http://www.104.com.tw:80/jb/category/?cat=2") + +plt.ylim(10000, 100000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/March2022.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/March2022.py new file mode 100644 index 00000000..4970d27a --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/March2022.py @@ -0,0 +1,26 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [109262, 63982, 46161, 61036, 28391, 35120] + +label = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2022/03 the number of job openings in Taiwan by region") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20220327070711/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(20000, 100000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/March2022_ZH.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/March2022_ZH.py new file mode 100644 index 00000000..b70699f7 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/March2022_ZH.py @@ -0,0 +1,31 @@ +import matplotlib +import matplotlib.pyplot as plt +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") # [1] + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [109262, 63982, 46161, 61036, 28391, 35120] + +label = ["啣", "啣", "獢", "唬葉", "啣", "擃"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2022/03 啁啣瑞撩貊絞閮\nthe number of job openings in Taiwan by region", fontproperties="MS Gothic") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20220327070711/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(20000, 100000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/March2022_metro.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/March2022_metro.py new file mode 100644 index 00000000..2a2d4c4d --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/March2022_metro.py @@ -0,0 +1,27 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [178995, 88885, 76159, 39243, 39416] + +label = ["Greater Taipei", "Taoyuan\nHsinchu\nMiaoli", "Taichung\nChanghua\nNantou", + "Yunlin\nChiayi\nTainan", "Kaohsiung\nPingtung"] + +fig, ax = plt.subplots(figsize=(9, 8)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2022/03 the number of job openings in Taiwan by metro") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20220327070711/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(35000, 165000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/May2014_metro.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/May2014_metro.py new file mode 100644 index 00000000..fb2366a3 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/May2014_metro.py @@ -0,0 +1,27 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [102089, 41530, 27916+5399+1760, 1895+2715+12282, 16930+1882] + +label = ["Greater Taipei", "Taoyuan\nHsinchu\nMiaoli", "Taichung\nChanghua\nNantou", + "Yunlin\nChiayi\nTainan", "Kaohsiung\nPingtung"] + +fig, ax = plt.subplots(figsize=(9, 8)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2014/05 the number of job openings in Taiwan by metro") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20140528071247/http://www.104.com.tw:80/jb/category/?cat=2") + +plt.ylim(10000, 100000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021.py new file mode 100644 index 00000000..171a9e9a --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021.py @@ -0,0 +1,26 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5, 6, 7] +position_vacancies = [92415, 53496, 39357, 31572, 51570, 23956, 29969] + +label = ["Taipei", "New Taipei", "Taoyuan", "Hsinchu", "Taichung", "Tainan", "Kaohsiung"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/11 the number of job openings in Taiwan by region") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20211128163303/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(20000, 90000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_+3.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_+3.py new file mode 100644 index 00000000..b9aba081 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_+3.py @@ -0,0 +1,26 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] +position_vacancies = [92415, 53496, 39357, 31572, 5843, 51570, 9722, 23956, 29969, 3826] + +label = ["Taipei", "New Taipei", "Taoyuan", "Hsinchu", "Miaoli", "Taichung", "Changhua", "Tainan", "Kaohsiung", "Pingtung"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=20) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/11 the number of job openings in Taiwan by region") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20211128163303/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(3000, 90000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_+3_order.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_+3_order.py new file mode 100644 index 00000000..5c3a80ef --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_+3_order.py @@ -0,0 +1,26 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] +position_vacancies = [92415, 53496, 39357, 31572, 51570, 9722, 23956, 29969, 5843, 9722, 3826] + +label = ["Taipei", "New Taipei", "Taoyuan", "Hsinchu", "Taichung", "Tainan", "Kaohsiung", "Miaoli", "Changhua", "Pingtung"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=20) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/11 the number of job openings in Taiwan by region") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20211128163303/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(3000, 90000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_ZH.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_ZH.py new file mode 100644 index 00000000..6222de7f --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_ZH.py @@ -0,0 +1,34 @@ +import matplotlib.pyplot as plt +# Using the magic encoding +# -*- coding: utf-8 -*- + +font = {'family': 'MS Gothic', + 'color': 'darkred', + 'weight': 'normal', + 'size': 16, + } + +region_num = [1, 2, 3, 4, 5, 6, 7] +position_vacancies = [92415, 53496, 39357, 31572, 51570, 23956, 29969] + +label = ["啣", "啣", "獢", "啁姘", "唬葉", "啣", "擃"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/11 啁啣瑞撩貊絞閮\nthe number of job openings in Taiwan by region", fontproperties="MS Gothic") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20211128163303/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(20000, 90000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_ZH_2.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_ZH_2.py new file mode 100644 index 00000000..b9273bec --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_ZH_2.py @@ -0,0 +1,34 @@ +import matplotlib +import matplotlib.pyplot as plt +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") # [1] + +region_num = [1, 2, 3, 4, 5, 6, 7] +position_vacancies = [92415, 53496, 39357, 31572, 51570, 23956, 29969] + +label = ["啣", "啣", "獢", "啁姘", "唬葉", "啣", "擃"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/11 啁啣瑞撩貊絞閮\nthe number of job openings in Taiwan by region", fontproperties="MS Gothic") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20211128163303/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(20000, 90000) + +plt.show() + +# Reference: +# 1. https://stackoverflow.com/questions/10960463/non-ascii-characters-in-matplotlib diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_ZH_JP.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_ZH_JP.py new file mode 100644 index 00000000..8d866fb3 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_ZH_JP.py @@ -0,0 +1,36 @@ +import matplotlib +import matplotlib.pyplot as plt +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") # [1] + +region_num = [1, 2, 3, 4, 5, 6, 7] +position_vacancies = [92415, 53496, 39357, 31572, 51570, 23956, 29969] + +label = ["啣", "啣", "獢", "啁姘", "唬葉", "啣", "擃"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/11 啁啣瑞撩貊絞閮\nthe number of job openings in Taiwan by region", fontproperties="MS Gothic") + +# plt.ylabel("") +plt.xlabel("&箏: https://web.archive.org/web/20211128163303/https://www.104.com.tw/jb/category/?cat=2") # [2][3] + +plt.ylim(20000, 90000) + +plt.show() + +# Reference: +# 1. https://stackoverflow.com/questions/10960463/non-ascii-characters-in-matplotlib +# 2. Google Translate +# 3. https://ja.wikipedia.org/wiki/擃撣#箏 diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_ZH_JP_EN.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_ZH_JP_EN.py new file mode 100644 index 00000000..dc752fc8 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_ZH_JP_EN.py @@ -0,0 +1,36 @@ +import matplotlib +import matplotlib.pyplot as plt +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") # [1] + +region_num = [1, 2, 3, 4, 5, 6, 7] +position_vacancies = [92415, 53496, 39357, 31572, 51570, 23956, 29969] + +label = ["啣\nTaipei", "啣\nNew Taipei", "獢\nTaoyuan", "啁姘\nHsinchu", "唬葉\nTaichung", "啣\nTainan", "擃\nKaohsiung"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/11 啁啣瑞撩貊絞閮\nthe number of job openings in Taiwan by region", fontproperties="MS Gothic") + +# plt.ylabel("") +plt.xlabel("Source&&箏: https://web.archive.org/web/20211128163303/https://www.104.com.tw/jb/category/?cat=2") # [2][3] + +plt.ylim(20000, 90000) + +plt.show() + +# Reference: +# 1. https://stackoverflow.com/questions/10960463/non-ascii-characters-in-matplotlib +# 2. Google Translate +# 3. https://ja.wikipedia.org/wiki/擃撣#箏 diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_metro.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_metro.py new file mode 100644 index 00000000..66cbf201 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_metro.py @@ -0,0 +1,27 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [150860, 76772, 64285, 32988, 33795, 3161] + +label = ["Greater Taipei", "Taoyuan\nHsinchu\nMiaoli", "Taichung\nChanghua\nNantou", + "Yunlin\nChiayi\nTainan", "Kaohsiung\nPingtung", "others"] + +fig, ax = plt.subplots(figsize=(9, 8)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/11 the number of job openings in Taiwan by metro") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20211128163303/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(30000, 150000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_metro_.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_metro_.py new file mode 100644 index 00000000..c1e61f01 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/November2021_metro_.py @@ -0,0 +1,27 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [150860, 76772, 64285, 32988, 33795] + +label = ["Greater Taipei", "Taoyuan\nHsinchu\nMiaoli", "Taichung\nChanghua\nNantou", + "Yunlin\nChiayi\nTainan", "Kaohsiung\nPingtung"] + +fig, ax = plt.subplots(figsize=(9, 8)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/11 the number of job openings in Taiwan by metro") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20211128163303/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(30000, 150000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/October2021.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/October2021.py new file mode 100644 index 00000000..3d3a3c36 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/October2021.py @@ -0,0 +1,26 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5, 6, 7] +position_vacancies = [89351, 52065, 38298, 30692, 50527, 23497, 28960] + +label = ["Taipei", "New Taipei", "Taoyuan", "Hsinchu", "Taichung", "Tainan", "Kaohsiung"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/10 the number of job openings in Taiwan by region") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20211023110903/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(20000, 90000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/October2021_ZH_JP.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/October2021_ZH_JP.py new file mode 100644 index 00000000..d083f7cb --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/October2021_ZH_JP.py @@ -0,0 +1,32 @@ +import matplotlib +import matplotlib.pyplot as plt + +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6, 7] +position_vacancies = [89351, 52065, 38298, 30692, 50527, 23497, 28960] + +label = ["啣", "啣", "獢", "啁姘", "唬葉", "啣", "擃"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/10 啁啣瑞撩貊絞閮\nthe number of job openings in Taiwan by region") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20211023110903/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(20000, 90000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/October2021_metro.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/October2021_metro.py new file mode 100644 index 00000000..04eff6fc --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/October2021_metro.py @@ -0,0 +1,27 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [146114, 74826, 63052, 32115, 32609] + +label = ["Greater Taipei", "Taoyuan\nHsinchu\nMiaoli", "Taichung\nChanghua\nNantou", + "Yunlin\nChiayi\nTainan", "Kaohsiung\nPingtung"] + +fig, ax = plt.subplots(figsize=(9, 8)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/10 the number of job openings in Taiwan by metro") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20211023110903/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(30000, 140000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2014.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2014.py new file mode 100644 index 00000000..4e1dbe66 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2014.py @@ -0,0 +1,26 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5, 6, 7] +position_vacancies = [66549, 34819, 21948, 17828, 27710, 12300, 16584] + +label = ["Taipei", "New Taipei", "Taoyuan", "Hsinchu", "Taichung", "Tainan", "Kaohsiung"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2014/09 the number of job openings in Taiwan by region") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20140903150508/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(10000, 70000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2014_ZH_JP.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2014_ZH_JP.py new file mode 100644 index 00000000..47dbead9 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2014_ZH_JP.py @@ -0,0 +1,31 @@ +import matplotlib +import matplotlib.pyplot as plt +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6, 7] +position_vacancies = [66549, 34819, 21948, 17828, 27710, 12300, 16584] + +label = ["啣", "啣", "獢", "啁姘", "唬葉", "啣", "擃"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2014/09 啁啣瑞撩貊絞閮\nthe number of job openings in Taiwan by region") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20140903150508/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(10000, 70000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2014_metro.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2014_metro.py new file mode 100644 index 00000000..53536505 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2014_metro.py @@ -0,0 +1,27 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [104132, 42632, 27710+5539+1697, 1856+2674+12300, 16584+1827] + +label = ["Greater Taipei", "Taoyuan\nHsinchu\nMiaoli", "Taichung\nChanghua\nNantou", + "Yunlin\nChiayi\nTainan", "Kaohsiung\nPingtung"] + +fig, ax = plt.subplots(figsize=(9, 8)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2014/09 the number of job openings in Taiwan by metro") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20140903150508/http://www.104.com.tw:80/jb/category/?cat=2") + +plt.ylim(10000, 100000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2021.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2021.py new file mode 100644 index 00000000..935f4f05 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2021.py @@ -0,0 +1,28 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] +position_vacancies = [85928, 50512, 37109, 29894, 5718, 48837, 9500, + 3477, 4956, 22775, 27978, 3462] + +label = ["Taipei", "New Taipei", "Taoyuan", "Hsinchu", "Miaoli", "Taichung", "Changhua", + "Yunlin", "Chiayi", "Tainan", "Kaohsiung", "Pingtung"] + +fig, ax = plt.subplots(figsize=(10, 9)) # [1] +plt.xticks(region_num, labels=label, rotation=47) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/09 the number of job openings in Taiwan by region") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20210927094609/https://www.104.com.tw/jb/category/?cat=2") + +# plt.ylim(280, 560) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2021_2.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2021_2.py new file mode 100644 index 00000000..ed38ed71 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2021_2.py @@ -0,0 +1,26 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5, 6, 7] +position_vacancies = [85928, 50512, 37109, 29894, 48837, 22775, 27978] + +label = ["Taipei", "New Taipei", "Taoyuan", "Hsinchu", "Taichung", "Tainan", "Kaohsiung"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/09 the number of job openings in Taiwan by region") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20210927094609/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(10000, 90000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2021_3.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2021_3.py new file mode 100644 index 00000000..a619c21a --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2021_3.py @@ -0,0 +1,29 @@ +import matplotlib.pyplot as plt +import seaborn as sns + +region_num = [1, 2, 3, 4, 5, 6, 7] +position_vacancies = [85928, 50512, 37109, 29894, 48837, 22775, 27978] + +label = ["Taipei", "New Taipei", "Taoyuan", "Hsinchu", "Taichung", "Tainan", "Kaohsiung"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/09 the number of job openings in Taiwan by region") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20210927094609/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(10000, 90000) + +sns.displot() + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2021_ZH_JP.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2021_ZH_JP.py new file mode 100644 index 00000000..c5acded2 --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2021_ZH_JP.py @@ -0,0 +1,31 @@ +import matplotlib +import matplotlib.pyplot as plt +# Using the magic encoding +# -*- coding: utf-8 -*- + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6, 7] +position_vacancies = [85928, 50512, 37109, 29894, 48837, 22775, 27978] + +label = ["啣", "啣", "獢", "啁姘", "唬葉", "啣", "擃"] + +fig, ax = plt.subplots(figsize=(8, 7)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/09 啁啣瑞撩貊絞閮\nthe number of job openings in Taiwan by region") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20210927094609/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(10000, 90000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2021_metro.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2021_metro.py new file mode 100644 index 00000000..6813e1fa --- /dev/null +++ b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/September2021_metro.py @@ -0,0 +1,27 @@ +import matplotlib.pyplot as plt + +region_num = [1, 2, 3, 4, 5] +position_vacancies = [140966, 72721, 61138, 31208, 31440] + +label = ["Greater Taipei", "Taoyuan\nHsinchu\nMiaoli", "Taichung\nChanghua\nNantou", + "Yunlin\nChiayi\nTainan", "Kaohsiung\nPingtung"] + +fig, ax = plt.subplots(figsize=(9, 8)) +plt.xticks(region_num, labels=label, rotation=7) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) + +plot = ax.bar(region_num, position_vacancies) + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom') + +plt.title("2021/09 the number of job openings in Taiwan by metro") + +# plt.ylabel("") +plt.xlabel("Reference: https://web.archive.org/web/20210927094609/https://www.104.com.tw/jb/category/?cat=2") + +plt.ylim(30000, 130000) + +plt.show() diff --git a/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/__init__.py b/The attainments and realizations of my dreams/Monthly_total_job_openings_by_region/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Population_composition.py b/The attainments and realizations of my dreams/Population_composition.py new file mode 100644 index 00000000..621365aa --- /dev/null +++ b/The attainments and realizations of my dreams/Population_composition.py @@ -0,0 +1,97 @@ +import matplotlib.pyplot as plt +import numpy as np + +year = ["2010", "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +date = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] + +figure, axes = plt.subplots() + +# Stacked bars can be achieved by passing individual bottom values per bar.[1] +axes.bar(year, southTW, label='South Taiwan', ) +axes.bar(year, centralTW, label='Central Taiwan', bottom=southTW) +axes.bar(year, northTW, label='Northern Taiwan', bottom=southTW+centralTW) + +axes.set_ylabel('Population') +axes.set_xlabel('Year') +axes.set_title("The composition of Taiwan's population \n" + "has changed dramatically over the past 20 years.") + +axes.legend() + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.bar.html diff --git a/The attainments and realizations of my dreams/Population_composition_.py b/The attainments and realizations of my dreams/Population_composition_.py new file mode 100644 index 00000000..48b8927a --- /dev/null +++ b/The attainments and realizations of my dreams/Population_composition_.py @@ -0,0 +1,97 @@ +import matplotlib.pyplot as plt +import numpy as np + +year = ["2010", "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +date = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +plt.bar(year, south, color='g', label="South Taiwan") +plt.bar(year, central, color='y', bottom=south, label="Central Taiwan") +plt.bar(year, north, color='b', bottom=south + central, label="North Taiwan") +plt.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan") +plt.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands") + +plt.xlabel('Year') +plt.ylabel('Population') +plt.title("The composition of Taiwan's population") +plt.legend() +plt.show() + diff --git a/The attainments and realizations of my dreams/Population_composition_1.py b/The attainments and realizations of my dreams/Population_composition_1.py new file mode 100644 index 00000000..5a5aab5f --- /dev/null +++ b/The attainments and realizations of my dreams/Population_composition_1.py @@ -0,0 +1,104 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np + +year = ["2010", "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +date = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +plt.bar(year, south, color='g', label="South Taiwan") +plt.bar(year, central, color='y', bottom=south, label="Central Taiwan") +plt.bar(year, north, color='b', bottom=south + central, label="North Taiwan") +plt.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan") +plt.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands") + +# get the current axes and store it to ax +axes = plt.gca() + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population") +plt.legend() +plt.show() + diff --git a/The attainments and realizations of my dreams/Population_composition_2.py b/The attainments and realizations of my dreams/Population_composition_2.py new file mode 100644 index 00000000..cb81e808 --- /dev/null +++ b/The attainments and realizations of my dreams/Population_composition_2.py @@ -0,0 +1,92 @@ +import matplotlib.pyplot as plt + +year = ["2010", "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +date = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] + +figure, axes = plt.subplots() + +axes.hist(x=[northTW, centralTW, southTW, eastTW, outlyingTW], bins=12, density=True, stacked=True, + histtype='barstacked') + +axes.set_ylabel('Population') +axes.set_xlabel('Year') +axes.set_title("The composition of Taiwan's population \n" + "has changed dramatically over the past 20 years.") + +axes.legend() + +figure.tight_layout() +plt.show() diff --git a/The attainments and realizations of my dreams/Population_composition_in_history.py b/The attainments and realizations of my dreams/Population_composition_in_history.py new file mode 100644 index 00000000..79615fff --- /dev/null +++ b/The attainments and realizations of my dreams/Population_composition_in_history.py @@ -0,0 +1,140 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np + +year = ["1960", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +date = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +plt.bar(year, south, color='g', label="South Taiwan") +plt.bar(year, central, color='y', bottom=south, label="Central Taiwan") +plt.bar(year, north, color='b', bottom=south + central, label="North Taiwan") +plt.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan") +plt.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands") + +# get the current axes and store it to ax +axes = plt.gca() + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +cm = 1/2.54 # centimeters in inches.[2] + +# Change the figure size.[1] +plt.figure(figsize=(18*cm, 8*cm)) + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/24073700/14900011 +# 2. https://matplotlib.org/devdocs/gallery/subplots_axes_and_figures/figure_size_units.html diff --git a/The attainments and realizations of my dreams/Population_composition_in_history2.py b/The attainments and realizations of my dreams/Population_composition_in_history2.py new file mode 100644 index 00000000..be0551ae --- /dev/null +++ b/The attainments and realizations of my dreams/Population_composition_in_history2.py @@ -0,0 +1,142 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np + +year = ["1960", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +date = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +cm = 1/2.54 + +figure, axes = plt.subplots(figsize=(18*cm, 8*cm)) + +p1 = axes.bar(year, south, color='g', label="South Taiwan") +p2 = axes.bar(year, central, color='y', bottom=south, label="Central Taiwan") +p3 = axes.bar(year, north, color='b', bottom=south + central, label="North Taiwan") +p4 = axes.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan") +p5 = axes.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands") + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +# Label with label_type 'center' instead of the default 'edge' +axes.bar_label(p1, label_type='center') +axes.bar_label(p2, label_type='center') +axes.bar_label(p3, label_type='center') +axes.bar_label(p2) + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/24073700/14900011 +# 2. https://matplotlib.org/devdocs/gallery/subplots_axes_and_figures/figure_size_units.html diff --git a/The attainments and realizations of my dreams/Population_composition_in_history3.py b/The attainments and realizations of my dreams/Population_composition_in_history3.py new file mode 100644 index 00000000..d5de3833 --- /dev/null +++ b/The attainments and realizations of my dreams/Population_composition_in_history3.py @@ -0,0 +1,144 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np + +year = ["1960", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +date = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +p1 = plt.bar(year, south, color='g', label="South Taiwan") +p2 = plt.bar(year, central, color='y', bottom=south, label="Central Taiwan") +p3 = plt.bar(year, north, color='b', bottom=south + central, label="North Taiwan") +p4 = plt.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan") +p5 = plt.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands") + +# get the current axes and store it to ax +axes = plt.gca() + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +cm = 1/2.54 # centimeters in inches.[2] + +# Change the figure size.[1] +plt.figure(figsize=(18*cm, 8*cm)) + +plt.bar_label(container=p1, fmt='%.2f', label_type='center') +plt.bar_label(container=p2, fmt='%.2f', label_type='center') +plt.bar_label(container=p3, fmt='%.2f', label_type='center') + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/24073700/14900011 +# 2. https://matplotlib.org/devdocs/gallery/subplots_axes_and_figures/figure_size_units.html diff --git a/The attainments and realizations of my dreams/Population_composition_in_history4.py b/The attainments and realizations of my dreams/Population_composition_in_history4.py new file mode 100644 index 00000000..947f122d --- /dev/null +++ b/The attainments and realizations of my dreams/Population_composition_in_history4.py @@ -0,0 +1,139 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np + +year = ["1960", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +date = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +cm = 1/2.54 +figure, axes = plt.subplots(figsize=(18*cm, 8*cm)) + +p1 = axes.bar(year, south, color='g', label="South Taiwan") +p2 = axes.bar(year, central, color='y', bottom=south, label="Central Taiwan") +p3 = axes.bar(year, north, color='b', bottom=south + central, label="North Taiwan") +p4 = axes.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan") +p5 = axes.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands") + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +axes.bar_label(container=p1, fmt='{:.2f}'.format(p1), label_type='center') +axes.bar_label(container=p2, fmt='{:.2f}'.format(p2), label_type='center') +axes.bar_label(container=p3, fmt='{:.2f}'.format(p3), label_type='center') + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/24073700/14900011 +# 2. https://matplotlib.org/devdocs/gallery/subplots_axes_and_figures/figure_size_units.html diff --git a/The attainments and realizations of my dreams/Population_composition_in_history5.py b/The attainments and realizations of my dreams/Population_composition_in_history5.py new file mode 100644 index 00000000..0145239f --- /dev/null +++ b/The attainments and realizations of my dreams/Population_composition_in_history5.py @@ -0,0 +1,148 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np + +year = ["1960", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +date = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +print(south) +print(central) +print(north) +print(east) +print(outlying) + +total = [i for i in range(0, len(south, central, north, east, outlying)) in south, central, north, east, outlying]: + + +cm = 1/2.54 +figure, axes = plt.subplots(figsize=(18*cm, 12*cm)) + +p1 = axes.bar(year, south, color='g', label="South Taiwan") +p2 = axes.bar(year, central, color='y', bottom=south, label="Central Taiwan") +p3 = axes.bar(year, north, color='b', bottom=south + central, label="North Taiwan") +p4 = axes.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan") +p5 = axes.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands") + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +axes.bar_label(container=p1, fmt='{:.2f}'.format(p1), label_type='center') +axes.bar_label(container=p2, fmt='{:.2f}'.format(p2), label_type='center') +axes.bar_label(container=p3, fmt='{:.2f}'.format(p3), label_type='center') + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/24073700/14900011 +# 2. https://matplotlib.org/devdocs/gallery/subplots_axes_and_figures/figure_size_units.html diff --git a/The attainments and realizations of my dreams/Population_composition_in_history6.py b/The attainments and realizations of my dreams/Population_composition_in_history6.py new file mode 100644 index 00000000..ad5673be --- /dev/null +++ b/The attainments and realizations of my dreams/Population_composition_in_history6.py @@ -0,0 +1,156 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np + +year = ["1960", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +date = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +print(south) +print(central) +print(north) +print(east) +print(outlying) + +Total1960 = south[0] + central[0] + north[0] + east[0] + outlying[0] +Total1970 = south[1] + central[1] + north[1] + east[1] + outlying[1] +Total1980 = south[2] + central[2] + north[2] + east[2] + outlying[2] +Total1990 = south[3] + central[3] + north[3] + east[3] + outlying[3] +Total2000 = south[4] + central[4] + north[4] + east[4] + outlying[4] +Total2010 = south[5] + central[5] + north[5] + east[5] + outlying[5] +Total2015 = south[10] + central[10] + north[10] + east[10] + outlying[10] +Total2020 = south[15] + central[15] + north[15] + east[15] + outlying[15] +Total2021 = south[16] + central[16] + north[16] + east[16] + outlying[16] + +totality = [Total1960, Total1970, Total1980, Total1990, Total2000, Total2010, Total2020, Total2021] + +print(totality) + +cm = 1/2.54 +figure, axes = plt.subplots(figsize=(18*cm, 15*cm)) + +p1 = axes.bar(year, south, color='g', label="South Taiwan") +p2 = axes.bar(year, central, color='y', bottom=south, label="Central Taiwan") +p3 = axes.bar(year, north, color='b', bottom=south + central, label="North Taiwan") +p4 = axes.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan") +p5 = axes.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands") + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +axes.bar_label(container=p1, fmt='{:.2f}'.format(p1), label_type='center') +axes.bar_label(container=p2, fmt='{:.2f}'.format(p2), label_type='center') +axes.bar_label(container=p3, fmt='{:.2f}'.format(p3), label_type='center') + +plt.show() + diff --git a/The attainments and realizations of my dreams/Population_composition_in_history_1.py b/The attainments and realizations of my dreams/Population_composition_in_history_1.py new file mode 100644 index 00000000..dde5c237 --- /dev/null +++ b/The attainments and realizations of my dreams/Population_composition_in_history_1.py @@ -0,0 +1,140 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np + +year = ["1960", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +date = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +plt.bar(year, south, color='g', label="South Taiwan") +plt.bar(year, central, color='y', bottom=south, label="Central Taiwan") +plt.bar(year, north, color='b', bottom=south + central, label="North Taiwan") +plt.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan") +plt.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands") + +# get the current axes and store it to ax +axes = plt.gca() + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +cm = 1/2.54 # centimeters in inches.[2] + +# Change the figure size.[1] +plt.figure(figsize=(28*cm, 15*cm)) + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/24073700/14900011 +# 2. https://matplotlib.org/devdocs/gallery/subplots_axes_and_figures/figure_size_units.html diff --git a/The attainments and realizations of my dreams/Population_composition_in_history_2.py b/The attainments and realizations of my dreams/Population_composition_in_history_2.py new file mode 100644 index 00000000..49585e71 --- /dev/null +++ b/The attainments and realizations of my dreams/Population_composition_in_history_2.py @@ -0,0 +1,141 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np + +year = ["1960", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +date = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + + +cm = 1/2.54 # centimeters in inches.[2] + +# Change the figure size.[1] +plt.figure(figsize=(28*cm, 15*cm)) + +plt.bar(year, south, color='g', label="South Taiwan") +plt.bar(year, central, color='y', bottom=south, label="Central Taiwan") +plt.bar(year, north, color='b', bottom=south + central, label="North Taiwan") +plt.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan") +plt.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands") + +# get the current axes and store it to ax +axes = plt.gca() + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/24073700/14900011 +# 2. https://matplotlib.org/devdocs/gallery/subplots_axes_and_figures/figure_size_units.html diff --git a/The attainments and realizations of my dreams/Population_composition_in_history_3.py b/The attainments and realizations of my dreams/Population_composition_in_history_3.py new file mode 100644 index 00000000..b1af5236 --- /dev/null +++ b/The attainments and realizations of my dreams/Population_composition_in_history_3.py @@ -0,0 +1,139 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np + +year = ["1960", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +date = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + + +cm = 1/2.54 + +plt.figure(figsize=(28*cm, 15*cm)) + +plt.bar(year, south, color='g', label="South Taiwan", align='edge', width=0.3) # Adjusting the spacing between bars. [1] +plt.bar(year, central, color='y', bottom=south, label="Central Taiwan", align='edge', width=0.3) +plt.bar(year, north, color='b', bottom=south + central, label="North Taiwan", align='edge', width=0.3) +plt.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan", align='edge', width=0.3) +plt.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands", align='edge', width=0.3) + +# get the current axes and store it to ax +axes = plt.gca() + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/40575741/14900011 diff --git a/The attainments and realizations of my dreams/Population_composition_in_history_4.py b/The attainments and realizations of my dreams/Population_composition_in_history_4.py new file mode 100644 index 00000000..c6abcc86 --- /dev/null +++ b/The attainments and realizations of my dreams/Population_composition_in_history_4.py @@ -0,0 +1,150 @@ +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +date = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] + +south = np.array(southTW) +central = np.array(centralTW) +north = np.array(northTW) +east = np.array(eastTW) +outlying = np.array(outlyingTW) + +cm = 1 / 2.54 + +plt.figure(figsize=(28 * cm, 15 * cm)) + +plt.bar(year, south, color='g', label="South Taiwan", align='edge', + width=0.3) # Adjusting the spacing between bars. [1] +plt.bar(year, central, color='y', bottom=south, label="Central Taiwan", align='edge', width=0.3) +plt.bar(year, north, color='b', bottom=south + central, label="North Taiwan", align='edge', width=0.3) +plt.bar(year, east, color='r', bottom=south + central + north, label="Eastern Taiwan", align='edge', width=0.3) +plt.bar(year, outlying, color='k', bottom=south + central + north + east, label="Outlying Islands", align='edge', + width=0.3) + +# get the current axes and store it to ax +axes = plt.gca() + +axes.yaxis.set_major_locator(ticker.MultipleLocator(5000000)) +axes.yaxis.set_minor_locator(ticker.MultipleLocator(1000000)) + +plt.xticks(rotation=27) +plt.xlabel('Year') +plt.ylabel('Population (Unit: 10 millions)') +plt.title("The composition of Taiwan's population in history") +plt.legend() + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/40575741/14900011 diff --git a/The attainments and realizations of my dreams/Population_versus_housing_price_index/2022_Quarter1.py b/The attainments and realizations of my dreams/Population_versus_housing_price_index/2022_Quarter1.py new file mode 100644 index 00000000..133c42ae --- /dev/null +++ b/The attainments and realizations of my dreams/Population_versus_housing_price_index/2022_Quarter1.py @@ -0,0 +1,4 @@ +import matplotlib.pyplot as plt + +year = ["2000", "'01", "'02", "'03", "'04", "'05", "'06", "'07", "'08", "'09", "'10", "'11", "'12", + "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21"] \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Population_versus_housing_price_index/April2022.py b/The attainments and realizations of my dreams/Population_versus_housing_price_index/April2022.py new file mode 100644 index 00000000..8e780101 --- /dev/null +++ b/The attainments and realizations of my dreams/Population_versus_housing_price_index/April2022.py @@ -0,0 +1,135 @@ +import matplotlib.pyplot as plt + +year = ["2010", "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08", "'21/09"] + +northTW = [(3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + # (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + # (4017632 + 2544720 + 451422 + 2272812 + 574512 + 365117 + 452882), # 2021/09 + (4011586 + 2531659 + 450944 + 2272452 + 575131 + 364350 + 452665), # 2021/11 + ] + +centralTW = [(2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + # (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + # (2816393 + 539361 + 1257991 + 486455 + 671686), # 2021/09 + (2814422 + 538568 + 1256062 + 485479 + 670664), # 2021/11 + ] + +southTW = [(1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + # (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + # (1866073 + 2751317 + 494868 + 806305 + 265002), # 2021/09 + (1863435 + 2746939 + 493855 + 805177 + 264954), # 2021/11 + ] + +eastTW = [(338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + # (322506 + 213956), # 2021/08 + # (322260 + 213818), # 2021/09 + (321697 + 213534), # 2021/11 + ] + +outlyingTW = [(107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + # (140004 + 13420 + 105645), # 2021/08 + # (140856 + 13429 + 106036), # 2021/09 + (141327 + 13577 + 106310), # 2021/11 + ] + +x = range(10, 22) + +date = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] +index = [(330.60 + 129.45) / 2] +housing_index = [(91.03 + 191.07) / 2, # 2010/04 (Guotai index + Xinyi index) / 2 + (102.42 + 218.72) / 2, # 2011/04 + (109.85 + 241.27) / 2, # 2012/04 + (117.29 + 278.51) / 2, # 2013/04 + (124.60 + 297.78) / 2, # 2014/04 + (124.61 + 289.3) / 2, # 2015/04 + (95.92 + 279.74) / 2, # 2016/04 + (101.89 + 282.36) / 2, # 2017/04 + (107.48 + 285.55) / 2, # 2018/04 + (114.48 + 294.46) / 2, # 2019/04 + (125.22 + 302.61) / 2, # 2020/04 + # (129.45 + 333.60) / 2, # 2021/04 + (134.69 + 341.62) / 2, # 2021/07 + # (128.33 + ) + ] + +figure, axes = plt.subplots() + +axes.stackplot(x, northTW, centralTW, southTW, eastTW, outlyingTW, labels=year) +axes.set_ylim(23350000, 23700000) +axes.ticklabel_format(style='sci', axis='y', scilimits=(0, 0)) +axes.set_xlabel("Year\n" + "References:\n" + "1. https://www.ris.gov.tw/app/portal/346 \n" + "2. https://www.macromicro.me/collections/15/\n" + "tw-housing-relative/124/tw-housing-price-sinyi") + +axes.set_ylabel("Population (Unit: 10 millions)") + +axes2 = axes.twinx() +axes2.set_ylabel("Yearly Housing Price Index (2010/04 - 2021/07) \n" + "Method: (Guotai + Xinyi) / 2", color='goldenrod') + +axes2.plot(x, housing_index, color='gold') +axes2.tick_params(axis='y', labelcolor='goldenrod') + +plt.grid(linewidth=0.3) +plt.title("Taiwan's population change from 2010 - 2021/11 \n in relation to Annual Housing Price Index") + +figure.tight_layout() + +plt.show() + +# References: +# 1. https://pip.moi.gov.tw/V3/E/SCRE0201.aspx +# 2. https://www.cathay-red.com.tw/tw/About/House +# 3. https://www.sinyinews.com.tw/quarterly diff --git a/The attainments and realizations of my dreams/Population_versus_housing_price_index/August2021.py b/The attainments and realizations of my dreams/Population_versus_housing_price_index/August2021.py new file mode 100644 index 00000000..2bc06bd4 --- /dev/null +++ b/The attainments and realizations of my dreams/Population_versus_housing_price_index/August2021.py @@ -0,0 +1,122 @@ +import matplotlib.pyplot as plt + +year = ["2010", "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +date = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] +index = [(330.60 + 129.45) / 2] +housing_index = [(91.03 + 191.07) / 2, # 2010/04 (Guotai index + Xinyi index) / 2 + (102.42 + 218.72) / 2, # 2011/04 + (109.85 + 241.27) / 2, # 2012/04 + (117.29 + 278.51) / 2, # 2013/04 + (124.60 + 297.78) / 2, # 2014/04 + (124.61 + 289.3) / 2, # 2015/04 + (95.92 + 279.74) / 2, # 2016/04 + (101.89 + 282.36) / 2, # 2017/04 + (107.48 + 285.55) / 2, # 2018/04 + (114.48 + 294.46) / 2, # 2019/04 + (125.22 + 302.61) / 2, # 2020/04 + (129.45 + 333.60) / 2, # 2021/04 + ] + +figure, axes = plt.subplots() + +axes.stackplot(x, northTW, centralTW, southTW, eastTW, outlyingTW, labels=year) +axes.set_ylim(23000000, 23700000) +axes.ticklabel_format(style='sci', axis='y', scilimits=(0, 0)) +axes.set_xlabel("Year\n" + "References:\n" + "1. https://www.ris.gov.tw/app/portal/346 \n" + "2. https://www.macromicro.me/collections/15/\n" + "tw-housing-relative/124/tw-housing-price-sinyi") + +axes.set_ylabel("Population (Unit: 10 millions)") + +axes2 = axes.twinx() +axes2.set_ylabel("Yearly Housing Price Index (2010/4 - 2021/04) \n" + "Method: (Guotai + Xinyi) / 2", color='goldenrod') + +axes2.plot(x, housing_index, color='gold') +axes2.tick_params(axis='y', labelcolor='goldenrod') + +plt.grid(linewidth=0.3) +plt.title("Taiwan's population change from 2010 - 2021/08 \n in relation to Annual Housing Price Index") + +figure.tight_layout() + +plt.show() + +# References: +# 1. https://www.macromicro.me/collections/15/tw-housing-relative/124/tw-housing-price-sinyi +# 2. diff --git a/The attainments and realizations of my dreams/Population_versus_housing_price_index/Forecast/Prediction for the the population 2022.py b/The attainments and realizations of my dreams/Population_versus_housing_price_index/Forecast/Prediction for the the population 2022.py new file mode 100644 index 00000000..a8dda70c --- /dev/null +++ b/The attainments and realizations of my dreams/Population_versus_housing_price_index/Forecast/Prediction for the the population 2022.py @@ -0,0 +1,135 @@ +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker + +year = ["1940", "56", "60", "70", "80", "90", "2000", "2010", + "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08", "'21/09"] + +northTW = [(458714 + 326407 + 210386 + 264786 + 256322 + 100151 + 44872), # 1940 + (668093 + 737029 + 303188 + 411575 + 409053 + 194006 + 86439), # 1956 + (829012 + 898655 + 339456 + 489676 + 464792 + 234442 + 108035), # 1960 + (1240576 + 1769568 + 412787 + 726750 + 587652 + 324040), # 1970 + (2258757 + 2220427 + 442988 + 1052800 + 641937 + 344867), # 1980 + (3048034 + 2719659 + 450943 + 1355175 + 374492 + 352919 + 324426), # 1990 + (3567896 + 2646474 + 465186 + 1732617 + 439713 + 388425 + 368439), # 2000 + (3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + (4017632 + 2544720 + 451422 + 2272812 + 574512 + 365117 + 452882), # 2021/09 + ] + +centralTW = [(133301 + 357743 + 262308 + 570528 + 242137 + 394830), # 1940 + (247088 + 537387 + 395324 + 793858 + 357284 + 604484), # 1956 + (298119 + 605437 + 435084 + 880684 + 412942 + 672557), # 1960 + (448140 + 785903 + 524744 + 1050246 + 511040 + 800578), # 1970 + (593427 + 1013176 + 542745 + 1166352 + 524245 + 796276), # 1980 + (761802 + 1258157 + 547609 + 1245288 + 536479 + 753639), # 1990 + (965790 + 1494308 + 559703 + 1310531 + 541537 + 743368), # 2000 + (2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + (2816393 + 539361 + 1257991 + 486455 + 671686), # 2021/09 + ] + +southTW = [(173148 + 501777 + 152265 + 339163 + 418244 + 365786), # 1940 + (284200 + 708211 + 365159 + 534669 + 630382 + 568469), # 1956 + (337602 + 787203 + 467931 + 617380 + 710273 + 645400), # 1960 + (474835 + 934865 + 828191 + 830661 + 849914 + 828761), # 1970 + (583799 + 962827 + 1202123 + 1000645 + 825967 + 888270), # 1980 + (683251 + 1026983 + 1386723 + 1119263 + 257597 + 552277 + 893282), # 1990 + (734650 + 1107687 + 1490560 + 1234707 + 266183 + 562305 + 907590), # 2000 + (1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + (1866073 + 2751317 + 494868 + 806305 + 265002), # 2021/09 + ] + +eastTW = [(147744 + 86852), # 1940 + (219701 + 568469), # 1956 + (252264 + 208272), # 1960 + (335799 + 291761), # 1970 + (355178 + 281218), # 1980 + (352233 + 256803), # 1990 + (353630 + 245312), # 2000 + (338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + (322260 + 213818), # 2021/09 + ] + +outlyingTW = [(0 + 0 + 264786), # 1940 + (0 + 0 + 85886), # 1956 + (0 + 0 + 96986), # 1960 + (61305 + 16939 + 119153), # 1970 + (51883 + 9058 + 107043), # 1980 + (42754 + 5585 + 95932), # 1990 + (53832 + 6733 + 89496), # 2000 + (107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645), # 2021/08 + (140856 + 13429 + 106036), # 2021/09 + ] + +df = pd.DataFrame(columns=year, index=["North", "Central", "South", "East", "Outlying"], + data=[northTW, + centralTW, + southTW, + eastTW, + outlyingTW]) + +print(df) + +total = [] + +for i in range(0, 20, 1): + summation = df.iloc[:, i].sum() + total.append(summation) + + +print(total) diff --git a/The attainments and realizations of my dreams/Population_versus_housing_price_index/Forecast/__init__.py b/The attainments and realizations of my dreams/Population_versus_housing_price_index/Forecast/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Population_versus_housing_price_index/January2022.py b/The attainments and realizations of my dreams/Population_versus_housing_price_index/January2022.py new file mode 100644 index 00000000..871668f3 --- /dev/null +++ b/The attainments and realizations of my dreams/Population_versus_housing_price_index/January2022.py @@ -0,0 +1,128 @@ +import matplotlib.pyplot as plt + +year = ["2010", "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08", "'21/09"] + +northTW = [(3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + # (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + (), # 2021/12 + (), # 2022/06 + ] + +centralTW = [(2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + # (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + (2816393 + 539361 + 1257991 + 486455 + 671686), # 2021/09 + ] + +southTW = [(1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + # (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + (1866073 + 2751317 + 494868 + 806305 + 265002), # 2021/09 + ] + +eastTW = [(338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + # (322506 + 213956), # 2021/08 + (322260 + 213818), # 2021/09 + ] + +outlyingTW = [(107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + # (140004 + 13420 + 105645), # 2021/08 + (140856 + 13429 + 106036), # 2021/09 + ] + +x = range(10, 22) + +date = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] +index = [(330.60 + 129.45) / 2] +housing_index = [(91.03 + 191.07) / 2, # 2010/04 (Guotai index + Xinyi index) / 2 + (102.42 + 218.72) / 2, # 2011/04 + (109.85 + 241.27) / 2, # 2012/04 + (117.29 + 278.51) / 2, # 2013/04 + (124.60 + 297.78) / 2, # 2014/04 + (124.61 + 289.3) / 2, # 2015/04 + (95.92 + 279.74) / 2, # 2016/04 + (101.89 + 282.36) / 2, # 2017/04 + (107.48 + 285.55) / 2, # 2018/04 + (114.48 + 294.46) / 2, # 2019/04 + (125.22 + 302.61) / 2, # 2020/04 + (129.45 + 333.60) / 2, # 2021/04 + ] + +figure, axes = plt.subplots() + +axes.stackplot(x, northTW, centralTW, southTW, eastTW, outlyingTW, labels=year) +axes.set_ylim(23400000, 23700000) +axes.ticklabel_format(style='sci', axis='y', scilimits=(0, 0)) +axes.set_xlabel("Year\n" + "References:\n" + "1. https://www.ris.gov.tw/app/portal/346 \n" + "2. https://www.macromicro.me/collections/15/\n" + "tw-housing-relative/124/tw-housing-price-sinyi") + +axes.set_ylabel("Population (Unit: 10 millions)") + +axes2 = axes.twinx() +axes2.set_ylabel("Yearly Housing Price Index (2010/04 - 2021/04) \n" + "Method: (Guotai + Xinyi) / 2", color='goldenrod') + +axes2.plot(x, housing_index, color='gold') +axes2.tick_params(axis='y', labelcolor='goldenrod') + +plt.grid(linewidth=0.3) +plt.title("Taiwan's population change from 2010 - 2021/09 \n in relation to Annual Housing Price Index") + +figure.tight_layout() + +plt.show() + +# References: +# 1. https://www.macromicro.me/collections/15/tw-housing-relative/124/tw-housing-price-sinyi +# 2. diff --git a/The attainments and realizations of my dreams/Population_versus_housing_price_index/November2021.py b/The attainments and realizations of my dreams/Population_versus_housing_price_index/November2021.py new file mode 100644 index 00000000..fd325bcd --- /dev/null +++ b/The attainments and realizations of my dreams/Population_versus_housing_price_index/November2021.py @@ -0,0 +1,133 @@ +import matplotlib.pyplot as plt + +year = ["2010", "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08", "'21/09"] + +northTW = [(3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + # (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 +# (4017632 + 2544720 + 451422 + 2272812 + 574512 + 365117 + 452882), # 2021/09 + (4011586 + 2531659 + 450944 + 2272452 + 575131 + 364350 + 452665), # 2021/11 + ] + +centralTW = [(2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + # (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 +# (2816393 + 539361 + 1257991 + 486455 + 671686), # 2021/09 + (2814422 + 538568 + 1256062 + 485479 + 670664), # 2021/11 + ] + +southTW = [(1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + # (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 +# (1866073 + 2751317 + 494868 + 806305 + 265002), # 2021/09 + (1863435 + 2746939 + 493855 + 805177 + 264954), # 2021/11 + ] + +eastTW = [(338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + # (322506 + 213956), # 2021/08 +# (322260 + 213818), # 2021/09 + (321697 + 213534), # 2021/11 + ] + +outlyingTW = [(107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + # (140004 + 13420 + 105645), # 2021/08 +# (140856 + 13429 + 106036), # 2021/09 + (141327 + 13577 + 106310), # 2021/11 + ] + +x = range(10, 22) + +date = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] +index = [(330.60 + 129.45) / 2] +housing_index = [(91.03 + 191.07) / 2, # 2010/04 (Guotai index + Xinyi index) / 2 + (102.42 + 218.72) / 2, # 2011/04 + (109.85 + 241.27) / 2, # 2012/04 + (117.29 + 278.51) / 2, # 2013/04 + (124.60 + 297.78) / 2, # 2014/04 + (124.61 + 289.3) / 2, # 2015/04 + (95.92 + 279.74) / 2, # 2016/04 + (101.89 + 282.36) / 2, # 2017/04 + (107.48 + 285.55) / 2, # 2018/04 + (114.48 + 294.46) / 2, # 2019/04 + (125.22 + 302.61) / 2, # 2020/04 +# (129.45 + 333.60) / 2, # 2021/04 + (134.69 + 341.62) / 2 # 2021/07 + ] + +figure, axes = plt.subplots() + +axes.stackplot(x, northTW, centralTW, southTW, eastTW, outlyingTW, labels=year) +axes.set_ylim(23350000, 23700000) +axes.ticklabel_format(style='sci', axis='y', scilimits=(0, 0)) +axes.set_xlabel("Year\n" + "References:\n" + "1. https://www.ris.gov.tw/app/portal/346 \n" + "2. https://www.macromicro.me/collections/15/\n" + "tw-housing-relative/124/tw-housing-price-sinyi") + +axes.set_ylabel("Population (Unit: 10 millions)") + +axes2 = axes.twinx() +axes2.set_ylabel("Yearly Housing Price Index (2010/04 - 2021/07) \n" + "Method: (Guotai + Xinyi) / 2", color='goldenrod') + +axes2.plot(x, housing_index, color='gold') +axes2.tick_params(axis='y', labelcolor='goldenrod') + +plt.grid(linewidth=0.3) +plt.title("Taiwan's population change from 2010 - 2021/11 \n in relation to Annual Housing Price Index") + +figure.tight_layout() + +plt.show() + +# References: +# 1. https://www.macromicro.me/collections/15/tw-housing-relative/124/tw-housing-price-sinyi +# 2. diff --git a/The attainments and realizations of my dreams/Population_versus_housing_price_index/September2021.py b/The attainments and realizations of my dreams/Population_versus_housing_price_index/September2021.py new file mode 100644 index 00000000..af90674f --- /dev/null +++ b/The attainments and realizations of my dreams/Population_versus_housing_price_index/September2021.py @@ -0,0 +1,127 @@ +import matplotlib.pyplot as plt + +year = ["2010", "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08", "'21/09"] + +northTW = [(3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 +# (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + (4017632 + 2544720 + 451422 + 2272812 + 574512 + 365117 + 452882), # 2021/09 + ] + +centralTW = [(2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 +# (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + (2816393 + 539361 + 1257991 + 486455 + 671686), # 2021/09 + ] + +southTW = [(1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 +# (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + (1866073 + 2751317 + 494868 + 806305 + 265002), # 2021/09 + ] + +eastTW = [(338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 +# (322506 + 213956), # 2021/08 + (322260 + 213818), # 2021/09 + ] + +outlyingTW = [(107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 +# (140004 + 13420 + 105645), # 2021/08 + (140856 + 13429 + 106036), # 2021/09 + ] + +x = range(10, 22) + +date = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] +index = [(330.60 + 129.45) / 2] +housing_index = [(91.03 + 191.07) / 2, # 2010/04 (Guotai index + Xinyi index) / 2 + (102.42 + 218.72) / 2, # 2011/04 + (109.85 + 241.27) / 2, # 2012/04 + (117.29 + 278.51) / 2, # 2013/04 + (124.60 + 297.78) / 2, # 2014/04 + (124.61 + 289.3) / 2, # 2015/04 + (95.92 + 279.74) / 2, # 2016/04 + (101.89 + 282.36) / 2, # 2017/04 + (107.48 + 285.55) / 2, # 2018/04 + (114.48 + 294.46) / 2, # 2019/04 + (125.22 + 302.61) / 2, # 2020/04 + (129.45 + 333.60) / 2, # 2021/04 + ] + +figure, axes = plt.subplots() + +axes.stackplot(x, northTW, centralTW, southTW, eastTW, outlyingTW, labels=year) +axes.set_ylim(23000000, 23700000) +axes.ticklabel_format(style='sci', axis='y', scilimits=(0, 0)) +axes.set_xlabel("Year\n" + "References:\n" + "1. https://www.ris.gov.tw/app/portal/346 \n" + "2. https://www.macromicro.me/collections/15/\n" + "tw-housing-relative/124/tw-housing-price-sinyi") + +axes.set_ylabel("Population (Unit: 10 millions)") + +axes2 = axes.twinx() +axes2.set_ylabel("Yearly Housing Price Index (2010/04 - 2021/04) \n" + "Method: (Guotai + Xinyi) / 2", color='goldenrod') + +axes2.plot(x, housing_index, color='gold') +axes2.tick_params(axis='y', labelcolor='goldenrod') + +plt.grid(linewidth=0.3) +plt.title("Taiwan's population change from 2010 - 2021/09 \n in relation to Annual Housing Price Index") + +figure.tight_layout() + +plt.show() + +# References: +# 1. https://www.macromicro.me/collections/15/tw-housing-relative/124/tw-housing-price-sinyi +# 2. diff --git a/The attainments and realizations of my dreams/Population_versus_housing_price_index/September2021_2.py b/The attainments and realizations of my dreams/Population_versus_housing_price_index/September2021_2.py new file mode 100644 index 00000000..e9c558be --- /dev/null +++ b/The attainments and realizations of my dreams/Population_versus_housing_price_index/September2021_2.py @@ -0,0 +1,127 @@ +import matplotlib.pyplot as plt + +year = ["2010", "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08", "'21/09"] + +northTW = [(3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + # (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + (4017632 + 2544720 + 451422 + 2272812 + 574512 + 365117 + 452882), # 2021/09 + ] + +centralTW = [(2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + # (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + (2816393 + 539361 + 1257991 + 486455 + 671686), # 2021/09 + ] + +southTW = [(1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + # (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + (1866073 + 2751317 + 494868 + 806305 + 265002), # 2021/09 + ] + +eastTW = [(338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + # (322506 + 213956), # 2021/08 + (322260 + 213818), # 2021/09 + ] + +outlyingTW = [(107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + # (140004 + 13420 + 105645), # 2021/08 + (140856 + 13429 + 106036), # 2021/09 + ] + +x = range(10, 22) + +date = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] +index = [(330.60 + 129.45) / 2] +housing_index = [(91.03 + 191.07) / 2, # 2010/04 (Guotai index + Xinyi index) / 2 + (102.42 + 218.72) / 2, # 2011/04 + (109.85 + 241.27) / 2, # 2012/04 + (117.29 + 278.51) / 2, # 2013/04 + (124.60 + 297.78) / 2, # 2014/04 + (124.61 + 289.3) / 2, # 2015/04 + (95.92 + 279.74) / 2, # 2016/04 + (101.89 + 282.36) / 2, # 2017/04 + (107.48 + 285.55) / 2, # 2018/04 + (114.48 + 294.46) / 2, # 2019/04 + (125.22 + 302.61) / 2, # 2020/04 + (129.45 + 333.60) / 2, # 2021/04 + ] + +figure, axes = plt.subplots() + +axes.stackplot(x, northTW, centralTW, southTW, eastTW, outlyingTW, labels=year) +axes.set_ylim(23300000, 23700000) +axes.ticklabel_format(style='sci', axis='y', scilimits=(0, 0)) +axes.set_xlabel("Year\n" + "References:\n" + "1. https://www.ris.gov.tw/app/portal/346 \n" + "2. https://www.macromicro.me/collections/15/\n" + "tw-housing-relative/124/tw-housing-price-sinyi") + +axes.set_ylabel("Population (Unit: 10 millions)") + +axes2 = axes.twinx() +axes2.set_ylabel("Yearly Housing Price Index (2010/04 - 2021/04) \n" + "Method: (Guotai + Xinyi) / 2", color='goldenrod') + +axes2.plot(x, housing_index, color='gold') +axes2.tick_params(axis='y', labelcolor='goldenrod') + +plt.grid(linewidth=0.3) +plt.title("Taiwan's population change from 2010 - 2021/09 \n in relation to Annual Housing Price Index") + +figure.tight_layout() + +plt.show() + +# References: +# 1. https://www.macromicro.me/collections/15/tw-housing-relative/124/tw-housing-price-sinyi +# 2. diff --git a/The attainments and realizations of my dreams/Population_versus_housing_price_index/September2021_3.py b/The attainments and realizations of my dreams/Population_versus_housing_price_index/September2021_3.py new file mode 100644 index 00000000..fb319fd1 --- /dev/null +++ b/The attainments and realizations of my dreams/Population_versus_housing_price_index/September2021_3.py @@ -0,0 +1,127 @@ +import matplotlib.pyplot as plt + +year = ["2010", "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08", "'21/09"] + +northTW = [(3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + # (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + (4017632 + 2544720 + 451422 + 2272812 + 574512 + 365117 + 452882), # 2021/09 + ] + +centralTW = [(2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + # (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + (2816393 + 539361 + 1257991 + 486455 + 671686), # 2021/09 + ] + +southTW = [(1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + # (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + (1866073 + 2751317 + 494868 + 806305 + 265002), # 2021/09 + ] + +eastTW = [(338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + # (322506 + 213956), # 2021/08 + (322260 + 213818), # 2021/09 + ] + +outlyingTW = [(107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + # (140004 + 13420 + 105645), # 2021/08 + (140856 + 13429 + 106036), # 2021/09 + ] + +x = range(10, 22) + +date = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] +index = [(330.60 + 129.45) / 2] +housing_index = [(91.03 + 191.07) / 2, # 2010/04 (Guotai index + Xinyi index) / 2 + (102.42 + 218.72) / 2, # 2011/04 + (109.85 + 241.27) / 2, # 2012/04 + (117.29 + 278.51) / 2, # 2013/04 + (124.60 + 297.78) / 2, # 2014/04 + (124.61 + 289.3) / 2, # 2015/04 + (95.92 + 279.74) / 2, # 2016/04 + (101.89 + 282.36) / 2, # 2017/04 + (107.48 + 285.55) / 2, # 2018/04 + (114.48 + 294.46) / 2, # 2019/04 + (125.22 + 302.61) / 2, # 2020/04 + (129.45 + 333.60) / 2, # 2021/04 + ] + +figure, axes = plt.subplots() + +axes.stackplot(x, northTW, centralTW, southTW, eastTW, outlyingTW, labels=year) +axes.set_ylim(23400000, 23700000) +axes.ticklabel_format(style='sci', axis='y', scilimits=(0, 0)) +axes.set_xlabel("Year\n" + "References:\n" + "1. https://www.ris.gov.tw/app/portal/346 \n" + "2. https://www.macromicro.me/collections/15/\n" + "tw-housing-relative/124/tw-housing-price-sinyi") + +axes.set_ylabel("Population (Unit: 10 millions)") + +axes2 = axes.twinx() +axes2.set_ylabel("Yearly Housing Price Index (2010/04 - 2021/04) \n" + "Method: (Guotai + Xinyi) / 2", color='goldenrod') + +axes2.plot(x, housing_index, color='gold') +axes2.tick_params(axis='y', labelcolor='goldenrod') + +plt.grid(linewidth=0.3) +plt.title("Taiwan's population change from 2010 - 2021/09 \n in relation to Annual Housing Price Index") + +figure.tight_layout() + +plt.show() + +# References: +# 1. https://www.macromicro.me/collections/15/tw-housing-relative/124/tw-housing-price-sinyi +# 2. diff --git a/The attainments and realizations of my dreams/Population_versus_housing_price_index/__init__.py b/The attainments and realizations of my dreams/Population_versus_housing_price_index/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Road safety/2025/CC0.png b/The attainments and realizations of my dreams/Road safety/2025/CC0.png new file mode 100644 index 00000000..10986298 Binary files /dev/null and b/The attainments and realizations of my dreams/Road safety/2025/CC0.png differ diff --git a/The attainments and realizations of my dreams/Road safety/2025/Hitherto June.py b/The attainments and realizations of my dreams/Road safety/2025/Hitherto June.py new file mode 100644 index 00000000..5b66cf80 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/2025/Hitherto June.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [48, 122, 114, 133, 168, 152] + +label = ["啣撣\nTaipei", "啣撣\nNew Taipei", "獢\nTaoyuan", "唬葉\nTaichung", "啣\nTainan", "擃\n Kaohsiung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/1嚚6 啁渲撣頠蝳甇颱滿稞nDeath toll from road accidents in Taiwan by city", fontsize=20, color='red') + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://roadsafety.tw/") + +plt.ylim(0, 200) + +img = image.imread('CC0.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.45, y=0.8, s="Free clip art\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Road safety/2025/Hitherto May.py b/The attainments and realizations of my dreams/Road safety/2025/Hitherto May.py new file mode 100644 index 00000000..e9e84508 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/2025/Hitherto May.py @@ -0,0 +1,66 @@ +import matplotlib.pyplot as plt +import matplotlib +import matplotlib.cbook as cbook +import matplotlib.colors as colour +import matplotlib.image as image +# Using the magic encoding +# -*- coding: utf-8 -*- +from matplotlib.transforms import IdentityTransform + +matplotlib.rc('font', family="MS Gothic") + +region_num = [1, 2, 3, 4, 5, 6] +position_vacancies = [40, 107, 96, 104, 142, 125] + +label = ["啣撣\nTaipei", "啣撣\nNew Taipei", "獢\nTaoyuan", "唬葉\nTaichung", "啣\nTainan", "擃\n Kaohsiung"] + +fig, ax = plt.subplots(figsize=(9, 9)) +plt.xticks(region_num, labels=label, rotation=7, fontsize=12) +# plt.yticks([0, 250, 300, 350, 400, 450, 500, 550]) +plt.tick_params(axis='y', labelsize=12) # [2] + +plot = ax.bar(region_num, position_vacancies, edgecolor='cyan', color=[colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('deepskyblue'), + colour.CSS4_COLORS.get('palegreen'), + colour.CSS4_COLORS.get('palegreen')]) #[4][5][6] + +for rect in plot: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.002 * height, + '%d' % int(height), ha='center', va='bottom', fontsize=12) + +plt.title("2025/1嚚5 啁渲撣頠蝳甇颱滿稞nDeath toll from road accidents in Taiwan by city", fontsize=20, color='red') + +# plt.ylabel("") +plt.xlabel("鞈 Reference: https://roadsafety.tw/") + +plt.ylim(0, 200) + +img = image.imread('CC0.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +# Insert text watermark [1] +plt.text(x=0.5, y=0.8, s="Free clip art\n∠甈", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, + transform=ax.transAxes) # data coordinates [2] [Note1] [3] [Note2] + +plt.show() + +# Reference: +# 1. https://matplotlib.org/stable/gallery/text_labels_and_annotations/watermark_text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html +# 3. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.text.html#matplotlib.axes.Axes.text +# 4. https://www.google.com/search?q=matplotlib+bar+color +# 5. https://www.python-graph-gallery.com/3-control-color-of-barplots +# 6. https://matplotlib.org/stable/gallery/color/named_colors.html + +# Notes: +# 1. pixel coordinate system of the display window; (0, 0) is bottom left of the window, +# and (width, height) is top right of the display window in pixels.[2] +# +# 2. default transform specifies that text is in data coords, +# alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). +# The example below places text in the center of the Axes:[3] diff --git a/The attainments and realizations of my dreams/Road safety/2025/__init__.py b/The attainments and realizations of my dreams/Road safety/2025/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Road safety/CC-BY.png b/The attainments and realizations of my dreams/Road safety/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Road safety/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Road safety/CC0.png b/The attainments and realizations of my dreams/Road safety/CC0.png new file mode 100644 index 00000000..10986298 Binary files /dev/null and b/The attainments and realizations of my dreams/Road safety/CC0.png differ diff --git a/The attainments and realizations of my dreams/Road safety/Deaths_in_road_accidents_2008_2021.csv b/The attainments and realizations of my dreams/Road safety/Deaths_in_road_accidents_2008_2021.csv new file mode 100644 index 00000000..fa395351 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Deaths_in_road_accidents_2008_2021.csv @@ -0,0 +1,15 @@ +??    ,總計,新北市,臺北市,桃園市,臺中市,臺南市,高雄市,宜蘭縣,新竹縣,苗栗縣,彰化縣,南投縣,雲林縣,嘉義縣,屏東縣,臺東縣,花蓮縣,澎湖縣,基隆市,新竹市,嘉義市 +97年,"3,474",261,115,226,371,371,398,114,104,107,246,133,211,144,255,75,95,7,25,48,31 +98年,"3,232",254,133,198,318,340,402,101,88,97,235,98,180,148,226,69,99,11,36,47,35 +99年,"3,297",255,152,227,373,319,388,93,98,112,233,97,190,123,255,77,81,7,29,33,36 +100年,"3,343",264,140,195,382,346,373,104,110,120,221,108,203,122,248,78,77,14,34,57,23 +101年,"3,219",252,130,195,370,288,417,98,111,104,239,111,201,127,229,63,70,6,25,46,28 +102年,"3,072",223,140,191,308,311,375,79,82,93,247,101,192,117,246,77,82,7,27,48,24 +103年,"3,075",219,138,221,302,290,387,86,92,94,257,108,165,116,217,64,96,11,35,55,19 +104年,"2,942",212,137,203,275,289,364,83,89,79,206,101,189,118,229,63,70,13,31,41,21 +105年,"2,847",266,157,203,259,269,329,68,91,98,201,98,167,109,209,65,72,16,24,31,15 +106年,"2,697",256,106,213,217,246,289,58,86,85,193,89,165,95,203,55,82,15,30,39,18 +107年,"2,780",248,137,244,245,289,280,82,81,79,196,83,172,122,199,51,56,10,34,48,17 +108年,"2,865",225,131,249,270,294,351,83,81,86,221,88,162,119,175,62,49,9,25,52,23 +109年,"2,972",232,102,264,325,317,347,78,91,97,205,82,165,125,216,61,74,11,25,48,27 +110年,"2,962",264,130,264,280,293,330,100,93,120,201,81,152,124,206,57,61,12,32,44,21 diff --git a/The attainments and realizations of my dreams/Road safety/Deaths_in_road_accidents_2008_2021.xls b/The attainments and realizations of my dreams/Road safety/Deaths_in_road_accidents_2008_2021.xls new file mode 100644 index 00000000..67f231af Binary files /dev/null and b/The attainments and realizations of my dreams/Road safety/Deaths_in_road_accidents_2008_2021.xls differ diff --git a/The attainments and realizations of my dreams/Road safety/Deaths_in_road_accidents_2008_2021.xlsx b/The attainments and realizations of my dreams/Road safety/Deaths_in_road_accidents_2008_2021.xlsx new file mode 100644 index 00000000..136a9c0c Binary files /dev/null and b/The attainments and realizations of my dreams/Road safety/Deaths_in_road_accidents_2008_2021.xlsx differ diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/December2021_bar_table.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/December2021_bar_table.py new file mode 100644 index 00000000..31544090 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/December2021_bar_table.py @@ -0,0 +1,106 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +deaths = [[14, 30, 18, 28, 31, 31], # January + [9, 25, 20, 18, 31, 39], # February + [13, 15, 18, 36, 21, 28], # March + [11, 15, 21, 24, 23, 25], # April + [10, 21, 22, 22, 37, 34], # May + [9, 17, 24, 23, 29, 20], # June + [7, 23, 22, 27, 18, 16], # July + [10, 21, 27, 13, 17, 15], # August + [13, 20, 32, 22, 26, 29], # September + [9, 21, 16, 30, 21, 33], # October + [15, 25, 25, 22, 18, 26], # November + [11, 33, 24, 18, 25, 37], # December + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-12)") + +axes.grid(True) # pyplot.grid [1][2] + +axes2.bar(administrative_duty, [132, 266, 269, 283, 295, 333]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [132, 266, 269, 283, 295, 333], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/December2021_bar_table_.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/December2021_bar_table_.py new file mode 100644 index 00000000..3019c697 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/December2021_bar_table_.py @@ -0,0 +1,106 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +deaths = [[14, 30, 18, 28, 31, 31], # January + [9, 25, 20, 18, 31, 39], # February + [13, 15, 18, 36, 21, 28], # March + [11, 15, 21, 24, 23, 25], # April + [10, 21, 22, 22, 37, 34], # May + [9, 17, 24, 23, 29, 20], # June + [7, 23, 22, 27, 18, 16], # July + [10, 21, 27, 13, 17, 15], # August + [13, 20, 32, 22, 26, 29], # September + [9, 21, 16, 30, 21, 33], # October + [15, 25, 25, 22, 18, 26], # November + [11, 33, 24, 18, 25, 37], # December + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 9)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-12)") + +axes.grid(True) # pyplot.grid [1][2] + +axes2.bar(administrative_duty, [132, 266, 269, 283, 295, 333]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [132, 266, 269, 283, 295, 333], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/December2021_bar_table_metro.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/December2021_bar_table_metro.py new file mode 100644 index 00000000..4c18a9b1 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/December2021_bar_table_metro.py @@ -0,0 +1,106 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung\nPingtung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +deaths = [[14, 30, 18, 28, 31, 31+18], # January + [9, 25, 20, 18, 31, 39+15], # February + [13, 15, 18, 36, 21, 28+19], # March + [11, 15, 21, 24, 23, 25+14], # April + [10, 21, 22, 22, 37, 34+14], # May + [9, 17, 24, 23, 29, 20+10], # June + [7, 23, 22, 27, 18, 16+24], # July + [10, 21, 27, 13, 17, 15+13], # August + [13, 20, 32, 22, 26, 29+14], # September + [9, 21, 16, 30, 21, 33+21], # October + [15, 25, 25, 22, 18, 26+18], # November + [11, 33, 24, 18, 25, 37+28], # December + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(10, 10)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-12)") + +axes.grid(True) # pyplot.grid [1][2] + +axes2.bar(administrative_duty, [132, 266, 269, 283, 295, 541]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [132, 266, 269, 283, 295, 541], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021.py new file mode 100644 index 00000000..ded6906b --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021.py @@ -0,0 +1,43 @@ +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # Jan + [23, 55, 38, 46, 62, 70], # Feb + [36, 70, 56, 82, 83, 98], # Mar + [47, 85, 77, 106, 106, 123], # Apr + [57, 106, 99, 128, 147, 153], # May + [66, 123, 123, 151, 172, 177], # Jun + [73, 146, 145, 178, 190, 193], # Jul + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +figure, axes = plt.subplots() + +axes.plot(month_as_of_now, df.loc[:, "Taipei"].to_numpy(), label="Taipei") +axes.plot(month_as_of_now, df.loc[:, "New Taipei"].to_numpy(), label="New Taipei") +axes.plot(month_as_of_now, df.loc[:, "Taoyuan"].to_numpy(), label="Taoyuan") +axes.plot(month_as_of_now, df.loc[:, "Taichung"].to_numpy(), label="Taichung") +axes.plot(month_as_of_now, df.loc[:, "Tainan"].to_numpy(), label="Tainan") +axes.plot(month_as_of_now, df.loc[:, "Kaohsiung"].to_numpy(), label="Kaohsiung") + +axes.set_title("The Cumulative Number of Deaths in Road Accident in Taiwan by Region (2021/01-07)") + +axes.legend() + +axes.grid(True) + +axes.set_ylabel("The number of deaths") + +axes.set_xlabel("Months in 2021") + +plt.show() diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table.py new file mode 100644 index 00000000..c3dd4310 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table.py @@ -0,0 +1,67 @@ +import matplotlib.pyplot as plt +import pandas as pd +import numpy as np + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # Jan + [23, 55, 38, 46, 62, 70], # Feb + [36, 70, 56, 82, 83, 98], # Mar + [47, 85, 77, 106, 106, 123], # Apr + [57, 106, 99, 128, 147, 153], # May + [66, 123, 123, 151, 172, 177], # Jun + [73, 146, 145, 178, 190, 193], # Jul + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors +colors = plt.cm.BuPu.BuPu(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plt.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + +# Reverse colors and text labels to display the last value at the top. +colors = colors[::-1] +cell_text.reverse() + +# Add a table at the bottom of the axes +the_table = plt.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +plt.ylabel("The number of deaths") +plt.xticks([]) +plt.title("The Cumulative Number of Deaths in Road Accident in Taiwan by Region (2021/01-07)") + +plt.grid(True) # pyplot.grid [1][2] + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_10.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_10.py new file mode 100644 index 00000000..84463670 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_10.py @@ -0,0 +1,87 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # January + [9, 25, 20, 18, 31, 39], # February + [13, 15, 18, 36, 21, 28], # March + [11, 15, 21, 24, 23, 25], # April + [10, 21, 22, 22, 37, 34], # May + [9, 17, 24, 23, 29, 20], # June + [7, 23, 22, 27, 18, 16], # July + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlGn") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, axes = plt.subplots() + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +axes.grid(True) # pyplot.grid [1][2] + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_11.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_11.py new file mode 100644 index 00000000..3a1c65e8 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_11.py @@ -0,0 +1,87 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # January + [9, 25, 20, 18, 31, 39], # February + [13, 15, 18, 36, 21, 28], # March + [11, 15, 21, 24, 23, 25], # April + [10, 21, 22, 22, 37, 34], # May + [9, 17, 24, 23, 29, 20], # June + [7, 23, 22, 27, 18, 16], # July + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, axes = plt.subplots() + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +axes.grid(True) # pyplot.grid [1][2] + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_12.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_12.py new file mode 100644 index 00000000..a1da11b6 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_12.py @@ -0,0 +1,88 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # January + [9, 25, 20, 18, 31, 39], # February + [13, 15, 18, 36, 21, 28], # March + [11, 15, 21, 24, 23, 25], # April + [10, 21, 22, 22, 37, 34], # May + [9, 17, 24, 23, 29, 20], # June + [7, 23, 22, 27, 18, 16], # July + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, axes = plt.subplots() + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + axes.bar_label(axes.containers[0], label_type='edge') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +axes.grid(True) # pyplot.grid [1][2] + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_13.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_13.py new file mode 100644 index 00000000..ea0cf733 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_13.py @@ -0,0 +1,88 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # January + [9, 25, 20, 18, 31, 39], # February + [13, 15, 18, 36, 21, 28], # March + [11, 15, 21, 24, 23, 25], # April + [10, 21, 22, 22, 37, 34], # May + [9, 17, 24, 23, 29, 20], # June + [7, 23, 22, 27, 18, 16], # July + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, axes = plt.subplots() + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +axes.grid(True) # pyplot.grid [1][2] + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_14.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_14.py new file mode 100644 index 00000000..44c2fcf2 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_14.py @@ -0,0 +1,97 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # January + [9, 25, 20, 18, 31, 39], # February + [13, 15, 18, 36, 21, 28], # March + [11, 15, 21, 24, 23, 25], # April + [10, 21, 22, 22, 37, 34], # May + [9, 17, 24, 23, 29, 20], # June + [7, 23, 22, 27, 18, 16], # July + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, axes = plt.subplots() + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +axes.grid(True) # pyplot.grid [1][2] + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_15.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_15.py new file mode 100644 index 00000000..9e78150b --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_15.py @@ -0,0 +1,101 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # January + [9, 25, 20, 18, 31, 39], # February + [13, 15, 18, 36, 21, 28], # March + [11, 15, 21, 24, 23, 25], # April + [10, 21, 22, 22, 37, 34], # May + [9, 17, 24, 23, 29, 20], # June + [7, 23, 22, 27, 18, 16], # July + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +axes.grid(True) # pyplot.grid [1][2] + +axes2.bar(administrative_duty, [73, 146, 145, 178, 190, 193]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [73, 146, 145, 178, 190, 193], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_15_1.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_15_1.py new file mode 100644 index 00000000..e5219bd7 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_15_1.py @@ -0,0 +1,101 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # January + [9, 25, 20, 18, 31, 39], # February + [13, 15, 18, 36, 21, 28], # March + [11, 15, 21, 24, 23, 25], # April + [10, 21, 22, 22, 37, 34], # May + [9, 17, 24, 23, 29, 20], # June + [7, 23, 22, 27, 18, 16], # July + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 7)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +axes.grid(True) # pyplot.grid [1][2] + +axes2.bar(administrative_duty, [73, 146, 145, 178, 190, 193]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [73, 146, 145, 178, 190, 193], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_15_2.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_15_2.py new file mode 100644 index 00000000..d85da76a --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_15_2.py @@ -0,0 +1,101 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # January + [9, 25, 20, 18, 31, 39], # February + [13, 15, 18, 36, 21, 28], # March + [11, 15, 21, 24, 23, 25], # April + [10, 21, 22, 22, 37, 34], # May + [9, 17, 24, 23, 29, 20], # June + [7, 23, 22, 27, 18, 16], # July + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(10, 18)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +axes.grid(True) # pyplot.grid [1][2] + +axes2.bar(administrative_duty, [73, 146, 145, 178, 190, 193]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [73, 146, 145, 178, 190, 193], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_15_3.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_15_3.py new file mode 100644 index 00000000..5d7e994b --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_15_3.py @@ -0,0 +1,103 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # January + [9, 25, 20, 18, 31, 39], # February + [13, 15, 18, 36, 21, 28], # March + [11, 15, 21, 24, 23, 25], # April + [10, 21, 22, 22, 37, 34], # May + [9, 17, 24, 23, 29, 20], # June + [7, 23, 22, 27, 18, 16], # July + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='lower center') # The position of the cell with respect to ax. This must be one of the codes.[6][7] + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +axes.grid(True) # pyplot.grid [1][2] + +axes2.bar(administrative_duty, [73, 146, 145, 178, 190, 193]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [73, 146, 145, 178, 190, 193], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.table.html +# 7. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.codes + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_16.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_16.py new file mode 100644 index 00000000..427f8147 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_16.py @@ -0,0 +1,101 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # January + [9, 25, 20, 18, 31, 39], # February + [13, 15, 18, 36, 21, 28], # March + [11, 15, 21, 24, 23, 25], # April + [10, 21, 22, 22, 37, 34], # May + [9, 17, 24, 23, 29, 20], # June + [7, 23, 22, 27, 18, 16], # July + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +axes.grid(True) # pyplot.grid [1][2] + +axes2.bar(administrative_duty, [73, 146, 145, 178, 190, 193]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [73, 146, 145, 178, 190, 193], '-o', color='orange') + +# figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_16_2.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_16_2.py new file mode 100644 index 00000000..0ca7fb70 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_16_2.py @@ -0,0 +1,101 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # January + [9, 25, 20, 18, 31, 39], # February + [13, 15, 18, 36, 21, 28], # March + [11, 15, 21, 24, 23, 25], # April + [10, 21, 22, 22, 37, 34], # May + [9, 17, 24, 23, 29, 20], # June + [7, 23, 22, 27, 18, 16], # July + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(10, 10)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +axes.grid(True) # pyplot.grid [1][2] + +axes2.bar(administrative_duty, [73, 146, 145, 178, 190, 193]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [73, 146, 145, 178, 190, 193], '-o', color='orange') + +# figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_2.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_2.py new file mode 100644 index 00000000..88183d8c --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_2.py @@ -0,0 +1,72 @@ +import matplotlib.pyplot as plt +import pandas as pd +import numpy as np +import matplotlib.cm as cm + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # Jan + [23, 55, 38, 46, 62, 70], # Feb + [36, 70, 56, 82, 83, 98], # Mar + [47, 85, 77, 106, 106, 123], # Apr + [57, 106, 99, 128, 147, 153], # May + [66, 123, 123, 151, 172, 177], # Jun + [73, 146, 145, 178, 190, 193], # Jul + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors +cmap = cm.get_cmap("Spectral") # [3] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plt.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + +# Reverse colors and text labels to display the last value at the top. +colors = colors[::-1] +cell_text.reverse() + +# Add a table at the bottom of the axes +the_table = plt.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +plt.ylabel("The number of deaths") +plt.xticks([]) +plt.title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +plt.grid(True) # pyplot.grid [1][2] + +plt.tight_layout() + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_3.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_3.py new file mode 100644 index 00000000..9fc91d36 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_3.py @@ -0,0 +1,82 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # Jan + [23, 55, 38, 46, 62, 70], # Feb + [36, 70, 56, 82, 83, 98], # Mar + [47, 85, 77, 106, 106, 123], # Apr + [57, 106, 99, 128, 147, 153], # May + [66, 123, 123, 151, 172, 177], # Jun + [73, 146, 145, 178, 190, 193], # Jul + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors +cmap = cm.get_cmap("Spectral") # [3] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plt.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + +# Reverse colors and text labels to display the last value at the top. +colors = colors[::-1] +cell_text.reverse() + +# Add a table at the bottom of the axes +the_table = plt.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +plt.ylabel("The number of deaths") +plt.xticks([]) +plt.title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +plt.grid(True) # pyplot.grid [1][2] + +plt.tight_layout() + +# matplotlib text [1][2] +text = plt.text(2.4, 3.9, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_4.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_4.py new file mode 100644 index 00000000..d83e1b75 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_4.py @@ -0,0 +1,84 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # Jan + [23, 55, 38, 46, 62, 70], # Feb + [36, 70, 56, 82, 83, 98], # Mar + [47, 85, 77, 106, 106, 123], # Apr + [57, 106, 99, 128, 147, 153], # May + [66, 123, 123, 151, 172, 177], # Jun + [73, 146, 145, 178, 190, 193], # Jul + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors +cmap = cm.get_cmap("Spectral") # [3] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, axes = plt.subplots() + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + +# Reverse colors and text labels to display the last value at the top. +colors = colors[::-1] +cell_text.reverse() + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +axes.grid(True) # pyplot.grid [1][2] + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_5.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_5.py new file mode 100644 index 00000000..018a35ca --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_5.py @@ -0,0 +1,84 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # Jan + [23, 55, 38, 46, 62, 70], # Feb + [36, 70, 56, 82, 83, 98], # Mar + [47, 85, 77, 106, 106, 123], # Apr + [57, 106, 99, 128, 147, 153], # May + [66, 123, 123, 151, 172, 177], # Jun + [73, 146, 145, 178, 190, 193], # Jul + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors +cmap = cm.get_cmap("Spectral") # [3] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, axes = plt.subplots() + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + +# Reverse colors and text labels to display the last value at the top. +colors = colors[::-1] +cell_text.reverse() + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +axes.grid(True) # pyplot.grid [1][2] + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_6.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_6.py new file mode 100644 index 00000000..0721fb5e --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_6.py @@ -0,0 +1,84 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[7, 23, 22, 27, 18, 16], # July + [9, 17, 24, 23, 29, 20], # June + [10, 21, 22, 22, 37, 34], # May + [11, 15, 21, 24, 24, 25], # April + [13, 15, 18, 36, 21, 28], # March + [9, 25, 20, 18, 31, 39], # February + [14, 30, 18, 28, 31, 31], # January + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors +cmap = cm.get_cmap("Spectral") # [3] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, axes = plt.subplots() + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + +# Reverse colors and text labels to display the last value at the top. +colors = colors[::-1] +cell_text.reverse() + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +axes.grid(True) # pyplot.grid [1][2] + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_7.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_7.py new file mode 100644 index 00000000..e7fb9dea --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_7.py @@ -0,0 +1,81 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[7, 23, 22, 27, 18, 16], # July + [9, 17, 24, 23, 29, 20], # June + [10, 21, 22, 22, 37, 34], # May + [11, 15, 21, 24, 24, 25], # April + [13, 15, 18, 36, 21, 28], # March + [9, 25, 20, 18, 31, 39], # February + [14, 30, 18, 28, 31, 31], # January + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors +cmap = cm.get_cmap("Spectral") # [3] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, axes = plt.subplots() + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +axes.grid(True) # pyplot.grid [1][2] + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_8.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_8.py new file mode 100644 index 00000000..f84fe076 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_8.py @@ -0,0 +1,83 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # January + [9, 25, 20, 18, 31, 39], # February + [13, 15, 18, 36, 21, 28], # March + [11, 15, 21, 24, 23, 25], # April + [10, 21, 22, 22, 37, 34], # May + [9, 17, 24, 23, 29, 20], # June + [7, 23, 22, 27, 18, 16], # July + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors +cmap = cm.get_cmap("Spectral") # [3] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, axes = plt.subplots() + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +axes.grid(True) # pyplot.grid [1][2] + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_9.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_9.py new file mode 100644 index 00000000..acb1465a --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/July2021_bar_table_9.py @@ -0,0 +1,87 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"] + +deaths = [[14, 30, 18, 28, 31, 31], # January + [9, 25, 20, 18, 31, 39], # February + [13, 15, 18, 36, 21, 28], # March + [11, 15, 21, 24, 23, 25], # April + [10, 21, 22, 22, 37, 34], # May + [9, 17, 24, 23, 29, 20], # June + [7, 23, 22, 27, 18, 16], # July + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("OrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, axes = plt.subplots() + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-07)") + +axes.grid(True) # pyplot.grid [1][2] + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/September2021_bar_table.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/September2021_bar_table.py new file mode 100644 index 00000000..4b93117a --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/September2021_bar_table.py @@ -0,0 +1,103 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep"] + +deaths = [[14, 30, 18, 28, 31, 31], # January + [9, 25, 20, 18, 31, 39], # February + [13, 15, 18, 36, 21, 28], # March + [11, 15, 21, 24, 23, 25], # April + [10, 21, 22, 22, 37, 34], # May + [9, 17, 24, 23, 29, 20], # June + [7, 23, 22, 27, 18, 16], # July + [10, 21, 27, 13, 17, 15], # August + [13, 20, 32, 22, 26, 29], # September + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 7)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-09)") + +axes.grid(True) # pyplot.grid [1][2] + +axes2.bar(administrative_duty, [96, 187, 204, 213, 233, 237]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [96, 187, 204, 213, 233, 237], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/September2021_bar_table_2.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/September2021_bar_table_2.py new file mode 100644 index 00000000..06e2a27a --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/September2021_bar_table_2.py @@ -0,0 +1,103 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +month_as_of_now = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep"] + +deaths = [[14, 30, 18, 28, 31, 31], # January + [9, 25, 20, 18, 31, 39], # February + [13, 15, 18, 36, 21, 28], # March + [11, 15, 21, 24, 23, 25], # April + [10, 21, 22, 22, 37, 34], # May + [9, 17, 24, 23, 29, 20], # June + [7, 23, 22, 27, 18, 16], # July + [10, 21, 27, 13, 17, 15], # August + [13, 20, 32, 22, 26, 29], # September + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2021/01-09)") + +axes.grid(True) # pyplot.grid [1][2] + +axes2.bar(administrative_duty, [96, 187, 204, 213, 233, 237]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [96, 187, 204, 213, 233, 237], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/__init__.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2021/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/April2022_bar_table.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/April2022_bar_table.py new file mode 100644 index 00000000..b4f5ee30 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/April2022_bar_table.py @@ -0,0 +1,105 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr"] + +deaths = [[13, 23, 29, 28, 24, 23], # January + [7, 16, 20, 24, 20, 30], # February + [9, 29, 14, 27, 34, 43], # March + [8, 23, 23, 23, 27, 30], # April + ] + +df = pd.DataFrame(data=deaths, + index=month, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2022/01-04)") + +axes.grid(True) # pyplot.grid [1][2] + +# Count the grand total automatically +sum_TPE = deaths[0][0] + deaths[1][0] + deaths[2][0] + deaths[3][0] +sum_NTP = deaths[0][1] + deaths[1][1] + deaths[2][1] + deaths[3][1] +sum_TAO = deaths[0][2] + deaths[1][2] + deaths[2][2] + deaths[3][2] +sum_TCH = deaths[0][3] + deaths[1][3] + deaths[2][3] + deaths[3][3] +sum_TNA = deaths[0][4] + deaths[1][4] + deaths[2][4] + deaths[3][4] +sum_KAO = deaths[0][5] + deaths[1][5] + deaths[2][5] + deaths[3][5] + + +axes2.bar(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/August.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/August.py new file mode 100644 index 00000000..09273361 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/August.py @@ -0,0 +1,118 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug"] + +deaths = [[13, 23, 29, 28, 24, 23], # January + [7, 16, 20, 24, 20, 30], # February + [9, 29, 14, 27, 34, 43], # March + [8, 25, 23, 23, 27, 31], # April + [7, 34, 16, 27, 27, 27], # May + [4, 25, 27, 15, 23, 26], # June + [4, 27, 16, 24, 28, 31], # July + [6, 26, 20, 31, 22, 33], # August + ] + +df = pd.DataFrame(data=deaths, + index=month, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2022/01-08)") + +axes.grid(True) # pyplot.grid [1][2] + +# Count the grand total automatically +sum_TPE = deaths[0][0] + deaths[1][0] + deaths[2][0] + deaths[3][0] + deaths[4][0] + deaths[5][0] + deaths[6][0] + deaths[7][0] +sum_NTP = deaths[0][1] + deaths[1][1] + deaths[2][1] + deaths[3][1] + deaths[4][1] + deaths[5][1] + deaths[6][1] + deaths[7][1] +sum_TAO = deaths[0][2] + deaths[1][2] + deaths[2][2] + deaths[3][2] + deaths[4][2] + deaths[5][2] + deaths[6][2] + deaths[7][2] +sum_TCH = deaths[0][3] + deaths[1][3] + deaths[2][3] + deaths[3][3] + deaths[4][3] + deaths[5][3] + deaths[6][3] + deaths[7][3] +sum_TNA = deaths[0][4] + deaths[1][4] + deaths[2][4] + deaths[3][4] + deaths[4][4] + deaths[5][4] + deaths[6][4] + deaths[7][4] +sum_KAO = deaths[0][5] + deaths[1][5] + deaths[2][5] + deaths[3][5] + deaths[4][5] + deaths[5][5] + deaths[6][5] + deaths[7][5] + + +axes2.bar(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=100, yo=700, alpha=0.9) + +# Insert text watermark +plt.text(x=0.6, y=0.5, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='20', transform=axes2.transAxes) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/CC-BY.png b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/December.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/December.py new file mode 100644 index 00000000..ee788f23 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/December.py @@ -0,0 +1,122 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sep", "Oct", "Nov", "Dec"] + +deaths = [[13, 23, 29, 28, 24, 23], # January + [7, 16, 20, 24, 20, 30], # February + [9, 29, 14, 27, 34, 43], # March + [8, 25, 23, 23, 27, 31], # April + [7, 34, 16, 27, 27, 27], # May + [4, 25, 27, 15, 23, 26], # June + [4, 27, 16, 24, 28, 31], # July + [6, 26, 20, 31, 22, 33], # August + [15, 31, 30, 33, 22, 23], # September + [14, 27, 16, 22, 21, 41], # October + [10, 19, 23, 28, 33, 34], # November + [10, 25, 29, 26, 31, 31], # December + ] + +df = pd.DataFrame(data=deaths, + index=month, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2022/01-12)") + +axes.grid(True) # pyplot.grid [1][2] + +# Count the grand total automatically +sum_TPE = deaths[0][0] + deaths[1][0] + deaths[2][0] + deaths[3][0] + deaths[4][0] + deaths[5][0] + deaths[6][0] + deaths[7][0] + deaths[8][0] + deaths[9][0] + deaths[10][0] + deaths[11][0] +sum_NTP = deaths[0][1] + deaths[1][1] + deaths[2][1] + deaths[3][1] + deaths[4][1] + deaths[5][1] + deaths[6][1] + deaths[7][1] + deaths[8][1] + deaths[9][1] + deaths[10][1] + deaths[11][1] +sum_TAO = deaths[0][2] + deaths[1][2] + deaths[2][2] + deaths[3][2] + deaths[4][2] + deaths[5][2] + deaths[6][2] + deaths[7][2] + deaths[8][2] + deaths[9][2] + deaths[10][2] + deaths[11][2] +sum_TCH = deaths[0][3] + deaths[1][3] + deaths[2][3] + deaths[3][3] + deaths[4][3] + deaths[5][3] + deaths[6][3] + deaths[7][3] + deaths[8][3] + deaths[9][3] + deaths[10][3] + deaths[11][3] +sum_TNA = deaths[0][4] + deaths[1][4] + deaths[2][4] + deaths[3][4] + deaths[4][4] + deaths[5][4] + deaths[6][4] + deaths[7][4] + deaths[8][4] + deaths[9][4] + deaths[10][4] + deaths[11][4] +sum_KAO = deaths[0][5] + deaths[1][5] + deaths[2][5] + deaths[3][5] + deaths[4][5] + deaths[5][5] + deaths[6][5] + deaths[7][5] + deaths[8][5] + deaths[9][5] + deaths[10][5] + deaths[11][5] + + +axes2.bar(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=100, yo=700, alpha=0.9) + +# Insert text watermark +plt.text(x=0.6, y=0.5, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='20', transform=axes2.transAxes) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/February2022_bar_table.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/February2022_bar_table.py new file mode 100644 index 00000000..7f81d5ba --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/February2022_bar_table.py @@ -0,0 +1,96 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb"] + +month_as_of_now = ["Jan", "Feb"] + +deaths = [[13, 23, 29, 28, 24, 23], # January + [7, 16, 20, 24, 19, 30], # February + ] + +df = pd.DataFrame(data=deaths, + index=month_as_of_now, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month_as_of_now))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month_as_of_now, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2022/01-02)") + +axes.grid(True) # pyplot.grid [1][2] + +axes2.bar(administrative_duty, [20, 39, 49, 52, 43, 53]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [20, 39, 49, 52, 43, 53], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/July_watermark.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/July_watermark.py new file mode 100644 index 00000000..867dcc2f --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/July_watermark.py @@ -0,0 +1,117 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "June", "July"] + +deaths = [[13, 23, 29, 28, 24, 23], # January + [7, 16, 20, 24, 20, 30], # February + [9, 29, 14, 27, 34, 43], # March + [8, 25, 23, 23, 27, 31], # April + [7, 34, 16, 27, 27, 27], # May + [4, 25, 27, 15, 23, 26], # June + [4, 27, 16, 23, 28, 31], # July + ] + +df = pd.DataFrame(data=deaths, + index=month, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2022/01-07)") + +axes.grid(True) # pyplot.grid [1][2] + +# Count the grand total automatically +sum_TPE = deaths[0][0] + deaths[1][0] + deaths[2][0] + deaths[3][0] + deaths[4][0] + deaths[5][0] + deaths[6][0] +sum_NTP = deaths[0][1] + deaths[1][1] + deaths[2][1] + deaths[3][1] + deaths[4][1] + deaths[5][1] + deaths[6][1] +sum_TAO = deaths[0][2] + deaths[1][2] + deaths[2][2] + deaths[3][2] + deaths[4][2] + deaths[5][2] + deaths[6][2] +sum_TCH = deaths[0][3] + deaths[1][3] + deaths[2][3] + deaths[3][3] + deaths[4][3] + deaths[5][3] + deaths[6][3] +sum_TNA = deaths[0][4] + deaths[1][4] + deaths[2][4] + deaths[3][4] + deaths[4][4] + deaths[5][4] + deaths[6][4] +sum_KAO = deaths[0][5] + deaths[1][5] + deaths[2][5] + deaths[3][5] + deaths[4][5] + deaths[5][5] + deaths[6][5] + + +axes2.bar(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=100, yo=700, alpha=0.9) + +# Insert text watermark +plt.text(x=0.6, y=0.5, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='20', transform=axes2.transAxes) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/June_watermark.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/June_watermark.py new file mode 100644 index 00000000..ab27c4e1 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/June_watermark.py @@ -0,0 +1,116 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "June"] + +deaths = [[13, 23, 29, 28, 24, 23], # January + [7, 16, 20, 24, 20, 30], # February + [9, 29, 14, 27, 34, 43], # March + [8, 25, 23, 23, 27, 31], # April + [7, 34, 16, 27, 27, 27], # May + [4, 27, 27, 15, 23, 26], # June + ] + +df = pd.DataFrame(data=deaths, + index=month, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2022/01-06)") + +axes.grid(True) # pyplot.grid [1][2] + +# Count the grand total automatically +sum_TPE = deaths[0][0] + deaths[1][0] + deaths[2][0] + deaths[3][0] + deaths[4][0] + deaths[5][0] +sum_NTP = deaths[0][1] + deaths[1][1] + deaths[2][1] + deaths[3][1] + deaths[4][1] + deaths[5][1] +sum_TAO = deaths[0][2] + deaths[1][2] + deaths[2][2] + deaths[3][2] + deaths[4][2] + deaths[5][2] +sum_TCH = deaths[0][3] + deaths[1][3] + deaths[2][3] + deaths[3][3] + deaths[4][3] + deaths[5][3] +sum_TNA = deaths[0][4] + deaths[1][4] + deaths[2][4] + deaths[3][4] + deaths[4][4] + deaths[5][4] +sum_KAO = deaths[0][5] + deaths[1][5] + deaths[2][5] + deaths[3][5] + deaths[4][5] + deaths[5][5] + + +axes2.bar(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=100, yo=700, alpha=0.9) + +# Insert text watermark +plt.text(x=0.6, y=0.5, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='20', transform=axes2.transAxes) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/March2022_bar_table.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/March2022_bar_table.py new file mode 100644 index 00000000..3f20c142 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/March2022_bar_table.py @@ -0,0 +1,104 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar"] + +deaths = [[13, 23, 29, 28, 24, 23], # January + [7, 16, 20, 24, 20, 30], # February + [9, 29, 14, 27, 34, 43], # March + ] + +df = pd.DataFrame(data=deaths, + index=month, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2022/01-03)") + +axes.grid(True) # pyplot.grid [1][2] + +# Count the grand total automatically +sum_TPE = deaths[0][0] + deaths[1][0] + deaths[2][0] +sum_NTP = deaths[0][1] + deaths[1][1] + deaths[2][1] +sum_TAO = deaths[0][2] + deaths[1][2] + deaths[2][2] +sum_TCH = deaths[0][3] + deaths[1][3] + deaths[2][3] +sum_TNA = deaths[0][4] + deaths[1][4] + deaths[2][4] +sum_KAO = deaths[0][5] + deaths[1][5] + deaths[2][5] + + +axes2.bar(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/May_bar_table.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/May_bar_table.py new file mode 100644 index 00000000..b428a4e3 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/May_bar_table.py @@ -0,0 +1,106 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May"] + +deaths = [[13, 23, 29, 28, 24, 23], # January + [7, 16, 20, 24, 20, 30], # February + [9, 29, 14, 27, 34, 43], # March + [8, 25, 23, 23, 27, 31], # April + [7, 33, 16, 27, 27, 27], # May + ] + +df = pd.DataFrame(data=deaths, + index=month, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2022/01-05)") + +axes.grid(True) # pyplot.grid [1][2] + +# Count the grand total automatically +sum_TPE = deaths[0][0] + deaths[1][0] + deaths[2][0] + deaths[3][0] + deaths[4][0] +sum_NTP = deaths[0][1] + deaths[1][1] + deaths[2][1] + deaths[3][1] + deaths[4][1] +sum_TAO = deaths[0][2] + deaths[1][2] + deaths[2][2] + deaths[3][2] + deaths[4][2] +sum_TCH = deaths[0][3] + deaths[1][3] + deaths[2][3] + deaths[3][3] + deaths[4][3] +sum_TNA = deaths[0][4] + deaths[1][4] + deaths[2][4] + deaths[3][4] + deaths[4][4] +sum_KAO = deaths[0][5] + deaths[1][5] + deaths[2][5] + deaths[3][5] + deaths[4][5] + + +axes2.bar(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/May_bar_table_watermark.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/May_bar_table_watermark.py new file mode 100644 index 00000000..b7597ca5 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/May_bar_table_watermark.py @@ -0,0 +1,111 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May"] + +deaths = [[13, 23, 29, 28, 24, 23], # January + [7, 16, 20, 24, 20, 30], # February + [9, 29, 14, 27, 34, 43], # March + [8, 25, 23, 23, 27, 31], # April + [7, 33, 16, 27, 27, 27], # May + ] + +df = pd.DataFrame(data=deaths, + index=month, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2022/01-05)") + +axes.grid(True) # pyplot.grid [1][2] + +# Count the grand total automatically +sum_TPE = deaths[0][0] + deaths[1][0] + deaths[2][0] + deaths[3][0] + deaths[4][0] +sum_NTP = deaths[0][1] + deaths[1][1] + deaths[2][1] + deaths[3][1] + deaths[4][1] +sum_TAO = deaths[0][2] + deaths[1][2] + deaths[2][2] + deaths[3][2] + deaths[4][2] +sum_TCH = deaths[0][3] + deaths[1][3] + deaths[2][3] + deaths[3][3] + deaths[4][3] +sum_TNA = deaths[0][4] + deaths[1][4] + deaths[2][4] + deaths[3][4] + deaths[4][4] +sum_KAO = deaths[0][5] + deaths[1][5] + deaths[2][5] + deaths[3][5] + deaths[4][5] + + +axes2.bar(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=700, yo=700, alpha=0.9) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/May_bar_table_watermark2.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/May_bar_table_watermark2.py new file mode 100644 index 00000000..ed2da31b --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/May_bar_table_watermark2.py @@ -0,0 +1,111 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May"] + +deaths = [[13, 23, 29, 28, 24, 23], # January + [7, 16, 20, 24, 20, 30], # February + [9, 29, 14, 27, 34, 43], # March + [8, 25, 23, 23, 27, 31], # April + [7, 33, 16, 27, 27, 27], # May + ] + +df = pd.DataFrame(data=deaths, + index=month, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2022/01-05)") + +axes.grid(True) # pyplot.grid [1][2] + +# Count the grand total automatically +sum_TPE = deaths[0][0] + deaths[1][0] + deaths[2][0] + deaths[3][0] + deaths[4][0] +sum_NTP = deaths[0][1] + deaths[1][1] + deaths[2][1] + deaths[3][1] + deaths[4][1] +sum_TAO = deaths[0][2] + deaths[1][2] + deaths[2][2] + deaths[3][2] + deaths[4][2] +sum_TCH = deaths[0][3] + deaths[1][3] + deaths[2][3] + deaths[3][3] + deaths[4][3] +sum_TNA = deaths[0][4] + deaths[1][4] + deaths[2][4] + deaths[3][4] + deaths[4][4] +sum_KAO = deaths[0][5] + deaths[1][5] + deaths[2][5] + deaths[3][5] + deaths[4][5] + + +axes2.bar(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=100, yo=700, alpha=0.9) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/September.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/September.py new file mode 100644 index 00000000..944f591f --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/September.py @@ -0,0 +1,119 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sep"] + +deaths = [[13, 23, 29, 28, 24, 23], # January + [7, 16, 20, 24, 20, 30], # February + [9, 29, 14, 27, 34, 43], # March + [8, 25, 23, 23, 27, 31], # April + [7, 34, 16, 27, 27, 27], # May + [4, 25, 27, 15, 23, 26], # June + [4, 27, 16, 24, 28, 31], # July + [6, 26, 20, 31, 22, 33], # August + [14, 31, 30, 33, 22, 23], # September + ] + +df = pd.DataFrame(data=deaths, + index=month, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2022/01-09)") + +axes.grid(True) # pyplot.grid [1][2] + +# Count the grand total automatically +sum_TPE = deaths[0][0] + deaths[1][0] + deaths[2][0] + deaths[3][0] + deaths[4][0] + deaths[5][0] + deaths[6][0] + deaths[7][0] + deaths[8][0] +sum_NTP = deaths[0][1] + deaths[1][1] + deaths[2][1] + deaths[3][1] + deaths[4][1] + deaths[5][1] + deaths[6][1] + deaths[7][1] + deaths[8][1] +sum_TAO = deaths[0][2] + deaths[1][2] + deaths[2][2] + deaths[3][2] + deaths[4][2] + deaths[5][2] + deaths[6][2] + deaths[7][2] + deaths[8][2] +sum_TCH = deaths[0][3] + deaths[1][3] + deaths[2][3] + deaths[3][3] + deaths[4][3] + deaths[5][3] + deaths[6][3] + deaths[7][3] + deaths[8][3] +sum_TNA = deaths[0][4] + deaths[1][4] + deaths[2][4] + deaths[3][4] + deaths[4][4] + deaths[5][4] + deaths[6][4] + deaths[7][4] + deaths[8][4] +sum_KAO = deaths[0][5] + deaths[1][5] + deaths[2][5] + deaths[3][5] + deaths[4][5] + deaths[5][5] + deaths[6][5] + deaths[7][5] + deaths[8][5] + + +axes2.bar(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=100, yo=700, alpha=0.9) + +# Insert text watermark +plt.text(x=0.6, y=0.5, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='20', transform=axes2.transAxes) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/__init__.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2022/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/April.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/April.py new file mode 100644 index 00000000..a137d640 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/April.py @@ -0,0 +1,114 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "April"] + +deaths = [[8, 25, 26, 25, 30, 25], # January + [14, 18, 15, 17, 31, 27], # February + [17, 34, 24, 34, 21, 31], # March + [6, 22, 17, 40, 21, 21], # April + ] + +df = pd.DataFrame(data=deaths, + index=month, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2023/01-04)") + +axes.grid(True) # pyplot.grid [1][2] + +# Count the grand total automatically +sum_TPE = deaths[0][0] + deaths[1][0] + deaths[2][0] + deaths[3][0] # + deaths[4][0] + deaths[5][0] + deaths[6][0] + deaths[7][0] + deaths[8][0] + deaths[9][0] + deaths[10][0] + deaths[11][0] +sum_NTP = deaths[0][1] + deaths[1][1] + deaths[2][1] + deaths[3][1] # + deaths[4][1] + deaths[5][1] + deaths[6][1] + deaths[7][1] + deaths[8][1] + deaths[9][1] + deaths[10][1] + deaths[11][1] +sum_TAO = deaths[0][2] + deaths[1][2] + deaths[2][2] + deaths[3][2] # + deaths[4][2] + deaths[5][2] + deaths[6][2] + deaths[7][2] + deaths[8][2] + deaths[9][2] + deaths[10][2] + deaths[11][2] +sum_TCH = deaths[0][3] + deaths[1][3] + deaths[2][3] + deaths[3][3] # + deaths[4][3] + deaths[5][3] + deaths[6][3] + deaths[7][3] + deaths[8][3] + deaths[9][3] + deaths[10][3] + deaths[11][3] +sum_TNA = deaths[0][4] + deaths[1][4] + deaths[2][4] + deaths[3][4] # + deaths[4][4] + deaths[5][4] + deaths[6][4] + deaths[7][4] + deaths[8][4] + deaths[9][4] + deaths[10][4] + deaths[11][4] +sum_KAO = deaths[0][5] + deaths[1][5] + deaths[2][5] + deaths[3][5] # + deaths[4][5] + deaths[5][5] + deaths[6][5] + deaths[7][5] + deaths[8][5] + deaths[9][5] + deaths[10][5] + deaths[11][5] + + +axes2.bar(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=100, yo=700, alpha=0.9) + +# Insert text watermark +plt.text(x=0.6, y=0.5, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=20, transform=axes2.transAxes) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/August.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/August.py new file mode 100644 index 00000000..ab31b19f --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/August.py @@ -0,0 +1,118 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "April", "May", "June", "July", "August"] + +deaths = [[8, 25, 26, 25, 30, 25], # January + [14, 18, 15, 17, 31, 27], # February + [17, 34, 24, 34, 21, 31], # March + [6, 22, 17, 40, 21, 21], # April + [13, 16, 19, 28, 21, 33], # May + [6, 13, 13, 34, 24, 21], # June + [9, 21, 18, 23, 20, 25], # July + [6, 19, 17, 13, 24, 21], # August + ] + +df = pd.DataFrame(data=deaths, + index=month, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2023/01-08)") + +axes.grid(True) # pyplot.grid [1][2] + +# Count the grand total automatically +sum_TPE = deaths[0][0] + deaths[1][0] + deaths[2][0] + deaths[3][0] + deaths[4][0] + deaths[5][0] + deaths[6][0] + deaths[7][0] # + deaths[8][0] + deaths[9][0] + deaths[10][0] + deaths[11][0] +sum_NTP = deaths[0][1] + deaths[1][1] + deaths[2][1] + deaths[3][1] + deaths[4][1] + deaths[5][1] + deaths[6][1] + deaths[7][1] # + deaths[8][1] + deaths[9][1] + deaths[10][1] + deaths[11][1] +sum_TAO = deaths[0][2] + deaths[1][2] + deaths[2][2] + deaths[3][2] + deaths[4][2] + deaths[5][2] + deaths[6][2] + deaths[7][2] # + deaths[8][2] + deaths[9][2] + deaths[10][2] + deaths[11][2] +sum_TCH = deaths[0][3] + deaths[1][3] + deaths[2][3] + deaths[3][3] + deaths[4][3] + deaths[5][3] + deaths[6][3] + deaths[7][3] # + deaths[8][3] + deaths[9][3] + deaths[10][3] + deaths[11][3] +sum_TNA = deaths[0][4] + deaths[1][4] + deaths[2][4] + deaths[3][4] + deaths[4][4] + deaths[5][4] + deaths[6][4] + deaths[7][4] # + deaths[8][4] + deaths[9][4] + deaths[10][4] + deaths[11][4] +sum_KAO = deaths[0][5] + deaths[1][5] + deaths[2][5] + deaths[3][5] + deaths[4][5] + deaths[5][5] + deaths[6][5] + deaths[7][5] # + deaths[8][5] + deaths[9][5] + deaths[10][5] + deaths[11][5] + + +axes2.bar(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=100, yo=700, alpha=0.9) + +# Insert text watermark +plt.text(x=0.6, y=0.5, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=20, transform=axes2.transAxes) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/CC-BY.png b/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/December.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/December.py new file mode 100644 index 00000000..9f805a78 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/December.py @@ -0,0 +1,122 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "April", "May", "June", "July", "Aug", "Sep", "Oct", "Nov", "Dec"] + +deaths = [[8, 25, 26, 25, 30, 25], # January + [14, 18, 15, 17, 31, 27], # February + [17, 34, 24, 34, 21, 31], # March + [6, 22, 17, 40, 21, 21], # April + [13, 16, 19, 28, 21, 33], # May + [6, 13, 13, 34, 24, 21], # June + [9, 21, 18, 23, 20, 25], # July + [6, 19, 17, 13, 24, 21], # August + [5, 20, 19, 20, 27, 25], # September + [10, 31, 25, 32, 31, 24], # October + [7, 27, 30, 26, 21, 35], # November + [8, 18, 25, 23, 25, 29], # December + ] + +df = pd.DataFrame(data=deaths, + index=month, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2023/01-12)") + +axes.grid(True) # pyplot.grid [1][2] + +# Count the grand total automatically +sum_TPE = deaths[0][0] + deaths[1][0] + deaths[2][0] + deaths[3][0] + deaths[4][0] + deaths[5][0] + deaths[6][0] + deaths[7][0] + deaths[8][0] + deaths[9][0] + deaths[10][0] + deaths[11][0] +sum_NTP = deaths[0][1] + deaths[1][1] + deaths[2][1] + deaths[3][1] + deaths[4][1] + deaths[5][1] + deaths[6][1] + deaths[7][1] + deaths[8][1] + deaths[9][1] + deaths[10][1] + deaths[11][1] +sum_TAO = deaths[0][2] + deaths[1][2] + deaths[2][2] + deaths[3][2] + deaths[4][2] + deaths[5][2] + deaths[6][2] + deaths[7][2] + deaths[8][2] + deaths[9][2] + deaths[10][2] + deaths[11][2] +sum_TCH = deaths[0][3] + deaths[1][3] + deaths[2][3] + deaths[3][3] + deaths[4][3] + deaths[5][3] + deaths[6][3] + deaths[7][3] + deaths[8][3] + deaths[9][3] + deaths[10][3] + deaths[11][3] +sum_TNA = deaths[0][4] + deaths[1][4] + deaths[2][4] + deaths[3][4] + deaths[4][4] + deaths[5][4] + deaths[6][4] + deaths[7][4] + deaths[8][4] + deaths[9][4] + deaths[10][4] + deaths[11][4] +sum_KAO = deaths[0][5] + deaths[1][5] + deaths[2][5] + deaths[3][5] + deaths[4][5] + deaths[5][5] + deaths[6][5] + deaths[7][5] + deaths[8][5] + deaths[9][5] + deaths[10][5] + deaths[11][5] + + +axes2.bar(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=100, yo=700, alpha=0.9) + +# Insert text watermark +plt.text(x=0.6, y=0.5, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=20, transform=axes2.transAxes) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/June.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/June.py new file mode 100644 index 00000000..10cdf94b --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/June.py @@ -0,0 +1,116 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "April", "May", "June"] + +deaths = [[8, 25, 26, 25, 30, 25], # January + [14, 18, 15, 17, 31, 27], # February + [17, 34, 24, 34, 21, 31], # March + [6, 22, 17, 40, 21, 21], # April + [13, 16, 19, 28, 21, 33], # May + [6, 13, 13, 34, 24, 21], # June + ] + +df = pd.DataFrame(data=deaths, + index=month, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2023/01-06)") + +axes.grid(True) # pyplot.grid [1][2] + +# Count the grand total automatically +sum_TPE = deaths[0][0] + deaths[1][0] + deaths[2][0] + deaths[3][0] + deaths[4][0] + deaths[5][0] # + deaths[6][0] + deaths[7][0] + deaths[8][0] + deaths[9][0] + deaths[10][0] + deaths[11][0] +sum_NTP = deaths[0][1] + deaths[1][1] + deaths[2][1] + deaths[3][1] + deaths[4][1] + deaths[5][1] # + deaths[6][1] + deaths[7][1] + deaths[8][1] + deaths[9][1] + deaths[10][1] + deaths[11][1] +sum_TAO = deaths[0][2] + deaths[1][2] + deaths[2][2] + deaths[3][2] + deaths[4][2] + deaths[5][2] # + deaths[6][2] + deaths[7][2] + deaths[8][2] + deaths[9][2] + deaths[10][2] + deaths[11][2] +sum_TCH = deaths[0][3] + deaths[1][3] + deaths[2][3] + deaths[3][3] + deaths[4][3] + deaths[5][3] # + deaths[6][3] + deaths[7][3] + deaths[8][3] + deaths[9][3] + deaths[10][3] + deaths[11][3] +sum_TNA = deaths[0][4] + deaths[1][4] + deaths[2][4] + deaths[3][4] + deaths[4][4] + deaths[5][4] # + deaths[6][4] + deaths[7][4] + deaths[8][4] + deaths[9][4] + deaths[10][4] + deaths[11][4] +sum_KAO = deaths[0][5] + deaths[1][5] + deaths[2][5] + deaths[3][5] + deaths[4][5] + deaths[5][5] # + deaths[6][5] + deaths[7][5] + deaths[8][5] + deaths[9][5] + deaths[10][5] + deaths[11][5] + + +axes2.bar(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=100, yo=700, alpha=0.9) + +# Insert text watermark +plt.text(x=0.6, y=0.5, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=20, transform=axes2.transAxes) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/March.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/March.py new file mode 100644 index 00000000..8edd675f --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/March.py @@ -0,0 +1,113 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar"] + +deaths = [[8, 25, 26, 25, 30, 25], # January + [15, 18, 15, 17, 31, 27], # February + [17, 34, 24, 34, 21, 30], # March + ] + +df = pd.DataFrame(data=deaths, + index=month, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2023/01-03)") + +axes.grid(True) # pyplot.grid [1][2] + +# Count the grand total automatically +sum_TPE = deaths[0][0] + deaths[1][0] + deaths[2][0] # + deaths[3][0] + deaths[4][0] + deaths[5][0] + deaths[6][0] + deaths[7][0] + deaths[8][0] + deaths[9][0] + deaths[10][0] + deaths[11][0] +sum_NTP = deaths[0][1] + deaths[1][1] + deaths[2][1] # + deaths[3][1] + deaths[4][1] + deaths[5][1] + deaths[6][1] + deaths[7][1] + deaths[8][1] + deaths[9][1] + deaths[10][1] + deaths[11][1] +sum_TAO = deaths[0][2] + deaths[1][2] + deaths[2][2] # + deaths[3][2] + deaths[4][2] + deaths[5][2] + deaths[6][2] + deaths[7][2] + deaths[8][2] + deaths[9][2] + deaths[10][2] + deaths[11][2] +sum_TCH = deaths[0][3] + deaths[1][3] + deaths[2][3] # + deaths[3][3] + deaths[4][3] + deaths[5][3] + deaths[6][3] + deaths[7][3] + deaths[8][3] + deaths[9][3] + deaths[10][3] + deaths[11][3] +sum_TNA = deaths[0][4] + deaths[1][4] + deaths[2][4] # + deaths[3][4] + deaths[4][4] + deaths[5][4] + deaths[6][4] + deaths[7][4] + deaths[8][4] + deaths[9][4] + deaths[10][4] + deaths[11][4] +sum_KAO = deaths[0][5] + deaths[1][5] + deaths[2][5] # + deaths[3][5] + deaths[4][5] + deaths[5][5] + deaths[6][5] + deaths[7][5] + deaths[8][5] + deaths[9][5] + deaths[10][5] + deaths[11][5] + + +axes2.bar(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=100, yo=700, alpha=0.9) + +# Insert text watermark +plt.text(x=0.6, y=0.5, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='20', transform=axes2.transAxes) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/November.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/November.py new file mode 100644 index 00000000..576a3042 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/November.py @@ -0,0 +1,121 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb", "Mar", "April", "May", "June", "July", "Aug", "Sep", "Oct", "Nov"] + +deaths = [[8, 25, 26, 25, 30, 25], # January + [14, 18, 15, 17, 31, 27], # February + [17, 34, 24, 34, 21, 31], # March + [6, 22, 17, 40, 21, 21], # April + [13, 16, 19, 28, 21, 33], # May + [6, 13, 13, 34, 24, 21], # June + [9, 21, 18, 23, 20, 25], # July + [6, 19, 17, 13, 24, 21], # August + [5, 20, 19, 20, 27, 25], # September + [10, 31, 25, 32, 31, 24], # October + [7, 27, 27, 26, 17, 34], # November + ] + +df = pd.DataFrame(data=deaths, + index=month, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2023/01-11)") + +axes.grid(True) # pyplot.grid [1][2] + +# Count the grand total automatically +sum_TPE = deaths[0][0] + deaths[1][0] + deaths[2][0] + deaths[3][0] + deaths[4][0] + deaths[5][0] + deaths[6][0] + deaths[7][0] + deaths[8][0] + deaths[9][0] + deaths[10][0] # + deaths[11][0] +sum_NTP = deaths[0][1] + deaths[1][1] + deaths[2][1] + deaths[3][1] + deaths[4][1] + deaths[5][1] + deaths[6][1] + deaths[7][1] + deaths[8][1] + deaths[9][1] + deaths[10][1] # + deaths[11][1] +sum_TAO = deaths[0][2] + deaths[1][2] + deaths[2][2] + deaths[3][2] + deaths[4][2] + deaths[5][2] + deaths[6][2] + deaths[7][2] + deaths[8][2] + deaths[9][2] + deaths[10][2] # + deaths[11][2] +sum_TCH = deaths[0][3] + deaths[1][3] + deaths[2][3] + deaths[3][3] + deaths[4][3] + deaths[5][3] + deaths[6][3] + deaths[7][3] + deaths[8][3] + deaths[9][3] + deaths[10][3] # + deaths[11][3] +sum_TNA = deaths[0][4] + deaths[1][4] + deaths[2][4] + deaths[3][4] + deaths[4][4] + deaths[5][4] + deaths[6][4] + deaths[7][4] + deaths[8][4] + deaths[9][4] + deaths[10][4] # + deaths[11][4] +sum_KAO = deaths[0][5] + deaths[1][5] + deaths[2][5] + deaths[3][5] + deaths[4][5] + deaths[5][5] + deaths[6][5] + deaths[7][5] + deaths[8][5] + deaths[9][5] + deaths[10][5] # + deaths[11][5] + + +axes2.bar(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=100, yo=700, alpha=0.9) + +# Insert text watermark +plt.text(x=0.6, y=0.5, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=20, transform=axes2.transAxes) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/__init__.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2023/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2024/CC-BY.png b/The attainments and realizations of my dreams/Road safety/Month_over_month_2024/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Road safety/Month_over_month_2024/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2024/February.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2024/February.py new file mode 100644 index 00000000..10bfdc1e --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2024/February.py @@ -0,0 +1,112 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan", "Feb"] + +deaths = [[8, 24, 25, 28, 21, 38], # January + [13, 24, 26, 24, 27, 23], # February + ] + +df = pd.DataFrame(data=deaths, + index=month, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2024/02)") + +axes.grid(True) # pyplot.grid [1][2] + +# Count the grand total automatically +sum_TPE = deaths[0][0] + deaths[1][0] # + deaths[2][0] + deaths[3][0] + deaths[4][0] + deaths[5][0] + deaths[6][0] + deaths[7][0] + deaths[8][0] + deaths[9][0] + deaths[10][0] + deaths[11][0] +sum_NTP = deaths[0][1] + deaths[1][1] # + deaths[2][1] + deaths[3][1] + deaths[4][1] + deaths[5][1] + deaths[6][1] + deaths[7][1] + deaths[8][1] + deaths[9][1] + deaths[10][1] + deaths[11][1] +sum_TAO = deaths[0][2] + deaths[1][2] # + deaths[2][2] + deaths[3][2] + deaths[4][2] + deaths[5][2] + deaths[6][2] + deaths[7][2] + deaths[8][2] + deaths[9][2] + deaths[10][2] + deaths[11][2] +sum_TCH = deaths[0][3] + deaths[1][3] # + deaths[2][3] + deaths[3][3] + deaths[4][3] + deaths[5][3] + deaths[6][3] + deaths[7][3] + deaths[8][3] + deaths[9][3] + deaths[10][3] + deaths[11][3] +sum_TNA = deaths[0][4] + deaths[1][4] # + deaths[2][4] + deaths[3][4] + deaths[4][4] + deaths[5][4] + deaths[6][4] + deaths[7][4] + deaths[8][4] + deaths[9][4] + deaths[10][4] + deaths[11][4] +sum_KAO = deaths[0][5] + deaths[1][5] # + deaths[2][5] + deaths[3][5] + deaths[4][5] + deaths[5][5] + deaths[6][5] + deaths[7][5] + deaths[8][5] + deaths[9][5] + deaths[10][5] + deaths[11][5] + + +axes2.bar(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=100, yo=700, alpha=0.9) + +# Insert text watermark +plt.text(x=0.6, y=0.5, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=20, transform=axes2.transAxes) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2024/January.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2024/January.py new file mode 100644 index 00000000..84ea0768 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Month_over_month_2024/January.py @@ -0,0 +1,111 @@ +import matplotlib.cm as cm +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +month = ["Jan"] + +deaths = [[8, 22, 24, 28, 21, 38], # January + ] + +df = pd.DataFrame(data=deaths, + index=month, + columns=administrative_duty) +print(df) + +# Get some pastel shades for the colors[3] + +# Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap.[4] +cmap = cm.get_cmap("YlOrRd") # Colormap reference[5] +colors = cmap(np.linspace(0, 0.5, len(month))) +n_rows = len(deaths) + +index = np.arange(len(administrative_duty)) + 0.3 +bar_width = 0.4 + +figure, (axes, axes2) = plt.subplots(2, figsize=(9, 8)) + +# Initialize the vertical-offset for the stacked bar chart. +y_offset = np.zeros(len(administrative_duty)) + +# Plot bars and create text labels for the table +cell_text = [] +for row in range(n_rows): + plot = axes.bar(index, deaths[row], bar_width, bottom=y_offset, color=colors[row]) + # axes.bar_label(axes.containers[0], label_type='center') + y_offset = y_offset + deaths[row] + cell_text.append([x for x in y_offset]) + + i = 0 + + # Each iteration of this for loop labels each bar with corresponding value for the given year + for rectangle in plot: + height = rectangle.get_height() + axes.text(rectangle.get_x() + rectangle.get_width() / 2, y_offset[i], '%d' % int(y_offset[i]), + horizontalalignment='center', verticalalignment='bottom') + + i = i + 1 + +# Add a table at the bottom of the axes +the_table = axes.table(cellText=cell_text, + rowLabels=month, + rowColours=colors, + colLabels=administrative_duty, + loc='bottom') + +# Adjust layout to make room for the table: +plt.subplots_adjust(left=0.2, bottom=0.2) + +axes.set_ylabel("The number of deaths") +axes.set_xticks([]) +axes.set_title("The Cumulative Number of Deaths in Road Accident\nin Taiwan by Region (2024/01)") + +axes.grid(True) # pyplot.grid [1][2] + +# Count the grand total automatically +sum_TPE = deaths[0][0] # + deaths[1][0] + deaths[2][0] + deaths[3][0] + deaths[4][0] + deaths[5][0] + deaths[6][0] + deaths[7][0] + deaths[8][0] + deaths[9][0] + deaths[10][0] + deaths[11][0] +sum_NTP = deaths[0][1] # + deaths[1][1] + deaths[2][1] + deaths[3][1] + deaths[4][1] + deaths[5][1] + deaths[6][1] + deaths[7][1] + deaths[8][1] + deaths[9][1] + deaths[10][1] + deaths[11][1] +sum_TAO = deaths[0][2] # + deaths[1][2] + deaths[2][2] + deaths[3][2] + deaths[4][2] + deaths[5][2] + deaths[6][2] + deaths[7][2] + deaths[8][2] + deaths[9][2] + deaths[10][2] + deaths[11][2] +sum_TCH = deaths[0][3] # + deaths[1][3] + deaths[2][3] + deaths[3][3] + deaths[4][3] + deaths[5][3] + deaths[6][3] + deaths[7][3] + deaths[8][3] + deaths[9][3] + deaths[10][3] + deaths[11][3] +sum_TNA = deaths[0][4] # + deaths[1][4] + deaths[2][4] + deaths[3][4] + deaths[4][4] + deaths[5][4] + deaths[6][4] + deaths[7][4] + deaths[8][4] + deaths[9][4] + deaths[10][4] + deaths[11][4] +sum_KAO = deaths[0][5] # + deaths[1][5] + deaths[2][5] + deaths[3][5] + deaths[4][5] + deaths[5][5] + deaths[6][5] + deaths[7][5] + deaths[8][5] + deaths[9][5] + deaths[10][5] + deaths[11][5] + + +axes2.bar(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO]) +axes2.bar_label(axes2.containers[0], label_type='edge') +axes2.plot(administrative_duty, [sum_TPE, sum_NTP, sum_TAO, sum_TCH, sum_TNA, sum_KAO], '-o', color='orange') + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.01, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=12, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=100, yo=700, alpha=0.9) + +# Insert text watermark +plt.text(x=0.6, y=0.5, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=20, transform=axes2.transAxes) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html +# 2. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/geo_demo.html#sphx-glr-gallery-subplots-axes-and-figures-geo-demo-py +# 3. https://stackoverflow.com/a/51454824 +# 4. https://matplotlib.org/stable/tutorials/colors/colormaps.html +# 5. https://matplotlib.org/stable/gallery/color/colormap_reference.html + +# Adapted from: https://matplotlib.org/stable/gallery/misc/table_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Month_over_month_2024/__init__.py b/The attainments and realizations of my dreams/Road safety/Month_over_month_2024/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_Year_2023.py b/The attainments and realizations of my dreams/Road safety/Year_over_Year_2023.py new file mode 100644 index 00000000..df923a67 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_Year_2023.py @@ -0,0 +1,124 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + [132, 266, 269, 283, 295, 333], # 2021 + [107, 307, 263, 308, 312, 373], # 2022 + [109, 264, 248, 315, 296, 317], # 2023 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2023)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2, axes3) = plt.subplots(3, figsize=(9, 9)) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +axes3.bar(administrative_duty, summary, color=colour.CSS4_COLORS.get('palegreen'), linewidth=1, ecolor=colour.CSS4_COLORS.get('dodgerblue')) # Create a bar chart and its format. [7][11][12] +axes3.bar_label(axes3.containers[0], label_type='edge', color='r', fontsize=14)# Add a bar label and its format.[9][10] +axes3.plot(administrative_duty, summary, '-o', color='orange') # Add a trend line.[8] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend +# 7. https://matplotlib.org/stable/gallery/ticks_and_spines/custom_ticker1.html#sphx-glr-gallery-ticks-and-spines-custom-ticker1-py +# 8. https://stackoverflow.com/a/48842891 +# 9. https://stackoverflow.com/a/67561982/ +# 10. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html +# 11. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bar.html#matplotlib.axes.Axes.bar +# 12. https://matplotlib.org/stable/gallery/color/named_colors.html diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year.py b/The attainments and realizations of my dreams/Road safety/Year_over_year.py new file mode 100644 index 00000000..8d2b471c --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year.py @@ -0,0 +1,29 @@ +import pandas as pd +import matplotlib.pyplot as plt + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "2021/01-07"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +df.plot(grid=True) + +plt.show() diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2008-2021.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2008-2021.py new file mode 100644 index 00000000..918dd5e1 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2008-2021.py @@ -0,0 +1,123 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2008", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21"] + +death = [[115, 261, 226, 371, 371, 398], # 2008 + [133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + [132, 266, 269, 283, 295, 333], # 2021 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2008-2021)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2, axes3) = plt.subplots(3, figsize=(9, 9)) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +axes3.bar(administrative_duty, summary, color=colour.CSS4_COLORS.get('palegreen'), linewidth=1, ecolor=colour.CSS4_COLORS.get('dodgerblue')) # Create a bar chart and its format. [7][11][12] +axes3.bar_label(axes3.containers[0], label_type='edge', color='r', fontsize=14)# Add a bar label and its format.[9][10] +axes3.plot(administrative_duty, summary, '-o', color='orange') # Add a trend line.[8] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend +# 7. https://matplotlib.org/stable/gallery/ticks_and_spines/custom_ticker1.html#sphx-glr-gallery-ticks-and-spines-custom-ticker1-py +# 8. https://stackoverflow.com/a/48842891 +# 9. https://stackoverflow.com/a/67561982/ +# 10. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html +# 11. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bar.html#matplotlib.axes.Axes.bar +# 12. https://matplotlib.org/stable/gallery/color/named_colors.html diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2008-2021_watermark.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2008-2021_watermark.py new file mode 100644 index 00000000..573fabf7 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2008-2021_watermark.py @@ -0,0 +1,128 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2008", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21"] + +death = [[115, 261, 226, 371, 371, 398], # 2008 + [133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + [132, 266, 269, 283, 295, 333], # 2021 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2008-2021)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2, axes3) = plt.subplots(3, figsize=(9, 9)) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +axes3.bar(administrative_duty, summary, color=colour.CSS4_COLORS.get('palegreen'), linewidth=1, ecolor=colour.CSS4_COLORS.get('dodgerblue')) # Create a bar chart and its format. [7][11][12] +axes3.bar_label(axes3.containers[0], label_type='edge', color='r', fontsize=14)# Add a bar label and its format.[9][10] +axes3.plot(administrative_duty, summary, '-o', color='orange') # Add a trend line.[8] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend +# 7. https://matplotlib.org/stable/gallery/ticks_and_spines/custom_ticker1.html#sphx-glr-gallery-ticks-and-spines-custom-ticker1-py +# 8. https://stackoverflow.com/a/48842891 +# 9. https://stackoverflow.com/a/67561982/ +# 10. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html +# 11. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bar.html#matplotlib.axes.Axes.bar +# 12. https://matplotlib.org/stable/gallery/color/named_colors.html diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2008-2022.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2008-2022.py new file mode 100644 index 00000000..decbe558 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2008-2022.py @@ -0,0 +1,129 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2008", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22"] + +death = [[115, 261, 226, 371, 371, 398], # 2008 + [133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + [132, 266, 269, 283, 295, 333], # 2021 + [52, 179, 145, 167, 183, 211], # 2022 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2008-2022/7)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2, axes3) = plt.subplots(3, figsize=(9, 9)) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +axes3.bar(administrative_duty, summary, color=colour.CSS4_COLORS.get('palegreen'), linewidth=1, ecolor=colour.CSS4_COLORS.get('dodgerblue')) # Create a bar chart and its format. [7][11][12] +axes3.bar_label(axes3.containers[0], label_type='edge', color='r', fontsize=14)# Add a bar label and its format.[9][10] +axes3.plot(administrative_duty, summary, '-o', color='orange') # Add a trend line.[8] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend +# 7. https://matplotlib.org/stable/gallery/ticks_and_spines/custom_ticker1.html#sphx-glr-gallery-ticks-and-spines-custom-ticker1-py +# 8. https://stackoverflow.com/a/48842891 +# 9. https://stackoverflow.com/a/67561982/ +# 10. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html +# 11. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bar.html#matplotlib.axes.Axes.bar +# 12. https://matplotlib.org/stable/gallery/color/named_colors.html diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2008-2024_watermark.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2008-2024_watermark.py new file mode 100644 index 00000000..334346f4 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2008-2024_watermark.py @@ -0,0 +1,131 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2008", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24"] + +death = [[115, 261, 226, 371, 371, 398], # 2008 + [133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + [132, 266, 269, 283, 295, 333], # 2021 + [107, 305, 259, 304, 306, 369], # 2022 + [109, 264, 248, 315, 296, 317], # 2023 + [119, 269, 287, 288, 278, 310], # 2024 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2008-2024)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2, axes3) = plt.subplots(3, figsize=(9, 9)) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by City") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +axes3.bar(administrative_duty, summary, color=colour.CSS4_COLORS.get('palegreen'), linewidth=1, ecolor=colour.CSS4_COLORS.get('dodgerblue')) # Create a bar chart and its format. [7][11][12] +axes3.bar_label(axes3.containers[0], label_type='edge', color='r', fontsize=14)# Add a bar label and its format.[9][10] +axes3.plot(administrative_duty, summary, '-o', color='orange') # Add a trend line.[8] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC0.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend +# 7. https://matplotlib.org/stable/gallery/ticks_and_spines/custom_ticker1.html#sphx-glr-gallery-ticks-and-spines-custom-ticker1-py +# 8. https://stackoverflow.com/a/48842891 +# 9. https://stackoverflow.com/a/67561982/ +# 10. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html +# 11. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bar.html#matplotlib.axes.Axes.bar +# 12. https://matplotlib.org/stable/gallery/color/named_colors.html diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2008_2022_county.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2008_2022_county.py new file mode 100644 index 00000000..3847ccf0 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2008_2022_county.py @@ -0,0 +1,116 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd +import matplotlib.image as image + +administrative_duty = ["Yilan", "Hsinchu", "Miaoli", "Chanhua", "Nantou", "Yunlin", "Chiayi", "Pingtung", "Taitung", "Hualien"] + +year = ["2008", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21"] + +death = pd.read_csv('Deaths_in_road_accidents_2008_2021.csv', encoding='big5') + +print(death) + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2008-2022/7)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2, axes3) = plt.subplots(3, figsize=(9, 9)) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +axes3.bar(administrative_duty, summary, color=colour.CSS4_COLORS.get('palegreen'), linewidth=1, ecolor=colour.CSS4_COLORS.get('dodgerblue')) # Create a bar chart and its format. [7][11][12] +axes3.bar_label(axes3.containers[0], label_type='edge', color='r', fontsize=14)# Add a bar label and its format.[9][10] +axes3.plot(administrative_duty, summary, '-o', color='orange') # Add a trend line.[8] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://stat.motc.gov.tw/mocdb/stmain.jsp?sys=100', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=800, yo=800, alpha=0.9) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend +# 7. https://matplotlib.org/stable/gallery/ticks_and_spines/custom_ticker1.html#sphx-glr-gallery-ticks-and-spines-custom-ticker1-py +# 8. https://stackoverflow.com/a/48842891 +# 9. https://stackoverflow.com/a/67561982/ +# 10. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html +# 11. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bar.html#matplotlib.axes.Axes.bar +# 12. https://matplotlib.org/stable/gallery/color/named_colors.html diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020.py new file mode 100644 index 00000000..7e9f9865 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020.py @@ -0,0 +1,35 @@ +import pandas as pd +import matplotlib.pyplot as plt + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 +# [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +df.plot(grid=True, use_index=True, figsize=(10, 8), + title="The Number of Deaths in Road Accident in Taiwan by Region") + +plt.xlabel("Year") +plt.ylabel("The number of deaths (Unit: person)") +plt.text(x=1, y=1, s="Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖", + style='italic', bbox={'facecolor': 'red', 'alpha': 0.8, 'pad': 10}, fontproperties="MS Gothic") + +plt.show() diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_10.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_10.py new file mode 100644 index 00000000..8518036d --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_10.py @@ -0,0 +1,117 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd +import seaborn as sns + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2, axes3) = plt.subplots(3) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + + +sns.displot(data=cumulative_sum, kde=True) + + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_11.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_11.py new file mode 100644 index 00000000..e8e5239e --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_11.py @@ -0,0 +1,117 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd +import seaborn as sns + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2, axes3) = plt.subplots(3) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + + +sns.displot(data=cumulative_sum.transpose(), kde=True) + + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_12.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_12.py new file mode 100644 index 00000000..0bc7b640 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_12.py @@ -0,0 +1,115 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd +import seaborn as sns + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2, axes3) = plt.subplots(3) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +axes3 = cumulative_sum.plot.kde() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_13.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_13.py new file mode 100644 index 00000000..dd60a48b --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_13.py @@ -0,0 +1,118 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd +import seaborn as sns + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +cumulative_sum_series = pd.Series(data=summary, index=administrative_duty) +print(cumulative_sum_series) + +figure, (axes1, axes2, axes3) = plt.subplots(3, figsize=(10, 8)) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +axes3 = cumulative_sum_series.plot.kde() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_14.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_14.py new file mode 100644 index 00000000..c0d03dee --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_14.py @@ -0,0 +1,120 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd +import seaborn as sns + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +cumulative_sum_series = pd.Series(data=summary, index=administrative_duty) +print(cumulative_sum_series) + +figure, (axes1, axes2, axes3, axes4) = plt.subplots(4, figsize=(10, 10)) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +axes3 = cumulative_sum_series.plot.kde() + +axes4 = sns.histplot(data=cumulative_sum_series, kde=True) + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_15.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_15.py new file mode 100644 index 00000000..05dc51a2 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_15.py @@ -0,0 +1,120 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd +import seaborn as sns + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +cumulative_sum_series = pd.Series(data=summary, index=administrative_duty) +print(cumulative_sum_series) + +figure, (axes1, axes2, axes3, axes4) = plt.subplots(4, figsize=(10, 10)) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +axes3 = cumulative_sum_series.transpose().plot.kde() + +axes4 = sns.histplot(data=cumulative_sum_series.transpose(), kde=True) + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_16.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_16.py new file mode 100644 index 00000000..e676377f --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_16.py @@ -0,0 +1,117 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2, axes3) = plt.subplots(3, figsize=(10, 8)) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +axes3.bar(administrative_duty, summary) # Create a bar chart. [7] +axes3.plot(administrative_duty, summary, '-o', color='orange') # Add a trend line.[8] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend +# 7. https://matplotlib.org/stable/gallery/ticks_and_spines/custom_ticker1.html#sphx-glr-gallery-ticks-and-spines-custom-ticker1-py +# 8. https://stackoverflow.com/a/48842891 diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_17.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_17.py new file mode 100644 index 00000000..ed44b0df --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_17.py @@ -0,0 +1,119 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2, axes3) = plt.subplots(3, figsize=(10, 8)) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +axes3.bar(administrative_duty, summary) # Create a bar chart. [7] +axes3.bar_label(axes3.containers[0], label_type='edge') # Add a bar label. [9] +axes3.plot(administrative_duty, summary, '-o', color='orange') # Add a trend line.[8] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend +# 7. https://matplotlib.org/stable/gallery/ticks_and_spines/custom_ticker1.html#sphx-glr-gallery-ticks-and-spines-custom-ticker1-py +# 8. https://stackoverflow.com/a/48842891 +# 9. https://stackoverflow.com/a/67561982/ diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_18.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_18.py new file mode 100644 index 00000000..4b0952b7 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_18.py @@ -0,0 +1,119 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2, axes3) = plt.subplots(3, figsize=(9, 9)) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +axes3.bar(administrative_duty, summary) # Create a bar chart. [7] +axes3.bar_label(axes3.containers[0], label_type='edge') # Add a bar label. [9] +axes3.plot(administrative_duty, summary, '-o', color='orange') # Add a trend line.[8] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend +# 7. https://matplotlib.org/stable/gallery/ticks_and_spines/custom_ticker1.html#sphx-glr-gallery-ticks-and-spines-custom-ticker1-py +# 8. https://stackoverflow.com/a/48842891 +# 9. https://stackoverflow.com/a/67561982/ diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_19.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_19.py new file mode 100644 index 00000000..3d0bf753 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_19.py @@ -0,0 +1,120 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2, axes3) = plt.subplots(3, figsize=(9, 9)) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +axes3.bar(administrative_duty, summary) # Create a bar chart. [7] +axes3.bar_label(axes3.containers[0], label_type='edge', color='b', fontsize=14)# Add a bar label and its format.[9][10] +axes3.plot(administrative_duty, summary, '-o', color='orange') # Add a trend line.[8] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend +# 7. https://matplotlib.org/stable/gallery/ticks_and_spines/custom_ticker1.html#sphx-glr-gallery-ticks-and-spines-custom-ticker1-py +# 8. https://stackoverflow.com/a/48842891 +# 9. https://stackoverflow.com/a/67561982/ +# 10. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_19_2.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_19_2.py new file mode 100644 index 00000000..3613289c --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_19_2.py @@ -0,0 +1,120 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2, axes3) = plt.subplots(3, figsize=(9, 9)) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +axes3.bar(administrative_duty, summary) # Create a bar chart. [7] +axes3.bar_label(axes3.containers[0], label_type='edge', color='r', fontsize=14)# Add a bar label and its format.[9][10] +axes3.plot(administrative_duty, summary, '-o', color='orange') # Add a trend line.[8] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend +# 7. https://matplotlib.org/stable/gallery/ticks_and_spines/custom_ticker1.html#sphx-glr-gallery-ticks-and-spines-custom-ticker1-py +# 8. https://stackoverflow.com/a/48842891 +# 9. https://stackoverflow.com/a/67561982/ +# 10. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_2.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_2.py new file mode 100644 index 00000000..7fc80804 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_2.py @@ -0,0 +1,35 @@ +import pandas as pd +import matplotlib.pyplot as plt + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +df.plot(grid=True, use_index=True, figsize=(10, 8), + title="The Number of Deaths in Road Accident in Taiwan by Region") + +plt.xlabel("Year") +plt.ylabel("The number of deaths (Unit: person)") +plt.text(x=1, y=1, s="Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖", + style='italic', bbox={'facecolor': 'red', 'alpha': 0.8, 'pad': 10}, fontproperties="MS Gothic") + +plt.show() diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_20.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_20.py new file mode 100644 index 00000000..b57ab2ee --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_20.py @@ -0,0 +1,122 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2, axes3) = plt.subplots(3, figsize=(9, 9)) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +axes3.bar(administrative_duty, summary, color=colour.CSS4_COLORS.get('palegreen'), linewidth=1, ecolor=colour.CSS4_COLORS.get('dodgerblue')) # Create a bar chart and its format. [7][11][12] +axes3.bar_label(axes3.containers[0], label_type='edge', color='r', fontsize=14)# Add a bar label and its format.[9][10] +axes3.plot(administrative_duty, summary, '-o', color='orange') # Add a trend line.[8] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend +# 7. https://matplotlib.org/stable/gallery/ticks_and_spines/custom_ticker1.html#sphx-glr-gallery-ticks-and-spines-custom-ticker1-py +# 8. https://stackoverflow.com/a/48842891 +# 9. https://stackoverflow.com/a/67561982/ +# 10. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html +# 11. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bar.html#matplotlib.axes.Axes.bar +# 12. https://matplotlib.org/stable/gallery/color/named_colors.html diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_3.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_3.py new file mode 100644 index 00000000..6d242334 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_3.py @@ -0,0 +1,31 @@ +import pandas as pd +import matplotlib.pyplot as plt + +pd.options.plotting.backend = "plotly" + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +df.plot() + +plt.show() diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_4.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_4.py new file mode 100644 index 00000000..e2416147 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_4.py @@ -0,0 +1,74 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.colors as colour + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Cumulative sum"], + index=administrative_duty) + +print(cumulative_sum) + +figure, axes = plt.subplots() + +# hide axes [1] +figure.patch.set_visible(False) +axes.axis('off') +axes.axis('tight') + +# Plot a table using matplotlib.[2] +axes.table(cellText=cumulative_sum.values, + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], # colwidths matplotlib [3][4] + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), #[5][6][7] + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + ) + +figure.tight_layout() + +plt.show() + +# References: +# 1. https://stackoverflow.com/a/45936469 +# 2. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.table.html +# 3. https://stackoverflow.com/a/46977181 +# 4. https://stackoverflow.com/a/15514091 +# 5. https://matplotlib.org/stable/gallery/color/named_colors.html +# 6. https://stackoverflow.com/a/46664216 +# 7. https://matplotlib.org/stable/gallery/color/color_demo.html diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_5.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_5.py new file mode 100644 index 00000000..bee215fc --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_5.py @@ -0,0 +1,66 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.colors as colour + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Cumulative sum"], + index=administrative_duty) + +print(cumulative_sum) + +figure, axes = plt.subplots(nrows=1, ncols=2) + +axes[0, 0].plot(year, df.loc[:, "Taipei"].values(), label="Taipei") + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes[0, 1].axis('off') +axes[0, 1].axis('tight') + +axes[0, 1].table(cellText=cumulative_sum.values, + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + ) + +figure.tight_layout() + +plt.show() diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_6.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_6.py new file mode 100644 index 00000000..90bb45f3 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_6.py @@ -0,0 +1,74 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.colors as colour + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Cumulative sum"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(nrows=1, ncols=2) # matplotlib subplot [1] + +axes1.plot(year, Taipei, label="Taipei") + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +axes2.table(cellText=cumulative_sum.values, + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + ) + +figure.tight_layout() + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subplots_demo.html + diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_7.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_7.py new file mode 100644 index 00000000..db23c234 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_7.py @@ -0,0 +1,73 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.colors as colour + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Cumulative sum"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2) + +axes1.plot(year, Taipei, label="Taipei") +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +axes2.table(cellText=cumulative_sum.values, + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + ) + +figure.tight_layout() + +plt.show() diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8.py new file mode 100644 index 00000000..6ba226c8 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8.py @@ -0,0 +1,85 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.colors as colour + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Cumulative sum"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiumg") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +axes2.table(cellText=cumulative_sum.values, + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + ) + +figure.tight_layout() + +plt.show() diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_1.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_1.py new file mode 100644 index 00000000..ad55aa78 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_1.py @@ -0,0 +1,87 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.colors as colour + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Cumulative sum"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiumg") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +axes1.legend() + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +axes2.table(cellText=cumulative_sum.values, + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + ) + +figure.tight_layout() + +plt.show() diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_10.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_10.py new file mode 100644 index 00000000..cd26d0a9 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_10.py @@ -0,0 +1,110 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +axes1.legend() + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [2] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +table.scale(2, 2.2) # [2] +table.set_fontsize(14) # [2] + + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.02, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_11.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_11.py new file mode 100644 index 00000000..6fd96f91 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_11.py @@ -0,0 +1,112 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +axes1.legend() + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.4, 2.2) # [3] +table.set_fontsize(14) # [3] + + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.02, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_12.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_12.py new file mode 100644 index 00000000..ca1f19b3 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_12.py @@ -0,0 +1,116 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend(bbox_to_anchor=(1, 1, 2, 4)) # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.4, 2.2) # [3] +table.set_fontsize(14) # [3] + + +figure.tight_layout() # [7] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.02, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend +# 7. https://matplotlib.org/stable/tutorials/intermediate/tight_layout_guide.html diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_13.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_13.py new file mode 100644 index 00000000..22d1ccdb --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_13.py @@ -0,0 +1,112 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend(bbox_to_anchor=(1, 1, 2, 4)) # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.02, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_14.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_14.py new file mode 100644 index 00000000..dba52db3 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_14.py @@ -0,0 +1,112 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend(bbox_to_anchor=(0.1, 0.1, 2, 4)) # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.02, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_15.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_15.py new file mode 100644 index 00000000..3c0343ed --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_15.py @@ -0,0 +1,112 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.02, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_16.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_16.py new file mode 100644 index 00000000..27e8604d --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_16.py @@ -0,0 +1,112 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_2.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_2.py new file mode 100644 index 00000000..82790477 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_2.py @@ -0,0 +1,89 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.colors as colour + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Cumulative sum"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiumg") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +axes1.legend() + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +axes2.table(cellText=cumulative_sum.values, + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + ) + +figure.tight_layout() + +plt.show() diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_3.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_3.py new file mode 100644 index 00000000..ac8ab5a5 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_3.py @@ -0,0 +1,89 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.colors as colour + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Cumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiumg") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +axes1.legend() + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +axes2.table(cellText=cumulative_sum.values, + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + ) + +figure.tight_layout() + +plt.show() diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_4.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_4.py new file mode 100644 index 00000000..f04c5370 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_4.py @@ -0,0 +1,90 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.colors as colour + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Cumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiumg") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +axes1.legend() + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +axes2.table(cellText=cumulative_sum.values, + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖"' + ) + +figure.tight_layout() + +plt.show() diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_5.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_5.py new file mode 100644 index 00000000..5b33b329 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_5.py @@ -0,0 +1,104 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.colors as colour + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Cumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +axes1.legend() + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +axes2.table(cellText=cumulative_sum.values, + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + + +def label(xy, text): + y = xy[1] - 0.15 # shift y-value for label so that it's below the artist.[1] + plt.text(xy[0], y, text, ha="center", family='sans-serif', size=14) + + +figure.tight_layout() + +font = {'family': 'DejaVu Sans', 'name': 'MS Gothic', 'style': 'italic', + 'color': 'orange', 'weight': 'bold', 'size': 12} + +plt.text(x=3, y=1, s="Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖", fontdict=font) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/gallery/shapes_and_collections/artist_reference.html#sphx-glr-gallery-shapes-and-collections-artist-reference-py diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_6.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_6.py new file mode 100644 index 00000000..b610350c --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_6.py @@ -0,0 +1,111 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.colors as colour + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Cumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +axes1.legend() + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +axes2.table(cellText=cumulative_sum.values, + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + + +def label(xy, text): + y = xy[1] - 0.15 # shift y-value for label so that it's below the artist.[1] + plt.text(xy[0], y, text, ha="center", family='sans-serif', size=14) + + +figure.tight_layout() + +# font = {'family': 'DejaVu Sans', 'name': 'MS Gothic', 'style': 'italic', +# 'color': 'orange', 'weight': 'bold', 'size': 12} + +# plt.text(x=3, y=1, s="Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖", fontdict=font) + +plt.annotate(text="Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖", + textcoords='offset points', + xytext=(0.5, 0.1), + xy=(0.5, 0.1), + + fontproperties='MS Gothic') + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/gallery/shapes_and_collections/artist_reference.html#sphx-glr-gallery-shapes-and-collections-artist-reference-py diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_7.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_7.py new file mode 100644 index 00000000..e67fc81a --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_7.py @@ -0,0 +1,107 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Cumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +axes1.legend() + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +axes2.table(cellText=cumulative_sum.values, + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.02, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=8, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py + diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_8.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_8.py new file mode 100644 index 00000000..b26141b3 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_8.py @@ -0,0 +1,107 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Cumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +axes1.legend() + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +axes2.table(cellText=cumulative_sum.values, + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.02, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py + diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_9.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_9.py new file mode 100644 index 00000000..e8fce739 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_8_9.py @@ -0,0 +1,110 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Cumulative Deaths (2009-2020)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +axes1.legend() + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [2] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +table.scale(2, 2.2) # [2] +table.set_fontsize(14) # [2] + + +figure.tight_layout() + +# matplotlib text [1][2] +text = figure.text(0.5, 0.02, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_9.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_9.py new file mode 100644 index 00000000..d6b80add --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2020_9.py @@ -0,0 +1,85 @@ +import pandas as pd +import matplotlib.pyplot as plt +import matplotlib.colors as colour + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2020"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + # [73, 146, 145, 178, 190, 193], # 2021/01-07 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Cumulative sum"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2) = plt.subplots(2, figsize=(12, 8)) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiumg") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +axes2.table(cellText=cumulative_sum.values, + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + ) + +figure.tight_layout() + +plt.show() diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2021.ipynb b/The attainments and realizations of my dreams/Road safety/Year_over_year_2021.ipynb new file mode 100644 index 00000000..225791d7 --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2021.ipynb @@ -0,0 +1,100 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Taipei New Taipei Taoyuan Taichung Tainan Kaohsiung\n", + "2009 133 254 198 318 340 402\n", + "10 152 255 227 373 319 388\n", + "11 140 264 195 382 346 373\n", + "12 130 252 195 370 288 417\n", + "13 140 223 191 308 311 375\n", + "14 138 219 221 302 290 387\n", + "15 137 212 203 275 289 364\n", + "16 157 266 203 259 269 329\n", + "17 106 256 213 217 246 289\n", + "18 137 248 244 245 289 280\n", + "19 131 225 249 270 294 351\n", + "20 102 232 264 325 317 347\n", + "2021/01-07 73 146 145 178 190 193\n" + ] + }, + { + "data": { + "text/plain": "" + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "text/plain": "
", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD4CAYAAADsKpHdAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAB/fElEQVR4nO2dd3hURReH39ndJJveGykk9E7oHekgUhQRCyKIgg2sfIqCiAWxYO8oAqIIUpQioIj0nkACoZOQQkjvPVvm+2OXGEpIgCSbwH159tm7c++dObNs5ndn5swZIaVEQUFBQUFBZWkDFBQUFBRqB4ogKCgoKCgAiiAoKCgoKJhRBEFBQUFBAVAEQUFBQUHBjMbSBgB4eHjIoKAgS5uhoKCgUKcICwtLk1J6VlV+tUIQgoKCCA0NtbQZCgoKCnUKIURsVeanDBkpKCgoKACKICgoKCgomFEEQUFBQ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UUv4NbAD2YHoa2gsYqsdahcuRUs6QUgYAvwBTLG3PDfIN0BAIARIxDbXUdR6kjvQOrsFE4GkhRBimYZ2Sqi7getsfIURfTILwSiWyHwT8XUWmVoZK/Z/XWkEQQlhh+s/4RUq52pycbB4KwvyeYk5P4NInBH9zGlLKOVLKECnlQExzDKdrwn6FS/iFKuzS1yRSymQppUFKaQS+x9yVr6sIITTAKGC5pW25GaSUJ6WUg6SUHTA1dFFVmf91tj8IIdoAPwAjpZTplSjiTmCT+bjc9qsc2wLKTBQ/WdH95t5IZ+DPioyqlYJgHuNcAJyQUn5c5tRaYLz5eDywpkz6I2Zvo65AtpQyUQihFkK4m/NsA7ShZlX5tkUI0bjMx5HASUvZcjNcbADM3ANc09ujDjAAOCmlPG9pQ24GIYSX+V0FzAS+rcK8r6v9EUIEAquBcVLKCh84zfm3AcLL5PuAEMJGCBEMNAYOlHe/lDLe/JAbIqX8FtMEe2MhRLAQwhp4wJznRUYD66WURRXZZnEPgnJmzXti6o4dMX9p4Zg8idyBLcAZTJMxbubrBfAVpqeEo5g9dAAtcNz82geEWLpuZer4K6YhCB2mMb/HMDU454FiIBn4y9J23kRdVmFqPI8A6wA/S9t5g/VYYv5NHTH/kfla2s4brYs5fRHwpKXtq4L/l+cw9fZPA+9hjrpQReVdb/vzA5BZ5trQCmzvCCy6rMwZ5vbrFHBnRf+PV7F5qPm7iAJmXHZuGzCkMnVXQlcoKCgo1CBCiJmYvIKWWdqWy1EEQUFBQUEBqKVzCAoKCgoKNY8iCAoKCgoKgCIICgoKCgpmFEFQUFBQUAAUQVBQUFBQMKMIgoKCgoICAP8H1fzwtwzN9GQAAAAASUVORK5CYII=\n" + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "import pandas as pd\n", + "import matplotlib.pyplot as plt\n", + "\n", + "administrative_duty = [\"Taipei\", \"New Taipei\", \"Taoyuan\", \"Taichung\", \"Tainan\", \"Kaohsiung\"]\n", + "\n", + "year = [\"2009\", \"10\", \"11\", \"12\", \"13\", \"14\", \"15\", \"16\", \"17\", \"18\", \"19\", \"20\", \"2021/01-07\"]\n", + "\n", + "death = [[133, 254, 198, 318, 340, 402],\n", + " [152, 255, 227, 373, 319, 388],\n", + " [140, 264, 195, 382, 346, 373],\n", + " [130, 252, 195, 370, 288, 417],\n", + " [140, 223, 191, 308, 311, 375],\n", + " [138, 219, 221, 302, 290, 387],\n", + " [137, 212, 203, 275, 289, 364],\n", + " [157, 266, 203, 259, 269, 329],\n", + " [106, 256, 213, 217, 246, 289],\n", + " [137, 248, 244, 245, 289, 280],\n", + " [131, 225, 249, 270, 294, 351],\n", + " [102, 232, 264, 325, 317, 347],\n", + " [73, 146, 145, 178, 190, 193]]\n", + "\n", + "df = pd.DataFrame(data=death, columns=administrative_duty, index=year)\n", + "\n", + "print(df)\n", + "\n", + "df.plot()\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2021.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2021.py new file mode 100644 index 00000000..f4a7bd9d --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2021.py @@ -0,0 +1,122 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + [132, 266, 269, 283, 295, 333], # 2021 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2021)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2, axes3) = plt.subplots(3, figsize=(9, 9)) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +axes3.bar(administrative_duty, summary, color=colour.CSS4_COLORS.get('palegreen'), linewidth=1, ecolor=colour.CSS4_COLORS.get('dodgerblue')) # Create a bar chart and its format. [7][11][12] +axes3.bar_label(axes3.containers[0], label_type='edge', color='r', fontsize=14)# Add a bar label and its format.[9][10] +axes3.plot(administrative_duty, summary, '-o', color='orange') # Add a trend line.[8] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend +# 7. https://matplotlib.org/stable/gallery/ticks_and_spines/custom_ticker1.html#sphx-glr-gallery-ticks-and-spines-custom-ticker1-py +# 8. https://stackoverflow.com/a/48842891 +# 9. https://stackoverflow.com/a/67561982/ +# 10. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html +# 11. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bar.html#matplotlib.axes.Axes.bar +# 12. https://matplotlib.org/stable/gallery/color/named_colors.html diff --git a/The attainments and realizations of my dreams/Road safety/Year_over_year_2022.py b/The attainments and realizations of my dreams/Road safety/Year_over_year_2022.py new file mode 100644 index 00000000..1ec52a9f --- /dev/null +++ b/The attainments and realizations of my dreams/Road safety/Year_over_year_2022.py @@ -0,0 +1,123 @@ +import matplotlib.colors as colour +import matplotlib.patheffects as path_effects +import matplotlib.pyplot as plt +import pandas as pd + +administrative_duty = ["Taipei", "New Taipei", "Taoyuan", "Taichung", "Tainan", "Kaohsiung"] + +year = ["2009", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22"] + +death = [[133, 254, 198, 318, 340, 402], # 2009 + [152, 255, 227, 373, 319, 388], # 2010 + [140, 264, 195, 382, 346, 373], # 2011 + [130, 252, 195, 370, 288, 417], # 2012 + [140, 223, 191, 308, 311, 375], # 2013 + [138, 219, 221, 302, 290, 387], # 2014 + [137, 212, 203, 275, 289, 364], # 2015 + [157, 266, 203, 259, 269, 329], # 2016 + [106, 256, 213, 217, 246, 289], # 2017 + [137, 248, 244, 245, 289, 280], # 2018 + [131, 225, 249, 270, 294, 351], # 2019 + [102, 232, 264, 325, 317, 347], # 2020 + [132, 266, 269, 283, 295, 333], # 2021 + [107, 307, 263, 308, 312, 373], # 2022 + ] + +df = pd.DataFrame(data=death, columns=administrative_duty, index=year) + +print(df) + +Taipei = df.loc[:, "Taipei"].to_numpy() + +print(Taipei) + +New_Taipei = df.loc[:, "New Taipei"].to_numpy() +Taoyuan = df.loc[:, "Taoyuan"].to_numpy() +Taichung = df.loc[:, "Taichung"].to_numpy() +Tainan = df.loc[:, "Tainan"].to_numpy() +Kaohsiung = df.loc[:, "Kaohsiung"].to_numpy() + +summary = [df["Taipei"].sum(), df["New Taipei"].sum(), df["Taoyuan"].sum(), df["Taichung"].sum(), + df["Tainan"].sum(), df["Kaohsiung"].sum()] + +print(summary) + +cumulative_sum = pd.DataFrame(data=summary, + columns=["Accumulative Deaths (2009-2022)"], + index=administrative_duty) + +print(cumulative_sum) + +figure, (axes1, axes2, axes3) = plt.subplots(3, figsize=(9, 9)) + +axes1.plot(year, Taipei, label="Taipei") +axes1.plot(year, New_Taipei, label="New Taipei") +axes1.plot(year, Taoyuan, label="Taoyuan") +axes1.plot(year, Taichung, label="Taichung") +axes1.plot(year, Tainan, label="Tainan") +axes1.plot(year, Kaohsiung, label="Kaohsiung") + +axes1.set_title("The Number of Deaths in Road Accident in Taiwan by Region") +axes1.set_xlabel("Year") +axes1.set_ylabel("The number of deaths") + +# If a 4-tuple or BboxBase is given, then it specifies the bbox (x, y, width, height) that the legend is placed in.[6] +axes1.legend() # [5][6] + +axes1.grid(True) + +# hide axes +# axes[0, 1].patch.set_visible(False) +axes2.axis('off') +axes2.axis('tight') + +table = axes2.table(cellText=cumulative_sum.values, # matplotlib table size [3] + colLabels=cumulative_sum.columns, + colColours=[colour.CSS4_COLORS.get('springgreen')], + colWidths=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], + cellColours=['w', 'w', 'w', 'w', 'w', 'w'], + cellLoc='center', + rowLabels=cumulative_sum.index, + rowColours=[colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue'), + colour.CSS4_COLORS.get('lightskyblue')], + loc='center', + url='Reference:\nhttps://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖' + ) + +# Scale column widths by xscale and row heights by yscale.[4] +table.scale(2.01, 1.57) # [3] +table.set_fontsize(14) # [3] + +axes3.bar(administrative_duty, summary, color=colour.CSS4_COLORS.get('palegreen'), linewidth=1, ecolor=colour.CSS4_COLORS.get('dodgerblue')) # Create a bar chart and its format. [7][11][12] +axes3.bar_label(axes3.containers[0], label_type='edge', color='r', fontsize=14)# Add a bar label and its format.[9][10] +axes3.plot(administrative_duty, summary, '-o', color='orange') # Add a trend line.[8] + +# matplotlib text [1][2] +text = figure.text(0.5, 0.04, + 'Reference:https://roadsafety.tw/Dashboard/Custom?type=30交香鈭∩犖', + horizontalalignment='center', + verticalalignment='center', + size=13, + fontproperties='MS Gothic') + +text.set_path_effects([path_effects.Normal()]) + +plt.show() + +# References: +# 1. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html +# 2. https://matplotlib.org/stable/tutorials/advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py +# 3. https://stackoverflow.com/a/65763793/ +# 4. https://matplotlib.org/stable/api/table_api.html#matplotlib.table.Table.scale +# 5. https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py +# 6. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend +# 7. https://matplotlib.org/stable/gallery/ticks_and_spines/custom_ticker1.html#sphx-glr-gallery-ticks-and-spines-custom-ticker1-py +# 8. https://stackoverflow.com/a/48842891 +# 9. https://stackoverflow.com/a/67561982/ +# 10. https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_label_demo.html +# 11. https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bar.html#matplotlib.axes.Axes.bar +# 12. https://matplotlib.org/stable/gallery/color/named_colors.html diff --git a/The attainments and realizations of my dreams/Road safety/__init__.py b/The attainments and realizations of my dreams/Road safety/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Sewage System Coverage/2021.py b/The attainments and realizations of my dreams/Sewage System Coverage/2021.py new file mode 100644 index 00000000..5dc8e295 --- /dev/null +++ b/The attainments and realizations of my dreams/Sewage System Coverage/2021.py @@ -0,0 +1 @@ +# https://statis.moi.gov.tw/micst/stmain.jsp?sys=220&ym=9800&ymt=11000&kind=21&type=1&funid=c0830101&cycle=4&outmode=0&compmode=0&outkind=1&fld3=1&codspc0=0,2,3,2,6,1,9,1,12,1,&rdm=yuilWyVc \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Sewage System Coverage/__init__.py b/The attainments and realizations of my dreams/Sewage System Coverage/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Total_difference_2021.jpg b/The attainments and realizations of my dreams/Total_difference_2021.jpg index 3588f57d..2170fc43 100644 Binary files a/The attainments and realizations of my dreams/Total_difference_2021.jpg and b/The attainments and realizations of my dreams/Total_difference_2021.jpg differ diff --git a/The attainments and realizations of my dreams/Total_difference_2021_.jpg b/The attainments and realizations of my dreams/Total_difference_2021_.jpg index 586533a1..966d311a 100644 Binary files a/The attainments and realizations of my dreams/Total_difference_2021_.jpg and b/The attainments and realizations of my dreams/Total_difference_2021_.jpg differ diff --git a/The attainments and realizations of my dreams/Total_difference_2021__.jpg b/The attainments and realizations of my dreams/Total_difference_2021__.jpg index c7bb82ce..db4f762e 100644 Binary files a/The attainments and realizations of my dreams/Total_difference_2021__.jpg and b/The attainments and realizations of my dreams/Total_difference_2021__.jpg differ diff --git a/The attainments and realizations of my dreams/Total_population_and_housing_price.py b/The attainments and realizations of my dreams/Total_population_and_housing_price.py new file mode 100644 index 00000000..7c8d5211 --- /dev/null +++ b/The attainments and realizations of my dreams/Total_population_and_housing_price.py @@ -0,0 +1,111 @@ +import matplotlib.pyplot as plt + +year = ["2010", "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +date = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] +index = [(330.60 + 129.45) / 2] +housing_index = [(91.03 + 191.07) / 2, # 2010/04 (Guotai index + Xinyi index) / 2 + (102.42 + 218.72) / 2, # 2011/04 + (109.85 + 241.27) / 2, # 2012/04 + (117.29 + 278.51) / 2, # 2013/04 + (124.60 + 297.78) / 2, # 2014/04 + (124.61 + 289.3) / 2, # 2015/04 + (95.92 + 279.74) / 2, # 2016/04 + (101.89 + 282.36) / 2, # 2017/04 + (107.48 + 285.55) / 2, # 2018/04 + (114.48 + 294.46) / 2, # 2019/04 + (125.22 + 302.61) / 2, # 2020/04 + (129.45 + 333.60) / 2, # 2021/04 + ] + +figure, axes = plt.subplots() + +axes.stackplot(x, northTW, centralTW, southTW, eastTW, outlyingTW, labels=year) +plt.ylim(23000000, 23700000) + +plt.ticklabel_format(style='sci', axis='y', scilimits=(0, 0)) + +plt.plot(x, housing_index) + +plt.grid(linewidth=0.3) +plt.xlabel("Year") +plt.ylabel("Population") +plt.title("Taiwan's population change from 2010 - 2021/08 ") + +plt.show() + +# References: +# 1. https://www.macromicro.me/collections/15/tw-housing-relative/124/tw-housing-price-sinyi +# 2. diff --git a/The attainments and realizations of my dreams/Total_population_and_housing_price2.py b/The attainments and realizations of my dreams/Total_population_and_housing_price2.py new file mode 100644 index 00000000..936c5188 --- /dev/null +++ b/The attainments and realizations of my dreams/Total_population_and_housing_price2.py @@ -0,0 +1,115 @@ +import matplotlib.pyplot as plt + +year = ["2010", "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +date = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] +index = [(330.60 + 129.45) / 2] +housing_index = [(91.03 + 191.07) / 2, # 2010/04 (Guotai index + Xinyi index) / 2 + (102.42 + 218.72) / 2, # 2011/04 + (109.85 + 241.27) / 2, # 2012/04 + (117.29 + 278.51) / 2, # 2013/04 + (124.60 + 297.78) / 2, # 2014/04 + (124.61 + 289.3) / 2, # 2015/04 + (95.92 + 279.74) / 2, # 2016/04 + (101.89 + 282.36) / 2, # 2017/04 + (107.48 + 285.55) / 2, # 2018/04 + (114.48 + 294.46) / 2, # 2019/04 + (125.22 + 302.61) / 2, # 2020/04 + (129.45 + 333.60) / 2, # 2021/04 + ] + +figure, axes = plt.subplots() + +axes.stackplot(x, northTW, centralTW, southTW, eastTW, outlyingTW, labels=year) +axes.set_ylim(23000000, 23700000) +axes.ticklabel_format(style='sci', axis='y', scilimits=(0, 0)) +axes.set_xlabel("Year") +axes.set_ylabel("Population") + +axes2 = axes.twinx() +axes2.set_ylabel("Housing Price Index (2010/4 - 2021/04)") +axes2.plot(x, housing_index, color='gold') +axes2.tick_params(axis='y', labelcolor='goldenrod') + +plt.grid(linewidth=0.3) +plt.title("Taiwan's population change from 2010 - 2021/08 ") + +figure.tight_layout() + +plt.show() + +# References: +# 1. https://www.macromicro.me/collections/15/tw-housing-relative/124/tw-housing-price-sinyi +# 2. diff --git a/The attainments and realizations of my dreams/Total_population_and_housing_price3.py b/The attainments and realizations of my dreams/Total_population_and_housing_price3.py new file mode 100644 index 00000000..2bc06bd4 --- /dev/null +++ b/The attainments and realizations of my dreams/Total_population_and_housing_price3.py @@ -0,0 +1,122 @@ +import matplotlib.pyplot as plt + +year = ["2010", "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +date = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] +index = [(330.60 + 129.45) / 2] +housing_index = [(91.03 + 191.07) / 2, # 2010/04 (Guotai index + Xinyi index) / 2 + (102.42 + 218.72) / 2, # 2011/04 + (109.85 + 241.27) / 2, # 2012/04 + (117.29 + 278.51) / 2, # 2013/04 + (124.60 + 297.78) / 2, # 2014/04 + (124.61 + 289.3) / 2, # 2015/04 + (95.92 + 279.74) / 2, # 2016/04 + (101.89 + 282.36) / 2, # 2017/04 + (107.48 + 285.55) / 2, # 2018/04 + (114.48 + 294.46) / 2, # 2019/04 + (125.22 + 302.61) / 2, # 2020/04 + (129.45 + 333.60) / 2, # 2021/04 + ] + +figure, axes = plt.subplots() + +axes.stackplot(x, northTW, centralTW, southTW, eastTW, outlyingTW, labels=year) +axes.set_ylim(23000000, 23700000) +axes.ticklabel_format(style='sci', axis='y', scilimits=(0, 0)) +axes.set_xlabel("Year\n" + "References:\n" + "1. https://www.ris.gov.tw/app/portal/346 \n" + "2. https://www.macromicro.me/collections/15/\n" + "tw-housing-relative/124/tw-housing-price-sinyi") + +axes.set_ylabel("Population (Unit: 10 millions)") + +axes2 = axes.twinx() +axes2.set_ylabel("Yearly Housing Price Index (2010/4 - 2021/04) \n" + "Method: (Guotai + Xinyi) / 2", color='goldenrod') + +axes2.plot(x, housing_index, color='gold') +axes2.tick_params(axis='y', labelcolor='goldenrod') + +plt.grid(linewidth=0.3) +plt.title("Taiwan's population change from 2010 - 2021/08 \n in relation to Annual Housing Price Index") + +figure.tight_layout() + +plt.show() + +# References: +# 1. https://www.macromicro.me/collections/15/tw-housing-relative/124/tw-housing-price-sinyi +# 2. diff --git a/The attainments and realizations of my dreams/Total_population_composition_and_housing_price_trendline.py b/The attainments and realizations of my dreams/Total_population_composition_and_housing_price_trendline.py new file mode 100644 index 00000000..085f83c1 --- /dev/null +++ b/The attainments and realizations of my dreams/Total_population_composition_and_housing_price_trendline.py @@ -0,0 +1,89 @@ +import matplotlib.pyplot as plt + +year = ["2010", "'11", "'12", "'13", "'14", "'15", "'16", "'17", "'18", "'19", "'20", "'21/08"] + +northTW = [(3897367 + 2618772 + 460486 + 2002060 + 513015 + 384134 + 415344), # 2010 + (3916451 + 2650968 + 459061 + 2013305 + 517641 + 379927 + 420052), # 2011 + (3939305 + 2673226 + 458595 + 2030161 + 523993 + 377153 + 425071), # 2012 + (3954929 + 2686516 + 458456 + 2044023 + 530486 + 374914 + 428483), # 2013 + (3966818 + 2702315 + 458777 + 2058328 + 537630 + 373077 + 431988), # 2014 + (3970644 + 2704810 + 458117 + 2105780 + 542042 + 372105 + 434060), # 2015 + (3979208 + 2695704 + 457538 + 2147763 + 547481 + 372100 + 437337), # 2016 + (3986689 + 2683257 + 456607 + 2188017 + 552169 + 371458 + 441132), # 2017 + (3995717 + 2668572 + 455221 + 2220872 + 557010 + 370155 + 445635), # 2018 + (4018696 + 2645041 + 454178 + 2249037 + 563933 + 368893 + 448803), # 2019 + (4030954 + 2602418 + 453087 + 2268807 + 570775 + 367577 + 451412), # 2020 + (4019898 + 2553798 + 451635 + 2272976 + 573858 + 365591 + 452781), # 2021/08 + ] + +centralTW = [(2648419 + 560968 + 1307286 + 526491 + 717653), # 2010 + (2664394 + 562010 + 1303039 + 522807 + 713556), # 2011 + (2684893 + 563976 + 1299868 + 520196 + 710991), # 2012 + (2701661 + 565554 + 1296013 + 517222 + 707792), # 2013 + (2719835 + 567132 + 1291474 + 514315 + 705356), # 2014 + (2744445 + 563912 + 1289072 + 509490 + 699633), # 2015 + (2767239 + 559189 + 1287146 + 505163 + 694873), # 2016 + (2787070 + 553807 + 1282458 + 501051 + 690373), # 2017 + (2803894 + 548863 + 1277824 + 497031 + 686022), # 2018 + (2815261 + 545459 + 1272802 + 494112 + 681306), # 2019 + (2820787 + 542590 + 1266670 + 490832 + 676873), # 2020 + (2818139 + 539879 + 1259246 + 487185 + 672557), # 2021/08 + ] + +southTW = [(1873794 + 2773483 + 543248 + 873509 + 272390), # 2010 + (1876960 + 2774470 + 537942 + 864529 + 271526), # 2011 + (1881645 + 2778659 + 533723 + 858441 + 271220), # 2012 + (1883208 + 2779877 + 529229 + 852286 + 270872), # 2013 + (1884284 + 2778992 + 524783 + 847917 + 270883), # 2014 + (1885541 + 2778918 + 519839 + 841253 + 270366), # 2015 + (1886033 + 2779371 + 515320 + 835792 + 269874), # 2016 + (1886522 + 2776912 + 511182 + 829939 + 269398), # 2017 + (1883831 + 2773533 + 507068 + 825406 + 268622), # 2018 + (1880906 + 2773198 + 503113 + 819184 + 267690), # 2019 + (1874917 + 2765932 + 499481 + 812658 + 266005), # 2020 + (1867554 + 2753530 + 495662 + 807159 + 264858), # 2021/08 + ] + +eastTW = [(338805 + 230673), # 2010 + (336838 + 228290), # 2011 + (335190 + 226252), # 2012 + (333897 + 224821), # 2013 + (333392 + 224470), # 2014 + (331945 + 222452), # 2015 + (330911 + 220802), # 2016 + (329237 + 219540), # 2017 + (327968 + 218919), # 2018 + (326247 + 216781), # 2019 + (324372 + 215261), # 2020 + (322506 + 213956), # 2021/08 + ] + +outlyingTW = [(107308 + 96918), # 2010 Fujian + Penghu + (113989 + 97157), # 2011 + (124421 + 98843), # 2012 + (132878 + 100400), # 2013 + (140229 + 101758), # 2014 + (145346 + 102304), # 2015 + (147709 + 103263), # 2016 + (150336 + 104073), # 2017 + (152329 + 104440), # 2018 + (153274 + 105207), # 2019 + (153876 + 105952), # 2020 + (140004 + 13420 + 105645) # 2021/08 + ] + +x = range(10, 22) + +figure, axes = plt.subplots() + +axes.stackplot(x, northTW, centralTW, southTW, eastTW, outlyingTW, labels=year) +plt.ylim(23000000, 23700000) + +plt.ticklabel_format(style='sci', axis='y', scilimits=(0, 0)) + +plt.grid(linewidth=0.3) +plt.xlabel("Year") +plt.ylabel("Population") +plt.title("Taiwan's population change from 2010 - 2021/08 ") + +plt.show() diff --git a/The attainments and realizations of my dreams/Trade/2020_Trade_north_central_south.py b/The attainments and realizations of my dreams/Trade/2020_Trade_north_central_south.py new file mode 100644 index 00000000..6cfae05d --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_Trade_north_central_south.py @@ -0,0 +1,17 @@ +import pandas as pd + +df = pd.DataFrame(data=[[5497, 1093775143, 0, 0, 1093780640], + [571, 19273738, 0, 0, 19274309], + [1544095246, 5561724423, 2550413664, 3030786960, 12687020293]], + columns=["粹", "箏", "箔葉", "擃", "閮"], + index=["箏敹恍鞎函拚W硫寞", "箏敹恍蝪⊥W硫寞", "箏鞎函拚W硫寞(怠銝)"] + ) + +print(df) + +importation = pd.DataFrame(columns=["粹", "箏", "箔葉", "擃", "閮"], + index=["脣勗桃喳勗蝔寞(怠銝)", "脣敹恍鞎函拙蝔寞", "脣敹恍蝪⊥摰蝔寞"], + data=[[1887315195, 3744420037, 1317064881, 1685399059, 8634199171], + [2249153, 952141962, 0, 1411, 954392527], + [5639340, 38349842, 0, 268237, 44257418]]) +print(importation) diff --git a/The attainments and realizations of my dreams/Trade/2020_Trade_north_central_south_2.py b/The attainments and realizations of my dreams/Trade/2020_Trade_north_central_south_2.py new file mode 100644 index 00000000..5d3a914f --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_Trade_north_central_south_2.py @@ -0,0 +1,18 @@ +import pandas as pd + +importation = pd.DataFrame(columns=["粹", "箏", "箔葉", "擃", "閮"], + index=["脣勗桃喳勗蝔寞(怠銝)", "脣敹恍鞎函拙蝔寞", "脣敹恍蝪⊥摰蝔寞"], + data=[[1887315195, 3744420037, 1317064881, 1685399059, 8634199171], + [2249153, 952141962, 0, 1411, 954392527], + [5639340, 38349842, 0, 268237, 44257418]]) +print(importation) + +exportation = pd.DataFrame(data=[[1544095246, 5561724423, 2550413664, 3030786960, 12687020293], + [5497, 1093775143, 0, 0, 1093780640], + [571, 19273738, 0, 0, 19274309]], + columns=["粹", "箏", "箔葉", "擃", "閮"], + index=["箏鞎函拚W硫寞(怠銝)", "箏敹恍鞎函拚W硫寞", "箏敹恍蝪⊥W硫寞"]) + +print(exportation) + +# Reference: https://portal.sw.nat.gov.tw/APGA/GA11_LIST diff --git a/The attainments and realizations of my dreams/Trade/2020_Trade_north_central_south_3.py b/The attainments and realizations of my dreams/Trade/2020_Trade_north_central_south_3.py new file mode 100644 index 00000000..345cddaa --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_Trade_north_central_south_3.py @@ -0,0 +1,22 @@ +import pandas as pd + +importation = pd.DataFrame(columns=["粹", "箏", "箔葉", "擃", "閮"], + index=["脣勗桃喳勗蝔寞(怠銝)", "脣敹恍鞎函拙蝔寞", "脣敹恍蝪⊥摰蝔寞"], + data=[[1887315195, 3744420037, 1317064881, 1685399059, 8634199171], + [2249153, 952141962, 0, 1411, 954392527], + [5639340, 38349842, 0, 268237, 44257418]]) +print(importation) + +exportation = pd.DataFrame(data=[[1544095246, 5561724423, 2550413664, 3030786960, 12687020293], + [5497, 1093775143, 0, 0, 1093780640], + [571, 19273738, 0, 0, 19274309]], + columns=["粹", "箏", "箔葉", "擃", "閮"], + index=["箏鞎函拚W硫寞(怠銝)", "箏敹恍鞎函拚W硫寞", "箏敹恍蝪⊥W硫寞"]) + +print(exportation) + +surplus = exportation - importation + +print(surplus) + +# Reference: https://portal.sw.nat.gov.tw/APGA/GA11_LIST diff --git a/The attainments and realizations of my dreams/Trade/2020_Trade_north_central_south_4.py b/The attainments and realizations of my dreams/Trade/2020_Trade_north_central_south_4.py new file mode 100644 index 00000000..bb72cd31 --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_Trade_north_central_south_4.py @@ -0,0 +1,31 @@ +import pandas as pd + +importation = pd.DataFrame(columns=["粹", "箏", "箔葉", "擃", "閮"], + index=["脣勗桃喳勗蝔寞(怠銝)", "脣敹恍鞎函拙蝔寞", "脣敹恍蝪⊥摰蝔寞"], + data=[[1887315195, 3744420037, 1317064881, 1685399059, 8634199171], + [2249153, 952141962, 0, 1411, 954392527], + [5639340, 38349842, 0, 268237, 44257418]]) +print(importation) + +exportation = pd.DataFrame(data=[[1544095246, 5561724423, 2550413664, 3030786960, 12687020293], + [5497, 1093775143, 0, 0, 1093780640], + [571, 19273738, 0, 0, 19274309]], + columns=["粹", "箏", "箔葉", "擃", "閮"], + index=["箏鞎函拚W硫寞(怠銝)", "箏敹恍鞎函拚W硫寞", "箏敹恍蝪⊥W硫寞"]) + +print(exportation) + +total_exportation = exportation.sum(axis=0) +print(total_exportation) + +exportation2 = exportation.append(total_exportation, ignore_index=True) +print(exportation2) + +print(exportation2.iloc[:, 0]) + +exportation2.index = ["箏鞎函拚W硫寞(怠銝)", "箏敹恍鞎函拚W硫寞", "箏敹恍蝪⊥W硫寞", "Sum of the customs"] +print(exportation2) + +print(exportation2.iloc[:, 0]) + +exportation2.to_csv("2020_export_value_from_each_customs.csv") diff --git a/The attainments and realizations of my dreams/Trade/2020_Trade_north_central_south_5.py b/The attainments and realizations of my dreams/Trade/2020_Trade_north_central_south_5.py new file mode 100644 index 00000000..0a00b147 --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_Trade_north_central_south_5.py @@ -0,0 +1,25 @@ +import pandas as pd + +importation = pd.DataFrame(columns=["粹", "箏", "箔葉", "擃", "閮"], + index=["脣勗桃喳勗蝔寞(怠銝)", "脣敹恍鞎函拙蝔寞", "脣敹恍蝪⊥摰蝔寞"], + data=[[1887315195, 3744420037, 1317064881, 1685399059, 8634199171], + [2249153, 952141962, 0, 1411, 954392527], + [5639340, 38349842, 0, 268237, 44257418]]) +print(importation) + +total_importation = importation.sum(axis=0) +print(total_importation) + +print(1685399059 + 1411 + 268237) + +importation2 = importation.append(total_importation, ignore_index=True) +print(importation2) + +print(importation2.iloc[:, 0]) + +importation2.index = ["脣勗桃喳勗蝔寞(怠銝)", "脣敹恍鞎函拙蝔寞", "脣敹恍蝪⊥摰蝔寞", "Sum of the customs"] +print(importation2) + +print(importation2.iloc[:, 0]) + +importation2.to_csv("2020_import_value_from_each_customs.csv") diff --git a/The attainments and realizations of my dreams/Trade/2020_Trade_north_central_south_translated.py b/The attainments and realizations of my dreams/Trade/2020_Trade_north_central_south_translated.py new file mode 100644 index 00000000..e35caef8 --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_Trade_north_central_south_translated.py @@ -0,0 +1,18 @@ +import pandas as pd + +importation = pd.DataFrame(columns=["Keelung customs", "Taipei customs", "Taichung customs", "Kaohsiung customs", "Total"], + index=["脣勗桃喳勗蝔寞(怠銝)", "脣敹恍鞎函拙蝔寞", "脣敹恍蝪⊥摰蝔寞"], + data=[[1887315195, 3744420037, 1317064881, 1685399059, 8634199171], + [2249153, 952141962, 0, 1411, 954392527], + [5639340, 38349842, 0, 268237, 44257418]]) +print(importation) + +exportation = pd.DataFrame(data=[[1544095246, 5561724423, 2550413664, 3030786960, 12687020293], + [5497, 1093775143, 0, 0, 1093780640], + [571, 19273738, 0, 0, 19274309]], + columns=["Keelung customs", "Taipei customs", "Taichung customs", "Kaohsiung customs", "Total"], + index=["箏鞎函拚W硫寞(怠銝)", "箏敹恍鞎函拚W硫寞", "箏敹恍蝪⊥W硫寞"]) + +print(exportation) + +# Reference: https://portal.sw.nat.gov.tw/APGA/GA11_LIST diff --git a/The attainments and realizations of my dreams/Trade/2020_converting_export_value_to_USD.py b/The attainments and realizations of my dreams/Trade/2020_converting_export_value_to_USD.py new file mode 100644 index 00000000..bf32ee00 --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_converting_export_value_to_USD.py @@ -0,0 +1,22 @@ +import pandas as pd +import matplotlib.pyplot as plt + +exportation = pd.read_csv("2020_export_value_from_each_customs.csv", header=0, index_col=0) + +print(exportation) +print(exportation.info()) + +def TW_to_USD(x): + """ + TWD Taiwan New Dollar 28.0881028819 0.0356022621 + + https://web.archive.org/web/20210927101148/https://www.xe.com/currencytables/?from=USD&date=2020-12-31 + """ + return x / 28.0881028819 + + +exportation.applymap(TW_to_USD) + +print(exportation) + + diff --git a/The attainments and realizations of my dreams/Trade/2020_converting_export_value_to_USD_2.py b/The attainments and realizations of my dreams/Trade/2020_converting_export_value_to_USD_2.py new file mode 100644 index 00000000..1c40c1fb --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_converting_export_value_to_USD_2.py @@ -0,0 +1,33 @@ +import pandas as pd + +exportation = pd.read_csv("2020_export_value_from_each_customs.csv", header=0, index_col=0) + +print(exportation) +print(exportation.info()) + + +def TW_to_USD(x): + """ + TWD Taiwan New Dollar 28.0881028819 0.0356022621 + + https://web.archive.org/web/20210927101148/https://www.xe.com/currencytables/?from=USD&date=2020-12-31 + """ + return x / 28.08 + + +exportation_USD = exportation.applymap(TW_to_USD) + +print(exportation_USD) + + +def TWD_to_USD(x): + """ + TWD Taiwan New Dollar 28.0881028819 0.0356022621 + https://web.archive.org/web/20210927101148/https://www.xe.com/currencytables/?from=USD&date=2020-12-31 + """ + + return x * 0.0356022621 + + +exportation_USD2 = exportation.applymap(TWD_to_USD) +print(exportation_USD2) diff --git a/The attainments and realizations of my dreams/Trade/2020_converting_export_value_to_USD_3.py b/The attainments and realizations of my dreams/Trade/2020_converting_export_value_to_USD_3.py new file mode 100644 index 00000000..d8fdb9ff --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_converting_export_value_to_USD_3.py @@ -0,0 +1,20 @@ +import pandas as pd + +exportation = pd.read_csv("2020_export_value_from_each_customs.csv", header=0, index_col=0) + +print(exportation) +print(exportation.info()) + +def TWD_to_USD(x): + """ + TWD Taiwan New Dollar 28.0881028819 0.0356022621 + https://web.archive.org/web/20210927101148/https://www.xe.com/currencytables/?from=USD&date=2020-12-31 + """ + + return x * 0.0356022621 + + +exportation_USD = exportation.applymap(TWD_to_USD) +print(exportation_USD) + + diff --git a/The attainments and realizations of my dreams/Trade/2020_export_percentage.py b/The attainments and realizations of my dreams/Trade/2020_export_percentage.py new file mode 100644 index 00000000..aecce2de --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_export_percentage.py @@ -0,0 +1,15 @@ +import pandas as pd + +exportation = pd.read_csv("2020_export_value_from_each_customs.csv", header=0, index_col=0) + +print(exportation) + +exportation.loc["Percentile", :] = pd.DataFrame(data=[(1544101314 / 13800075242), + (6674773304 / 13800075242), + (2550413664 / 13800075242), + (3030786960 / 13800075242), + 100]) + +print(exportation.info()) + +print(exportation) diff --git a/The attainments and realizations of my dreams/Trade/2020_export_percentage_2.py b/The attainments and realizations of my dreams/Trade/2020_export_percentage_2.py new file mode 100644 index 00000000..5dea9b80 --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_export_percentage_2.py @@ -0,0 +1,31 @@ +import pandas as pd +import matplotlib.pyplot as plt + +exportation = pd.read_csv("2020_export_value_from_each_customs.csv", header=0, index_col=0) + +print(exportation) + +percentile = [(1544101314 / 13800075242), + (6674773304 / 13800075242), + (2550413664 / 13800075242), + (3030786960 / 13800075242), + 100] + +print(percentile) + +# Pie chart, where the slices will be ordered and plotted counter-clockwise: +labels = 'Keelung customs\n(Container ports in N.TW & E.TW)', 'Taipei customs\n(Airports in N.TW,\n ' \ + 'including Miaoli county )', \ + 'Taichung customs\n(Airport & container\n ports in C.TW,\n incl. Yunlin county)', \ + 'Kaohsiung customs\n(Airport & container ports\n in S.TW)' +sizes = [11.18, 48.36, 18.48, 21.96] +explode = (0, 0.1, 0, 0) # only "explode" the 2nd slice (i.e. 'Hogs') + +fig1, ax1 = plt.subplots() +ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.2f%%', shadow=True, startangle=90) + +ax1.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle. + +plt.title("The contribution of each region to total export in Taiwan 2020") + +plt.show() diff --git a/The attainments and realizations of my dreams/Trade/2020_export_percentage_3.py b/The attainments and realizations of my dreams/Trade/2020_export_percentage_3.py new file mode 100644 index 00000000..0f17c88a --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_export_percentage_3.py @@ -0,0 +1,44 @@ +import pandas as pd +import matplotlib.pyplot as plt + +exportation = pd.read_csv("2020_export_value_from_each_customs.csv", header=0, index_col=0) + +print(exportation) + +percentile = [(1544101314 / 13800075242), + (6674773304 / 13800075242), + (2550413664 / 13800075242), + (3030786960 / 13800075242), + 100] + +print(percentile) + +# Pie chart, where the slices will be ordered and plotted counter-clockwise: +labels = 'Keelung customs\n(Container ports in N.TW & E.TW)', 'Taipei customs\n(Airports in N.TW,\n ' \ + 'including Miaoli county )', \ + 'Taichung customs\n(Airport & container\n ports in C.TW,\n incl. Yunlin county)', \ + 'Kaohsiung customs\n(Airport & container ports\n in S.TW)' + +sizes = [11.18, 48.36, 18.48, 21.96] +explode = (0, 0.1, 0, 0) # only "explode" the 2nd slice (i.e. 'Hogs') + +fig1, ax1 = plt.subplots() +ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.2f%%', shadow=True, startangle=90, + textprops=dict(color="w")) + +ax1.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle. + +plt.title("The contribution of each region to total export ($NTD) in Taiwan 2020") + +textstr = '\n'.join(( + r'Dataset:', + r'https://portal.sw.nat.gov.tw/APGA/GA11_LIST', +)) +# these are matplotlib.patch.Patch properties +props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) + +# place a text box in upper left in axes coords +ax1.text(0.09, 0.01, textstr, transform=ax1.transAxes, fontsize=12, + verticalalignment='top', bbox=props) + +plt.show() diff --git a/The attainments and realizations of my dreams/Trade/2020_export_percentage_4.py b/The attainments and realizations of my dreams/Trade/2020_export_percentage_4.py new file mode 100644 index 00000000..0f17c88a --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_export_percentage_4.py @@ -0,0 +1,44 @@ +import pandas as pd +import matplotlib.pyplot as plt + +exportation = pd.read_csv("2020_export_value_from_each_customs.csv", header=0, index_col=0) + +print(exportation) + +percentile = [(1544101314 / 13800075242), + (6674773304 / 13800075242), + (2550413664 / 13800075242), + (3030786960 / 13800075242), + 100] + +print(percentile) + +# Pie chart, where the slices will be ordered and plotted counter-clockwise: +labels = 'Keelung customs\n(Container ports in N.TW & E.TW)', 'Taipei customs\n(Airports in N.TW,\n ' \ + 'including Miaoli county )', \ + 'Taichung customs\n(Airport & container\n ports in C.TW,\n incl. Yunlin county)', \ + 'Kaohsiung customs\n(Airport & container ports\n in S.TW)' + +sizes = [11.18, 48.36, 18.48, 21.96] +explode = (0, 0.1, 0, 0) # only "explode" the 2nd slice (i.e. 'Hogs') + +fig1, ax1 = plt.subplots() +ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.2f%%', shadow=True, startangle=90, + textprops=dict(color="w")) + +ax1.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle. + +plt.title("The contribution of each region to total export ($NTD) in Taiwan 2020") + +textstr = '\n'.join(( + r'Dataset:', + r'https://portal.sw.nat.gov.tw/APGA/GA11_LIST', +)) +# these are matplotlib.patch.Patch properties +props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) + +# place a text box in upper left in axes coords +ax1.text(0.09, 0.01, textstr, transform=ax1.transAxes, fontsize=12, + verticalalignment='top', bbox=props) + +plt.show() diff --git a/The attainments and realizations of my dreams/Trade/2020_export_percentage_5.py b/The attainments and realizations of my dreams/Trade/2020_export_percentage_5.py new file mode 100644 index 00000000..d474d79e --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_export_percentage_5.py @@ -0,0 +1,44 @@ +import pandas as pd +import matplotlib.pyplot as plt + +exportation = pd.read_csv("2020_export_value_from_each_customs.csv", header=0, index_col=0) + +print(exportation) + +percentile = [(1544101314 / 13800075242), + (6674773304 / 13800075242), + (2550413664 / 13800075242), + (3030786960 / 13800075242), + 100] + +print(percentile) + +# Pie chart, where the slices will be ordered and plotted counter-clockwise: +labels = 'Keelung customs\n(Container ports in N.TW & E.TW)', 'Taipei customs\n(Airports in N.TW,\n ' \ + 'including Miaoli county )', \ + 'Taichung customs\n(Airport & container\n ports in C.TW,\n incl. Yunlin county)', \ + 'Kaohsiung customs\n(Airport & container ports\n in S.TW)' + +sizes = [11.18, 48.36, 18.48, 21.96] +explode = (0, 0.1, 0, 0) # only "explode" the 2nd slice (i.e. 'Hogs') + +fig1, ax1 = plt.subplots() +ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.2f%%', shadow=True, startangle=90, + textprops=dict(color="k")) + +ax1.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle. + +plt.title("The contribution of each region to total export ($NTD) in Taiwan 2020") + +textstr = '\n'.join(( + r'Dataset:', + r'https://portal.sw.nat.gov.tw/APGA/GA11_LIST', +)) +# these are matplotlib.patch.Patch properties +props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) + +# place a text box in upper left in axes coords +ax1.text(0.09, 0.01, textstr, transform=ax1.transAxes, fontsize=12, + verticalalignment='top', bbox=props) + +plt.show() diff --git a/The attainments and realizations of my dreams/Trade/2020_export_percentile.py b/The attainments and realizations of my dreams/Trade/2020_export_percentile.py new file mode 100644 index 00000000..4428dfe3 --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_export_percentile.py @@ -0,0 +1,11 @@ +import pandas as pd + +exportation = pd.read_csv("2020_export_value_from_each_customs.csv", header=0, index_col=0) + +print(exportation) + +percentile = pd.DataFrame(data=[1544101314 / 13800075242, 6674773304 / 13800075242, + 2550413664 / 13800075242, 3030786960 / 13800075242, 100], + columns=["粹", "箏", "箔葉", "擃", "閮"]) + +print(percentile) diff --git a/The attainments and realizations of my dreams/Trade/2020_export_value_from_each_customs b/The attainments and realizations of my dreams/Trade/2020_export_value_from_each_customs new file mode 100644 index 00000000..624d73da --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_export_value_from_each_customs @@ -0,0 +1,5 @@ +,粹,箏,箔葉,擃,閮 +箏鞎函拚W硫寞(怠銝),1544095246,5561724423,2550413664,3030786960,12687020293 +箏敹恍鞎函拚W硫寞,5497,1093775143,0,0,1093780640 +箏敹恍蝪⊥W硫寞,571,19273738,0,0,19274309 +Sum of the customs,1544101314,6674773304,2550413664,3030786960,13800075242 diff --git a/The attainments and realizations of my dreams/Trade/2020_export_value_from_each_customs.csv b/The attainments and realizations of my dreams/Trade/2020_export_value_from_each_customs.csv new file mode 100644 index 00000000..624d73da --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_export_value_from_each_customs.csv @@ -0,0 +1,5 @@ +,粹,箏,箔葉,擃,閮 +箏鞎函拚W硫寞(怠銝),1544095246,5561724423,2550413664,3030786960,12687020293 +箏敹恍鞎函拚W硫寞,5497,1093775143,0,0,1093780640 +箏敹恍蝪⊥W硫寞,571,19273738,0,0,19274309 +Sum of the customs,1544101314,6674773304,2550413664,3030786960,13800075242 diff --git a/The attainments and realizations of my dreams/Trade/2020_import_percentage.py b/The attainments and realizations of my dreams/Trade/2020_import_percentage.py new file mode 100644 index 00000000..39d9f351 --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_import_percentage.py @@ -0,0 +1,40 @@ +import matplotlib.pyplot as plt +import pandas as pd + +importation = pd.read_csv("2020_import_value_from_each_customs.csv", header=0, index_col=0) + +print(importation) + +percentile = [(1895203688 / 9632849116), + (4734911841 / 9632849116), + (1317064881 / 9632849116), + (1685668707 / 9632849116)] + +print(percentile) + +# Pie chart, where the slices will be ordered and plotted counter-clockwise: +labels = 'Keelung customs\n(Container ports in N.TW & E.TW)', 'Taipei customs\n(Airports in N.TW,\n ' \ + 'including Miaoli county )', \ + 'Taichung customs\n(Airport & container\n ports in C.TW,\n incl. Yunlin county)', \ + 'Kaohsiung customs\n(Airport & container ports\n in S.TW)' + +sizes = [19.67, 49.15, 13.67, 17.49] +explode = (0, 0.1, 0, 0) # only "explode" the 2nd slice (i.e. 'Hogs') + +fig1, ax1 = plt.subplots() +ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.2f%%', shadow=True, startangle=90) + +ax1.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle. + +plt.title("The contribution of each region to total import ($NTD) in Taiwan 2020") + +textstr = 'Dataset:https://portal.sw.nat.gov.tw/APGA/GA11_LIST' + +# these are matplotlib.patch.Patch properties +props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) + +# place a text box in upper left in axes coords +ax1.text(0.09, 0.00, textstr, transform=ax1.transAxes, fontsize=11, + verticalalignment='top', bbox=props) + +plt.show() diff --git a/The attainments and realizations of my dreams/Trade/2020_import_value_from_each_customs.csv b/The attainments and realizations of my dreams/Trade/2020_import_value_from_each_customs.csv new file mode 100644 index 00000000..0512f03a --- /dev/null +++ b/The attainments and realizations of my dreams/Trade/2020_import_value_from_each_customs.csv @@ -0,0 +1,5 @@ +,粹,箏,箔葉,擃,閮 +脣勗桃喳勗蝔寞(怠銝),1887315195,3744420037,1317064881,1685399059,8634199171 +脣敹恍鞎函拙蝔寞,2249153,952141962,0,1411,954392527 +脣敹恍蝪⊥摰蝔寞,5639340,38349842,0,268237,44257418 +Sum of the customs,1895203688,4734911841,1317064881,1685668707,9632849116 diff --git a/The attainments and realizations of my dreams/Trade/2020_trade_surplus_by_region.py b/The attainments and realizations of my dreams/Trade/2020_trade_surplus_by_region.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Trade/__init__.py b/The attainments and realizations of my dreams/Trade/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Year allocation of centrally-funded tax revenues/__init__.py b/The attainments and realizations of my dreams/Year allocation of centrally-funded tax revenues/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/2022_watermark.py b/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/2022_watermark.py new file mode 100644 index 00000000..b473511e --- /dev/null +++ b/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/2022_watermark.py @@ -0,0 +1,97 @@ +import pandas as pd +import matplotlib.image as image +import matplotlib.pyplot as plt +# Using the magic encoding +# -*- coding: utf-8 -*- + + +# Convert wiki-table in the article 擃蝑脫楛閮俎4] to csv.[2][3] + +public_research_centric_university = pd.DataFrame(data=[ + [1, "蝡箇憭批飛", "National Taiwan University", 232587, "North", ], + [2, "蝡憭批飛", "National Cheng Kung University", 141178, "South", ], + [3, "蝡皜臬之摮", "National Tsing Hua University", 120394, "North", "Derived from Beijing, China's Tsing Hua University"], + [4, "蝡賣鈭日憭批飛嚗鈭文之∪嚗", "National Yang Ming Chiao Tung University (Hsinchu)", 138078, "North", "Derived from Shanghai, China's ChiaoTung University"], + [5, "蝡銝剛憭批飛", "National Chung Hsing University", 43745, "North", ], + [6, "蝡銝剖亢憭批飛", "National Central University", 42228, "North", ], + [7, "蝡賣鈭日憭批飛嚗賣∪嚗", "National Yang Ming Chiao Tung University (Taipei)", 0, "North", ], + [8, "蝡踵祥憭批飛", "National Chengchi University", 31579, "North", "Literally, 'National Politics University'"], + [9, "蝡銝剖控憭批飛", "National Sun Yat-sen University", 32068, "South", ], + [10, "蝡箇撣怎憭批飛", "National Taiwan Normal University", 14233, "North", ], + [11, "蝡銝剜迤憭批飛", "National Chung Cheng University", 15361, "South", "Literally, National Chiang Chung-cheng University"], + [12, "蝡箇瘚瑟憭批飛", "National Taiwan Ocean University", 14233, "North", ], + [13, "蝡箏憭批飛", "National Taipei University", 8771, "North", ], + [14, "蝡典憭批飛", "National Chi Nan University", 8030, "North", ], + [15, "蝡敶啣撣怎憭批飛", "National Changhua University of Education", 7580, "North", ], + [16, "蝡梯臬之摮", "National Dong Hwa University", 6965, "Hualien County", ], + [17, "蝡蝢拙之摮", "National Chiayi University", 5927, "South", ], + [18, "蝡摰剖之摮", "National Ilan University", 6799, "North", ], + [19, "蝡撅勗之摮", "National Pingtung University", 6619, "South", ], + [20, "蝡箸勗之摮", "National Taitung University", 6178, "Taitung County", ], + [21, "蝡箇銵憭批飛", "National Taiwan University of Arts", 5974, "North", ], + [22, "蝡箏脣之摮", "National Taipei University of Education", 5234, "North", ], + [23, "蝡擃憭批飛", "National University of Kaohsiung", 5502, "South", ], + [24, "蝡箏銵憭批飛", "The Taipei National University of the Arts", 5478, "North", ], + [25, "蝡箔葉脣之摮", "National Taichung University of Education", 5549, "North", ], + [26, "蝡箏憭批飛", "National University of Tainan", 5203, "South", ], + [27, "箏撣蝡憭批飛", "University of Taipei", 5247, "North", ], + [28, "蝡擃脣之摮", "National Taiwan Sport University", 4732, "North", ], + [29, "蝡臬憭批飛", "National United University", 4676, "North", ], + [30, "蝡擃撣怎憭批飛", "National Kaohsiung Normal University", 4347, "South", ], + [31, "蝡箇擃脤憭批飛", "National Taiwan University of Sport", 3229, "North", ], + [32, "蝡憭批飛", "National Quemoy University", 3319, ], + # [33, "蝡箇擃脤憭批飛", "National Taiwan University of Sport", 3226, "North", ], + [33, "蝡箏銵憭批飛", "Tainan National University of the Arts", 1997, "South", ], +]) + +print(public_research_centric_university) + +header = ['Number', 'Chinese name', 'English name', 'Budget_received', 'Location', 'Note'] + +# Adding a header to National universities of R&D +public_research_centric_university.columns = header +print(public_research_centric_university) + +# Filter the universities in the north. +condition = public_research_centric_university['Location'] == "North" +north_public_research = public_research_centric_university[condition] +print(north_public_research) + +# Sum of the budget in the north. +total_north_public_research = north_public_research['Budget_received'].sum() +print(total_north_public_research) + +# Filter the universities in the south. +condition = public_research_centric_university['Location'] == "South" +south_public_research = public_research_centric_university[condition] +print(south_public_research) + +# Sum of the budget inn the south. +total_south_public_research = south_public_research['Budget_received'].sum() +print(total_south_public_research) + +fig, ax = plt.subplots(figsize=(6, 6)) + +# The histogram of the data +plt.bar(['Northern Taiwan', 'Southern Taiwan'], [total_north_public_research, total_south_public_research]) + +plt.xlabel('Location (divided by Zhuoshui River)\n\n' + 'Dataset: https://sprout.moe.edu.tw/SproutWeb/Project/DocDownload', + fontproperties="Arial", fontsize=9) + +plt.ylabel('Unit: 10 thousands of New Taiwan Dollar') +plt.title('Government budget support for public research universities (蝡憭批飛)\n' + 'in North vs South in 2022', fontproperties="MS Gothic") + +# Tweak spacing to prevent clipping of ylabel +plt.tight_layout() + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=500, yo=500, alpha=0.9) + +# Insert text watermark +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='30', transform=ax.transAxes) + +plt.show() \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/2023_watermark.py b/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/2023_watermark.py new file mode 100644 index 00000000..ee62bcb6 --- /dev/null +++ b/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/2023_watermark.py @@ -0,0 +1,101 @@ +import pandas as pd +import matplotlib.image as image +import matplotlib.pyplot as plt + +# Using the magic encoding +# -*- coding: utf-8 -*- + + +# Convert wiki-table in the article 擃蝑脫楛閮俎4] to csv.[2][3] + +public_research_centric_university = pd.DataFrame(data=[ + [1, "蝡箇憭批飛", "National Taiwan University", 2466494187, "North", ], + [2, "蝡憭批飛", "National Cheng Kung University", 1421845095, "South", ], + [3, "蝡皜臬之摮", "National Tsing Hua University", 1227485103, "North", + "Derived from Beijing, China's Tsing Hua University"], + [4, "蝡賣鈭日憭批飛嚗鈭文之∪嚗", "National Yang Ming Chiao Tung University (Hsinchu)", 1321464208, "North", + "Derived from Shanghai, China's ChiaoTung University"], + [5, "蝡銝剛憭批飛", "National Chung Hsing University", 450197237, "North", ], + [6, "蝡銝剖亢憭批飛", "National Central University", 426576212, "North", ], + [7, "蝡賣鈭日憭批飛嚗賣∪嚗", "National Yang Ming Chiao Tung University (Taipei)", 0, "North", ], + [8, "蝡踵祥憭批飛", "National Chengchi University", 332581716, "North", "Literally, 'National Politics University'"], + [9, "蝡銝剖控憭批飛", "National Sun Yat-sen University", 405826790, "South", ], + [10, "蝡箇撣怎憭批飛", "National Taiwan Normal University", 324963949, "North", ], + [11, "蝡銝剜迤憭批飛", "National Chung Cheng University", 138023217, "South", + "Literally, National Chiang Chung-cheng University"], + [12, "蝡箇瘚瑟憭批飛", "National Taiwan Ocean University", 136547127, "North", ], + [13, "蝡箏憭批飛", "National Taipei University", 98142220, "North", ], + [14, "蝡典憭批飛", "National Chi Nan University", 89662348, "North", ], + [15, "蝡敶啣撣怎憭批飛", "National Changhua University of Education", 77873704, "North", ], + [16, "蝡梯臬之摮", "National Dong Hwa University", 77756120, "Hualien County", ], + [17, "蝡蝢拙之摮", "National Chiayi University", 67795521, "South", ], + [18, "蝡摰剖之摮", "National Ilan University", 60866935, "North", ], + [19, "蝡撅勗之摮", "National Pingtung University", 71360523, "South", ], + [20, "蝡箸勗之摮", "National Taitung University", 64098591, "Taitung County", ], + [21, "蝡箇銵憭批飛", "National Taiwan University of Arts", 60668797, "North", ], + [22, "蝡箏脣之摮", "National Taipei University of Education", 42922168, "North", ], + [23, "蝡擃憭批飛", "National University of Kaohsiung", 52383303, "South", ], + [24, "蝡箏銵憭批飛", "The Taipei National University of the Arts", 57484349, "North", ], + [25, "蝡箔葉脣之摮", "National Taichung University of Education", 61422484, "North", ], + [26, "蝡箏憭批飛", "National University of Tainan", 52336642, "South", ], + [27, "箏撣蝡憭批飛", "University of Taipei", 55253550, "North", ], + [28, "蝡擃脣之摮", "National Taiwan Sport University", 43469196, "North", ], + [29, "蝡臬憭批飛", "National United University", 48254839, "North", ], + [30, "蝡擃撣怎憭批飛", "National Kaohsiung Normal University", 50450179, "South", ], + [31, "蝡箇擃脤憭批飛", "National Taiwan University of Sport", 33282255, "North", ], + [32, "蝡憭批飛", "National Quemoy University", 3319, ], + # [33, "蝡箇擃脤憭批飛", "National Taiwan University of Sport", 3226, "North", ], + [33, "蝡箏銵憭批飛", "Tainan National University of the Arts", 18035952, "South", ], +]) + +print(public_research_centric_university) + +header = ['Number', 'Chinese name', 'English name', 'Budget_received', 'Location', 'Note'] + +# Adding a header to National universities of R&D +public_research_centric_university.columns = header +print(public_research_centric_university) + +# Filter the universities in the north. +condition = public_research_centric_university['Location'] == "North" +north_public_research = public_research_centric_university[condition] +print(north_public_research) + +# Sum of the budget in the north. +total_north_public_research = north_public_research['Budget_received'].sum() +print(total_north_public_research) + +# Filter the universities in the south. +condition = public_research_centric_university['Location'] == "South" +south_public_research = public_research_centric_university[condition] +print(south_public_research) + +# Sum of the budget inn the south. +total_south_public_research = south_public_research['Budget_received'].sum() +print(total_south_public_research) + +fig, ax = plt.subplots(figsize=(6, 6)) + +# The histogram of the data +plt.bar(['Northern Taiwan', 'Southern Taiwan'], [total_north_public_research, total_south_public_research]) + +plt.xlabel('Location (divided by Zhuoshui River)\n\n' + 'Dataset: https://sprout.moe.edu.tw/SproutWeb/Project/DocDownload', + fontproperties="Arial", fontsize=9) + +plt.ylabel('Unit: 10 thousands of New Taiwan Dollar') +plt.title('Government budget support for public research universities (蝡憭批飛)\n' + 'in North vs South in 2023', fontproperties="MS Gothic") + +# Tweak spacing to prevent clipping of ylabel +plt.tight_layout() + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=500, yo=500, alpha=0.9) + +# Insert text watermark +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation='30', transform=ax.transAxes) + +plt.show() diff --git a/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/2023_watermark_2.py b/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/2023_watermark_2.py new file mode 100644 index 00000000..c63cb7ae --- /dev/null +++ b/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/2023_watermark_2.py @@ -0,0 +1,101 @@ +import pandas as pd +import matplotlib.image as image +import matplotlib.pyplot as plt + +# Using the magic encoding +# -*- coding: utf-8 -*- + + +# Convert wiki-table in the article 擃蝑脫楛閮俎4] to csv.[2][3] + +public_research_centric_university = pd.DataFrame(data=[ + [1, "蝡箇憭批飛", "National Taiwan University", 2466494187, "North", ], + [2, "蝡憭批飛", "National Cheng Kung University", 1421845095, "South", ], + [3, "蝡皜臬之摮", "National Tsing Hua University", 1227485103, "North", + "Derived from Beijing, China's Tsing Hua University"], + [4, "蝡賣鈭日憭批飛嚗鈭文之∪嚗", "National Yang Ming Chiao Tung University (Hsinchu)", 1321464208, "North", + "Derived from Shanghai, China's ChiaoTung University"], + [5, "蝡銝剛憭批飛", "National Chung Hsing University", 450197237, "North", ], + [6, "蝡銝剖亢憭批飛", "National Central University", 426576212, "North", ], + [7, "蝡賣鈭日憭批飛嚗賣∪嚗", "National Yang Ming Chiao Tung University (Taipei)", 0, "North", ], + [8, "蝡踵祥憭批飛", "National Chengchi University", 332581716, "North", "Literally, 'National Politics University'"], + [9, "蝡銝剖控憭批飛", "National Sun Yat-sen University", 405826790, "South", ], + [10, "蝡箇撣怎憭批飛", "National Taiwan Normal University", 324963949, "North", ], + [11, "蝡銝剜迤憭批飛", "National Chung Cheng University", 138023217, "South", + "Literally, National Chiang Chung-cheng University"], + [12, "蝡箇瘚瑟憭批飛", "National Taiwan Ocean University", 136547127, "North", ], + [13, "蝡箏憭批飛", "National Taipei University", 98142220, "North", ], + [14, "蝡典憭批飛", "National Chi Nan University", 89662348, "North", ], + [15, "蝡敶啣撣怎憭批飛", "National Changhua University of Education", 77873704, "North", ], + [16, "蝡梯臬之摮", "National Dong Hwa University", 77756120, "Hualien County", ], + [17, "蝡蝢拙之摮", "National Chiayi University", 67795521, "South", ], + [18, "蝡摰剖之摮", "National Ilan University", 60866935, "North", ], + [19, "蝡撅勗之摮", "National Pingtung University", 71360523, "South", ], + [20, "蝡箸勗之摮", "National Taitung University", 64098591, "Taitung County", ], + [21, "蝡箇銵憭批飛", "National Taiwan University of Arts", 60668797, "North", ], + [22, "蝡箏脣之摮", "National Taipei University of Education", 42922168, "North", ], + [23, "蝡擃憭批飛", "National University of Kaohsiung", 52383303, "South", ], + [24, "蝡箏銵憭批飛", "The Taipei National University of the Arts", 57484349, "North", ], + [25, "蝡箔葉脣之摮", "National Taichung University of Education", 61422484, "North", ], + [26, "蝡箏憭批飛", "National University of Tainan", 52336642, "South", ], + [27, "箏撣蝡憭批飛", "University of Taipei", 55253550, "North", ], + [28, "蝡擃脣之摮", "National Taiwan Sport University", 43469196, "North", ], + [29, "蝡臬憭批飛", "National United University", 48254839, "North", ], + [30, "蝡擃撣怎憭批飛", "National Kaohsiung Normal University", 50450179, "South", ], + [31, "蝡箇擃脤憭批飛", "National Taiwan University of Sport", 33282255, "North", ], + [32, "蝡憭批飛", "National Quemoy University", 3319, ], + # [33, "蝡箇擃脤憭批飛", "National Taiwan University of Sport", 3226, "North", ], + [33, "蝡箏銵憭批飛", "Tainan National University of the Arts", 18035952, "South", ], +]) + +print(public_research_centric_university) + +header = ['Number', 'Chinese name', 'English name', 'Budget_received', 'Location', 'Note'] + +# Adding a header to National universities of R&D +public_research_centric_university.columns = header +print(public_research_centric_university) + +# Filter the universities in the north. +condition = public_research_centric_university['Location'] == "North" +north_public_research = public_research_centric_university[condition] +print(north_public_research) + +# Sum of the budget in the north. +total_north_public_research = north_public_research['Budget_received'].sum() +print(total_north_public_research) + +# Filter the universities in the south. +condition = public_research_centric_university['Location'] == "South" +south_public_research = public_research_centric_university[condition] +print(south_public_research) + +# Sum of the budget inn the south. +total_south_public_research = south_public_research['Budget_received'].sum() +print(total_south_public_research) + +fig, ax = plt.subplots(figsize=(6, 6)) + +# The histogram of the data +plt.bar(['Northern Taiwan', 'Southern Taiwan'], [total_north_public_research, total_south_public_research]) + +plt.xlabel('Location (divided by Zhuoshui River)\n\n' + 'Dataset: https://sprout.moe.edu.tw/SproutWeb/Project/DocDownload', + fontproperties="Arial", fontsize=9) + +plt.ylabel('Unit: 1 billion of New Taiwan Dollar') +plt.title('Government budget support for public research universities (蝡憭批飛)\n' + 'in North vs South in 2023', fontproperties="MS Gothic") + +# Tweak spacing to prevent clipping of ylabel +plt.tight_layout() + +img = image.imread('CC-BY.png') + +plt.figimage(X=img, xo=500, yo=500, alpha=0.9) + +# Insert text watermark +plt.text(x=0.6, y=0.7, s="CC-BY 4.0", fontsize=40, color='grey', alpha=0.9, + ha='center', va='center', rotation=30, transform=ax.transAxes) + +plt.show() diff --git a/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/Alloting higher education resources 2022.py b/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/Alloting higher education resources 2022.py new file mode 100644 index 00000000..f1f1cf67 --- /dev/null +++ b/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/Alloting higher education resources 2022.py @@ -0,0 +1,86 @@ +import pandas as pd +import matplotlib.pyplot as plt +# Using the magic encoding +# -*- coding: utf-8 -*- + + +# Convert wiki-table in the article 擃蝑脫楛閮俎4] to csv.[2][3] + +public_research_centric_university = pd.DataFrame(data=[ + [1, "蝡箇憭批飛", "National Taiwan University", 232587, "North", ], + [2, "蝡憭批飛", "National Cheng Kung University", 141178, "South", ], + [3, "蝡皜臬之摮", "National Tsing Hua University", 120394, "North", "Derived from Beijing, China's Tsing Hua University"], + [4, "蝡賣鈭日憭批飛嚗鈭文之∪嚗", "National Yang Ming Chiao Tung University (Hsinchu)", 138078, "North", "Derived from Shanghai, China's ChiaoTung University"], + [5, "蝡銝剛憭批飛", "National Chung Hsing University", 43745, "North", ], + [6, "蝡銝剖亢憭批飛", "National Central University", 42228, "North", ], + [7, "蝡賣鈭日憭批飛嚗賣∪嚗", "National Yang Ming Chiao Tung University (Taipei)", 0, "North", ], + [8, "蝡踵祥憭批飛", "National Chengchi University", 31579, "North", "Literally, 'National Politics University'"], + [9, "蝡銝剖控憭批飛", "National Sun Yat-sen University", 32068, "South", ], + [10, "蝡箇撣怎憭批飛", "National Taiwan Normal University", 14233, "North", ], + [11, "蝡銝剜迤憭批飛", "National Chung Cheng University", 15361, "South", "Literally, National Chiang Chung-cheng University"], + [12, "蝡箇瘚瑟憭批飛", "National Taiwan Ocean University", 14233, "North", ], + [13, "蝡箏憭批飛", "National Taipei University", 8771, "North", ], + [14, "蝡典憭批飛", "National Chi Nan University", 8030, "North", ], + [15, "蝡敶啣撣怎憭批飛", "National Changhua University of Education", 7580, "North", ], + [16, "蝡梯臬之摮", "National Dong Hwa University", 6965, "Hualien County", ], + [17, "蝡蝢拙之摮", "National Chiayi University", 5927, "South", ], + [18, "蝡摰剖之摮", "National Ilan University", 6799, "North", ], + [19, "蝡撅勗之摮", "National Pingtung University", 6619, "South", ], + [20, "蝡箸勗之摮", "National Taitung University", 6178, "Taitung County", ], + [21, "蝡箇銵憭批飛", "National Taiwan University of Arts", 5974, "North", ], + [22, "蝡箏脣之摮", "National Taipei University of Education", 5234, "North", ], + [23, "蝡擃憭批飛", "National University of Kaohsiung", 5502, "South", ], + [24, "蝡箏銵憭批飛", "The Taipei National University of the Arts", 5478, "North", ], + [25, "蝡箔葉脣之摮", "National Taichung University of Education", 5549, "North", ], + [26, "蝡箏憭批飛", "National University of Tainan", 5203, "South", ], + [27, "箏撣蝡憭批飛", "University of Taipei", 5247, "North", ], + [28, "蝡擃脣之摮", "National Taiwan Sport University", 4732, "North", ], + [29, "蝡臬憭批飛", "National United University", 4676, "North", ], + [30, "蝡擃撣怎憭批飛", "National Kaohsiung Normal University", 4347, "South", ], + [31, "蝡箇擃脤憭批飛", "National Taiwan University of Sport", 3229, "North", ], + [32, "蝡憭批飛", "National Quemoy University", 3319, ], + # [33, "蝡箇擃脤憭批飛", "National Taiwan University of Sport", 3226, "North", ], + [33, "蝡箏銵憭批飛", "Tainan National University of the Arts", 1997, "South", ], +]) + +print(public_research_centric_university) + +header = ['Number', 'Chinese name', 'English name', 'Budget_received', 'Location', 'Note'] + +# Adding a header to National universities of R&D +public_research_centric_university.columns = header +print(public_research_centric_university) + +# Filter the universities in the north. +condition = public_research_centric_university['Location'] == "North" +north_public_research = public_research_centric_university[condition] +print(north_public_research) + +# Sum of the budget in the north. +total_north_public_research = north_public_research['Budget_received'].sum() +print(total_north_public_research) + +# Filter the universities in the south. +condition = public_research_centric_university['Location'] == "South" +south_public_research = public_research_centric_university[condition] +print(south_public_research) + +# Sum of the budget inn the south. +total_south_public_research = south_public_research['Budget_received'].sum() +print(total_south_public_research) + +# The histogram of the data +plt.bar(['Northern Taiwan', 'Southern Taiwan'], [total_north_public_research, total_south_public_research]) + +plt.xlabel('Location (divided by Zhuoshui River)\n\n' + 'Dataset: https://sprout.moe.edu.tw/SproutWeb/Project/DocDownload', + fontproperties="Arial", fontsize=9) + +plt.ylabel('Unit: 10 thousands of New Taiwan Dollar') +plt.title('Government budget support for public research universities (蝡憭批飛)\n' + 'in North vs South in 2022', fontproperties="MS Gothic") + +# Tweak spacing to prevent clipping of ylabel +plt.tight_layout() + +plt.show() \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/CC-BY.png b/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/CC-BY.png new file mode 100644 index 00000000..cf596085 Binary files /dev/null and b/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/CC-BY.png differ diff --git a/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/__init__.py b/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/year2022.csv b/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/year2022.csv new file mode 100644 index 00000000..112fdaad --- /dev/null +++ b/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/year2022.csv @@ -0,0 +1,436 @@ +,高等教育深耕計畫核定經費 (一般大學),,單位:元,, +類別,學校代碼,學校名稱,核定經費,, +一般大學,1,國立政治大學,"315,791,943",, +一般大學,2,國立清華大學,"1,203,942,483",, +一般大學,3,國立臺灣大學,"2,325,871,292",, +一般大學,4,國立臺灣師範大學,"220,200,224",, +一般大學,5,國立成功大學,"1,411,784,677",, +一般大學,6,國立中興大學,"437,457,125",, +一般大學,7,國立陽明交通大學,"1,390,785,357",, +一般大學,8,國立中央大學,"422,280,540",, +一般大學,9,國立中山大學,"320,686,779",, +一般大學,12,國立臺灣海洋大學,"142,330,024",, +一般大學,13,國立中正大學,"153,617,924",, +一般大學,14,國立高雄師範大學,"43,477,638",, +一般大學,15,國立彰化師範大學,"75,808,953",, +一般大學,17,國立臺北大學,"87,719,266",, +一般大學,18,國立嘉義大學,"59,276,436",, +一般大學,19,國立高雄大學,"55,029,953",, +一般大學,20,國立東華大學,"69,656,595",, +一般大學,21,國立暨南國際大學,"80,303,430",, +一般大學,28,國立臺北藝術大學,"54,781,643",, +一般大學,29,國立臺灣藝術大學,"59,741,341",, +一般大學,30,國立臺東大學,"61,781,100",, +一般大學,31,國立宜蘭大學,"67,994,462",, +一般大學,32,國立聯合大學,"46,768,772",, +一般大學,35,國立臺南藝術大學,"19,973,297",, +一般大學,36,國立臺南大學,"52,039,141",, +一般大學,37,國立臺北教育大學,"52,345,081",, +一般大學,39,國立臺中教育大學,"55,497,697",, +一般大學,44,國立體育大學,"47,320,991",, +一般大學,48,國立金門大學,"33,199,440",, +一般大學,49,國立臺灣體育運動大學,"32,297,953",, +一般大學,52,國立屏東大學,"66,198,967",, +一般大學,1001,東海大學,"115,049,576",, +一般大學,1002,輔仁大學,"95,699,326",, +一般大學,1003,東吳大學,"91,946,716",, +一般大學,1004,中原大學,"145,368,491",, +一般大學,1005,淡江大學,"92,789,805",, +一般大學,1006,中國文化大學,"68,356,667",, +一般大學,1007,逢甲大學,"142,977,350",, +一般大學,1008,靜宜大學,"94,215,888",, +一般大學,1009,長庚大學,"158,314,094",, +一般大學,1010,元智大學,"105,816,364",, +一般大學,1011,中華大學,"48,565,971",, +一般大學,1012,大葉大學,"54,713,306",, +一般大學,1013,華梵大學,"28,828,807",, +一般大學,1014,義守大學,"94,154,447",, +一般大學,1015,世新大學,"63,264,924",, +一般大學,1016,銘傳大學,"73,644,173",, +一般大學,1017,實踐大學,"64,169,045",, +一般大學,1019,高雄醫學大學,"144,516,638",, +一般大學,1020,南華大學,"58,187,353",, +一般大學,1021,真理大學,"16,040,267",, +一般大學,1022,大同大學,"44,777,226",, +一般大學,1027,慈濟大學,"58,554,909",, +一般大學,1028,臺北醫學大學,"269,976,144",, +一般大學,1029,中山醫學大學,"60,501,274",, +一般大學,1033,長榮大學,"59,979,574",, +一般大學,1035,中國醫藥大學,"196,225,677",, +一般大學,1039,玄奘大學,"25,511,975",, +一般大學,1048,亞洲大學,"64,144,533",, +一般大學,1049,開南大學,"16,598,052",, +一般大學,1050,佛光大學,"44,011,810",, +一般大學,1058,明道大學,"2,716,000",, +一般大學,1067,台灣首府大學,"7,272,943",, +一般大學,1079,康寧大學,"2,175,100",, +一般大學,1125,中信金融管理學院,"20,282,608",, +一般大學,1176,稻江科技暨管理學院,0,, +一般大學,1195,馬偕醫學院,"37,845,308",, +一般大學,1196,法鼓文理學院,"1,482,385",, +一般大學,1R04,一貫道天皇學院,"2,500,000",, +一般大學,3002,臺北市立大學,"52,478,041",, +一般大學,"【備註】 + 1. 學校排序依教育部統計處學校代碼排序呈現。 + 2. 以上含深耕計畫第一部分(主冊、附冊USR、附錄1-就學協助、附錄2-原住民輔導)及 第二部分(全校型、特色領域研究中心之經費。",,,, +,,,,, +,高等教育深耕計畫核定經費 (技專校院),,單位:元,, +類別,學校代碼,學校名稱,核定經費,, +技專校院,22,國立臺灣科技大學,"314,294,000",, +技專校院,23,國立雲林科技大學,"214,976,000",, +技專校院,24,國立屏東科技大學,"160,104,000",, +技專校院,25,國立臺北科技大學,"246,335,000",, +技專校院,33,國立虎尾科技大學,"237,437,000",, +技專校院,42,國立澎湖科技大學,"27,559,992",, +技專校院,43,國立勤益科技大學,"137,820,000",, +技專校院,46,國立臺北護理健康大學,"85,177,000",, +技專校院,47,國立高雄餐旅大學,"81,184,808",, +技專校院,50,國立臺中科技大學,"39,478,000",, +技專校院,51,國立臺北商業大學,"46,907,000",, +技專校院,53,國立高雄科技大學,"397,596,000",, +技專校院,144,國立臺灣戲曲學院,"30,320,000",, +技專校院,221,國立臺南護理專科學校,"22,333,000",, +技專校院,222,國立臺東專科學校,"35,930,648",, +技專校院,1018,朝陽科技大學,"76,507,000",, +技專校院,1023,南臺科技大學,"158,222,000",, +技專校院,1024,崑山科技大學,"211,909,000",, +技專校院,1025,嘉南藥理大學,"90,378,000",, +技專校院,1026,樹德科技大學,"80,828,000",, +技專校院,1030,龍華科技大學,"131,530,000",, +技專校院,1031,輔英科技大學,"39,119,109",, +技專校院,1032,明新科技大學,"53,907,000",, +技專校院,1034,弘光科技大學,"119,671,000",, +技專校院,1036,健行科技大學,"58,087,000",, +技專校院,1037,正修科技大學,"195,553,000",, +技專校院,1038,萬能科技大學,"26,787,256",, +技專校院,1040,建國科技大學,"23,684,000",, +技專校院,1041,明志科技大學,"101,166,000",, +技專校院,1042,高苑科技大學,"6,842,553",, +技專校院,1043,大仁科技大學,"45,767,000",, +技專校院,1045,嶺東科技大學,"55,559,996",, +技專校院,1046,中國科技大學,"73,550,000",, +技專校院,1047,中臺科技大學,"52,594,000",, +技專校院,1051,台南應用科技大學,"41,928,000",, +技專校院,1052,遠東科技大學,"70,025,000",, +技專校院,1053,元培醫事科技大學,"31,912,000",, +技專校院,1054,景文科技大學,"51,488,000",, +技專校院,1055,中華醫事科技大學,"53,508,000",, +技專校院,1056,東南科技大學,"23,226,000",, +技專校院,1057,德明財經科技大學,"41,750,000",, +技專校院,1060,南開科技大學,"34,673,000",, +技專校院,1061,中華科技大學,"28,725,000",, +技專校院,1062,僑光科技大學,"26,776,000",, +技專校院,1063,育達科技大學,"11,653,000",, +技專校院,1064,美和科技大學,"39,765,000",, +技專校院,1065,吳鳳科技大學,"27,853,000",, +技專校院,1066,環球科技大學,"7,670,000",, +技專校院,1068,中州科技大學,"5,144,000",, +技專校院,1069,修平科技大學,"51,579,000",, +技專校院,1070,長庚科技大學,"59,378,000",, +技專校院,1071,臺北城市科技大學,"27,922,000",, +技專校院,1072,敏實科技大學,"6,716,600",, +技專校院,1073,醒吾科技大學,"68,619,000",, +技專校院,1075,文藻外語大學,"65,159,000",, +技專校院,1076,華夏科技大學,"30,311,000",, +技專校院,1077,慈濟科技大學,"48,609,750",, +技專校院,1078,致理科技大學,"79,346,000",, +技專校院,1080,宏國德霖科技大學,"23,148,000",, +技專校院,1082,崇右影藝科技大學,"13,380,000",, +技專校院,1083,台北海洋科技大學,"24,625,000",, +技專校院,1148,大漢技術學院,"9,936,550",, +技專校院,1166,亞東技術學院,"28,000,000",, +技專校院,1168,南亞技術學院,"13,892,000",, +技專校院,1182,蘭陽技術學院,"716,154",, +技專校院,1183,黎明技術學院,"19,600,000",, +技專校院,1185,經國管理暨健康學院,"10,920,000",, +技專校院,1188,大同技術學院,"2,527,000",, +技專校院,1282,馬偕醫護管理專科學校,"25,795,000",, +技專校院,1283,仁德醫護管理專科學校,"26,572,000",, +技專校院,1284,樹人醫護管理專科學校,"32,620,000",, +技專校院,1285,慈惠醫護管理專科學校,"25,062,000",, +技專校院,1286,耕莘健康管理專科學校,"34,429,000",, +技專校院,1287,敏惠醫護管理專科學校,"15,804,723",, +技專校院,1289,育英醫護管理專科學校,"10,477,096",, +技專校院,1290,崇仁醫護管理專科學校,"17,042,000",, +技專校院,1291,聖母醫護管理專科學校,"11,860,000",, +技專校院,1292,新生醫護管理專科學校,"21,214,000",, +,,,,, +,"備註: +1. 學校排序係依教育部統計處學校代碼呈現。 +2. 不含聖約翰科技大學、東方設計大學(2校預定於7-8月核定);臺灣觀光學院、和春技術學院無申請補助。 +3. 以上經費含第一部分(主冊、附冊USR、附錄一就學協助、附錄二原住民輔導)及第二部分研究中心經費。",,,, +,,,,, +,大學社會責任補助計畫(USR)-一般大學,,,, +類別,序號,分區,學校,計畫類型,計畫名稱 +一般大學,1,北北基,國立臺灣大學,大學特色類萌芽型,大學PLUStotheGalaxy:邁向全球在地學習基地的共學生態系 +一般大學,,,,大學特色類萌芽型,永續【雲•林】與食農共榮-社會創新實踐計畫 +一般大學,,,,大學特色類萌芽型,全球衛生的在地參與 +一般大學,2,北北基,國立陽明交通大學,大學特色類萌芽型,部落之星:智慧偏鄉健康培力計畫Tribalstarincubation:IntelligentHEAlthforRemoTeareas(iHEART) +一般大學,,,,大學特色類萌芽型,社區高齡活化大行動-強化體能、智能、技能之社會實踐 +一般大學,3,北北基,國立臺灣師範大學,大學特色類萌芽型,深耕偏鄉教育:加廣、加深、無縫 +一般大學,,,,大學特色類萌芽型,高齡者長健全方位系統升級計畫—營造永續高齡友善社區 +一般大學,4,北北基,臺北市立大學,大學特色類萌芽型,推動活躍老化運動學院•點亮都會健康樂齡活力 +一般大學,,,,大學特色類萌芽型,Vision2025-TAIPEIWAY社區共生網路 +一般大學,5,北北基,國立政治大學,大學特色類深耕型,「興隆安康.共好文山」大學與社區共善計畫 +一般大學,,,,大學特色類萌芽型,偏鄉K-12人文藝術與科技素養提升計畫 +一般大學,6,北北基,臺北醫學大學,大學特色類萌芽型,都會長照青銀共榮共享:建構高齡健康友善的101國際宜居城 +一般大學,,,,大學特色類萌芽型,輔助科技點亮身障族群生活 +一般大學,,,,大學特色類萌芽型,以食為TEN:從山上到平地(Territory),從源頭到餐桌(Enterprise),從學童到老人(Net) +一般大學,,,,大學特色類萌芽型,智齡質感生活聚落示範計畫 +一般大學,7,北北基,淡江大學,大學特色類萌芽型,「農」情「食課」-無毒、有機印象淡水 +一般大學,,,,大學特色類萌芽型,淡蘭海陸輕旅遊、智慧互動趴趴走 +一般大學,,,,國際連結類萌芽型,淡水好生活—學習型城鄉建構計畫 +一般大學,8,北北基,國立臺灣海洋大學,大學特色類萌芽型,打造國際旅遊島:和平島及其周邊之地域創生與永續發展 +一般大學,,,,大學特色類萌芽型,逗陣來貢寮-打造共生共存共享的山海美境 +一般大學,,,,大學特色類萌芽型,智慧樂活水產村 +一般大學,,,,國際連結類萌芽型,三漁興旺-國際藍色經濟示範區 +一般大學,9,北北基,國立臺北大學,大學特色類萌芽型,臺北大學城社會實踐萌芽計畫:邁向共學、共融與公共化 +一般大學,,,,大學特色類萌芽型,環抱海山.深耕三峽:北大文化城的創生與活化 +一般大學,10,北北基,國立臺北藝術大學,大學特色類萌芽型,Hi-FivePlus:從北投平埔族群到屏東原住民的國際藝術對話 +一般大學,11,北北基,大同大學,大學特色類萌芽型,差異群體友善環境之建構與精進—以啟明學校之需求為關懷核心 +一般大學,12,北北基,中國文化大學,大學特色類萌芽型,共創光明頂:陽明山綠能創生與社區轉型行動計畫 +一般大學,13,北北基,國立臺灣藝術大學,大學特色類萌芽型,以大觀創藝聚落開展社區美學實踐計畫 +一般大學,,,,大學特色類萌芽型,社會企業的藝術設計應援團 +一般大學,,,,大學特色類萌芽型,文化河流文資串流-淡水河區域歷史紋理與文化資產保存計畫 +一般大學,14,北北基,東吳大學,大學特色類萌芽型,老士林新共生-跨世代社區慢老計畫 +一般大學,,,,大學特色類萌芽型,前世與今生—再現士林昔日百年風華 +一般大學,15,桃竹苗宜花,國立聯合大學,大學特色類萌芽型,石椄黥ヵS色生活共享模式建構計畫 +一般大學,16,桃竹苗宜花,長庚大學,大學特色類萌芽型,社區兒少創新實踐計畫--早期療育與兒少健康促進 +一般大學,,,,大學特色類萌芽型,偏鄉與人口老化社區健康照護體系建構 +一般大學,17,桃竹苗宜花,國立清華大學,大學特色類萌芽型,新竹區域接地支持實驗室 +一般大學,,,,大學特色類萌芽型,〝S+T+ARTS〞跨學科教育與在地自然生態文創活氧計畫 +一般大學,18,桃竹苗宜花,中華大學,大學特色類萌芽型,驛動新埔–啟動霄裡溪沿線聚落的三生創新 +一般大學,19,桃竹苗宜花,元智大學,大學特色類萌芽型,艾妲資訊培力 +一般大學,,,,大學特色類萌芽型,桃園文化廊道-導覽?記錄?共生 +一般大學,,,,大學特色類萌芽型,寰宇文化領航 +一般大學,20,桃竹苗宜花,國立中央大學,大學特色類萌芽型,從閱讀泰雅到興趣驅動部落學習 +一般大學,,,,大學特色類萌芽型,永續「復興」-打造智慧韌性部落 +一般大學,,,,大學特色類萌芽型,楊梅社會影響力工程再造計畫 +一般大學,,,,大學特色類萌芽型,藝文浸潤永續社區—中壢平鎮在地文化的紮根與共榮 +一般大學,,,,國際連結類深耕型,桃海三生-型塑桃園海岸環境與人文發展永續共生 +一般大學,21,桃竹苗宜花,中原大學,大學特色類深耕型,大梨救小校農創社企新生命-卓蘭「雙連梨」農產興業計畫(二) +一般大學,,,,大學特色類萌芽型,團結經濟、文化夥伴-桃園大海社區文化創生計畫II-台日軍事文化創生連結 +一般大學,,,,國際連結類萌芽型,從霄裡鏈接桃園兩圳文化綠廊之永續經營計畫 +一般大學,22,桃竹苗宜花,國立宜蘭大學,大學特色類萌芽型,實踐里山精神?建構永續農村 +一般大學,,,,大學特色類萌芽型,Tayal(大同、南澳)原鄉部落產業亮點計畫 +一般大學,23,桃竹苗宜花,國立東華大學,大學特色類深耕型,比鄰共好─在地韌性之永續培力行動計畫 +一般大學,,,,大學特色類萌芽型,科技翻轉、永續培力:洄瀾共好在地創新計畫 +一般大學,24,桃竹苗宜花,國立體育大學,大學特色類萌芽型,健身指導讓卓蘭地區健康樂齡,運動科學為桃園地區競技育才 +一般大學,25,桃竹苗宜花,慈濟大學,大學特色類萌芽型,『生活生產觀光合一』光復鄉地方創生培力計畫 +一般大學,26,中彰投,大葉大學,大學特色類萌芽型,實踐里山精神-八卦台地聚落產業共創共學計畫 +一般大學,,,,大學特色類萌芽型,「食尚管理、農法自然」(第二期)-台灣茶(TWT)產業鑫人才培育2.0計畫 +一般大學,27,中彰投,中山醫學大學,大學特色類萌芽型,宜居石岡,永續健康 +一般大學,28,中彰投,中國醫藥大學,大學特色類萌芽型,預防與照護雙軌續航:以人為本的智慧長照x具溫度的科技中醫 +一般大學,29,中彰投,亞洲大學,大學特色類萌芽型,打造高齡失智友善城鎮:失智識能x瑞智升級x智能輔助 +一般大學,30,中彰投,東海大學,大學特色類深耕型,社區高齡服務支持系統的實踐:大學社區共作與國際連結 +一般大學,,,,大學特色類萌芽型,大肚山地方教育創生 +一般大學,31,中彰投,國立中興大學,大學特色類深耕型,浪愛齊步走:流浪動物減量與福祉實踐 +一般大學,,,,大學特色類萌芽型,清流部落賽德克族風華再現計畫 +一般大學,32,中彰投,靜宜大學,大學特色類深耕型,建構幸福銀髮生態圈 +一般大學,33,中彰投,逢甲大學,大學特色類萌芽型,大學伴•偏鄉善:打造銀享智融的移動服務影響圈 +一般大學,,,,大學特色類萌芽型,綠色諧能?循環永續之國際共好計畫 +一般大學,,,,大學特色類萌芽型,部落創生的參與者共保系統計畫 +一般大學,,,,大學特色類萌芽型,臺中市文化城中城地方創生計畫 +一般大學,34,中彰投,國立彰化師範大學,大學特色類萌芽型,深耕芳苑攜手大城:彰化雙城之產業與環境永續計畫 +一般大學,,,,大學特色類萌芽型,白沙×共好教育:十二年國教深耕偏鄉教育計畫 +一般大學,,,,大學特色類萌芽型,社頭織襪-創新、創業、創生 +一般大學,35,中彰投,國立暨南國際大學,大學特色類深耕型,永續環境推動與人才培育計畫:深耕水沙連x開拓東南亞x邁向SDGs +一般大學,,,,大學特色類萌芽型,翻轉偏鄉教育的方法—建構鄉村教育協力隊網絡平台與行動策略 +一般大學,,,,國際連結類萌芽型,地方產業創生與永續發展--南投縣鄉村旅遊深耕計畫 +一般大學,36,中彰投,國立臺中教育大學,大學特色類萌芽型,新生活實驗室.舊城區永續-社企實踐創新育成國際平台計畫 +一般大學,,,,大學特色類萌芽型,〈世代攜手•城市共榮──中教「大學城」之大學社會責任實踐計畫〉 +一般大學,37,雲嘉南,國立中正大學,大學特色類萌芽型,重構大學路:認識、認同與共同行動 +一般大學,,,,大學特色類萌芽型,植種•結晶•昇華—雲嘉地區中小學科學教育揚升計畫 +一般大學,,,,國際連結類萌芽型,竹光發熱綠金計畫-臺灣竹業展風華 +一般大學,38,雲嘉南,國立成功大學,大學特色類萌芽型,農牧共好與農綠共生:以科技民主為行動核心的技術與價值創新 +一般大學,,,,大學特色類萌芽型,惡地協作:淺山地區之區域創生與跨域實踐 +一般大學,,,,大學特色類萌芽型,以微生物科技導入台南市農業區的智慧新農業 +一般大學,,,,國際連結類深耕型,相伴2026:齡感生活微社群行動網 +一般大學,39,雲嘉南,國立臺南大學,大學特色類萌芽型,為偏鄉而教─打造七股偏鄉教育補給站 +一般大學,40,雲嘉南,國立臺南藝術大學,大學特色類萌芽型,臺南山區地方弱勢產業振興計畫—行銷、文創、有機 +一般大學,41,雲嘉南,長榮大學,大學特色類萌芽型,相約檨仔腳-走向整全的社區經濟與照顧之路 +一般大學,,,,大學特色類萌芽型,惡地護老在龍崎—青銀共好AgeLong +一般大學,,,,大學特色類萌芽型,打造台南「社創矽谷」-佈建新化歷史街區社會創新與經濟永續 +一般大學,,,,國際連結類萌芽型,綠色社區根與芽行動計畫-從在地到國際 +一般大學,42,雲嘉南,南華大學,國際連結類萌芽型,以慢城意涵推動宜居城鎮生活 +一般大學,43,高屏澎東,高雄醫學大學,大學特色類深耕型,那瑪夏地區及高雄原鄉永續發展計畫 +一般大學,,,,大學特色類萌芽型,樂活高雄˙健康城市-小港區環境教育與健康促進永續發展計畫 +一般大學,44,高屏澎東,國立中山大學,大學特色類萌芽型,產學合創?在地共融-建構大學合作式培力推廣服務計畫 +一般大學,,,,大學特色類深耕型,城市是一座共事館-鑲嵌於社會紋理的社區實踐TheCityasaCommuseum-SociallyEmbeddedCommunityEngagement +一般大學,,,,國際連結類萌芽型,教育知識在地化與實踐場域全球化:由高雄舊港新灣出發 +一般大學,45,高屏澎東,國立屏東大學,大學特色類萌芽型,搖滾社會力:在地關懷為導向的社會企業與公益實踐培力計畫 +一般大學,,,,大學特色類萌芽型,讓生命不同凡「想」-屏東身心障礙成人服務友善環境的建置 +一般大學,,,,大學特色類萌芽型,朱雀先驅:屏東偏鄉三師共學模式 +一般大學,,,,大學特色類萌芽型,多元文化產業推進器-屏東地方創生實踐計畫 +一般大學,46,高屏澎東,國立高雄師範大學,大學特色類萌芽型,小民再造市集再生 +一般大學,47,高屏澎東,國立臺東大學,大學特色類萌芽型,臺東Y計畫-共創部落好旅遊 +一般大學,,,,大學特色類萌芽型,都蘭之蘭調創生 +一般大學,48,高屏澎東,義守大學,大學特色類萌芽型,義守原鄉攜手共進∼幸福、健康、宜居新莊園 +一般大學,,,,大學特色類萌芽型,以智慧生技導入健康創客小將養成計畫 +,,,,, +,大學社會責任補助計畫(USR)-技專校院,,,, +類別,序號,分區,學校,計畫類型,計畫名稱 +技專校院,1,北北基,明志科技大學,大學特色類萌芽型,北臺首學帶狀文物館行動計畫 +技專校院,,,,大學特色類萌芽型,新北產業鏈結經濟永續發展計畫 +技專校院,2,北北基,東南科技大學,大學特色類萌芽型,淡蘭古道南路綠色旅遊培力起飛計畫 +技專校院,3,北北基,致理科技大學,大學特色類萌芽型,女王的呼召—野柳國際旅遊實驗基地 +技專校院,,,,大學特色類萌芽型,駐點滬尾共創綠色旅遊新價值 +技專校院,,,,大學特色類萌芽型,攜手共構活躍老化與智慧樂活永續社區 +技專校院,,,,大學特色類萌芽型,全通路在地關懷銀髮就醫陪伴媒合服務心價值推動計畫 +技專校院,4,北北基,國立臺北科技大學,大學特色類萌芽型,木創文化攪動深根計畫 +技專校院,,,,國際連結類萌芽型,原住民部落安居構築與綠色樂業推動計畫 +技專校院,5,北北基,國立臺北護理健康大學,大學特色類萌芽型,鏈結區域資源升級長照專業-「北護護你健康、青銀共好標竿計畫」 +技專校院,,,,大學特色類萌芽型,攜手共創萬華失智友善社區 +技專校院,6,北北基,國立臺灣科技大學,大學特色類萌芽型,社區更新活化與韌性提升-以公館城南聚落為例 +技專校院,,,,大學特色類萌芽型,i設計愛學習-營造老少共學的多媒體互動智慧生活環境 +技專校院,,,,大學特色類萌芽型,共好2.0:走在我的身邊,成為我的夥伴 +技專校院,,,,大學特色類深耕型,I-VillagesPlus城鄉牽手深化計畫 +技專校院,,,,國際連結類深耕型,行動工程師培育計畫 +技專校院,7,北北基,中國科技大學,大學特色類萌芽型,萬芳商圈在地產業之活化與升級-智慧城市前導實踐 +技專校院,8,北北基,華夏科技大學,大學特色類萌芽型,華夏南勢在地紮根Plus +技專校院,9,桃竹苗宜花,亞東技術學院,大學特色類萌芽型,USR服務學習實踐模式應用於12年國教課程綱要之研究 +技專校院,10,桃竹苗宜花,長庚科技大學,大學特色類萌芽型,多元在嘉與文化融滲:新住民社區深耕計畫 +技專校院,,,,大學特色類萌芽型,在地扎根•社會共生-健康、就業、教養賦能計畫 +技專校院,,,,大學特色類萌芽型,破繭而出的形象曙光 +技專校院,11,桃竹苗宜花,龍華科技大學,大學特色類萌芽型,樂生生樂—場域重現樂生院區風貌及促進文化振興計畫 +技專校院,,,,大學特色類萌芽型,守護火金姑•最愛塔寮坑 +技專校院,12,桃竹苗宜花,耕莘健康管理專科學校,大學特色類萌芽型,宜蘭三星鄉農棄物六級產業與農村創生 +技專校院,,,,大學特色類萌芽型,「愛在莘裡口常開」~健康護牙支持網絡與服務培力計畫 +技專校院,13,桃竹苗宜花,明新科技大學,大學特色類萌芽型,一三延續、小農永續在地實踐計畫 +技專校院,,,,大學特色類萌芽型,在地實踐•社區連結-明新科技大學以社區為基礎之區域認同發展計畫 +技專校院,14,桃竹苗宜花,仁德醫護管理專科學校,大學特色類萌芽型,融合長照2.0之慢城銀髮優活與地方深耕計畫II +技專校院,15,桃竹苗宜花,慈濟科技大學,大學特色類萌芽型,共創失智友善及高齡健康促進支持網絡 +技專校院,16,桃竹苗宜花,萬能科技大學,大學特色類萌芽型,桃園食品安全及社區健康營造計畫 +技專校院,17,中彰投,中臺科技大學,大學特色類萌芽型,場域永續與人才培育-大坑后里食農與國高中小學食安食育的社會實踐 +技專校院,,,,大學特色類萌芽型,文資蘊生-深耕文化資產與人才培育計畫 +技專校院,18,中彰投,弘光科技大學,大學特色類萌芽型,中部沿海敏感族群之低碳宜居環境共築計畫 +技專校院,19,中彰投,南開科技大學,大學特色類萌芽型,形塑青銀共好場域實現在地永續長照-打造南投不老城鎮 +技專校院,,,,大學特色類深耕型,南投百香果資源永續之煉銀網平台 +技專校院,20,中彰投,修平科技大學,大學特色類萌芽型,再現田頭水-田中、社頭、二水區域整合計畫 +技專校院,,,,大學特色類萌芽型,文蛤智慧養殖與科學管理永續發展計畫 +技專校院,,,,大學特色類深耕型,農業地方創生系統 +技專校院,21,中彰投,國立勤益科技大學,大學特色類萌芽型,中部菇類產業創生與永續經營提升計畫 +技專校院,,,,大學特色類萌芽型,智慧創新在地實踐─枇杷荔枝共譜太平盛世 +技專校院,22,中彰投,國立臺中科技大學,大學特色類萌芽型,啟動山城濁水台3線智慧創新商業模式-產學攜手共伴與地方產業鏈結 +技專校院,23,中彰投,朝陽科技大學,大學特色類萌芽型,新農復穀-雜糧壯遊-同耕共學-擴散計畫 +技專校院,,,,大學特色類萌芽型,幼老共和國之幼老共園在地老化社會創新的實踐 +技專校院,,,,大學特色類萌芽型,八卦山下的科技大花現 +技專校院,,,,大學特色類萌芽型,智慧商務與行銷塑造南投中寮石虎與農業優化創生社會實踐模式 +技專校院,24,中彰投,嶺東科技大學,大學特色類萌芽型,人才留鄉協力創新林下經濟價值 +技專校院,,,,大學特色類萌芽型,STEM科教隊,在地攜手創作優質課程計畫 +技專校院,,,,大學特色類萌芽型,烏日高鐵特區社區觀光資源整合與行銷 +技專校院,,,,大學特色類萌芽型,中區綠時尚循環經濟深耕計畫 +技專校院,25,雲嘉南,吳鳳科技大學,大學特色類萌芽型,諸羅桃城好厝邊、安全享壽呷百二 +技專校院,,,,大學特色類萌芽型,幼見幸福嘉園-嘉義非營利性幼兒園的代間共融 +技專校院,26,雲嘉南,中華醫事科技大學,大學特色類萌芽型,南關線智慧健康幸福扎根計畫 +技專校院,,,,國際連結類萌芽型,臺南溪北淺山地區培青富老戰略計畫暨MakeMandaluyong’shealthandwell-beingstrongagain. +技專校院,27,雲嘉南,台南應用科技大學,大學特色類萌芽型,志在琉鄉-青銀共創?價值再造 +技專校院,,,,大學特色類萌芽型,消失的針線-刺繡技藝傳承與記憶延伸 +技專校院,,,,大學特色類深耕型,臺南農安樂活好食在 +技專校院,28,雲嘉南,南臺科技大學,大學特色類萌芽型,文化底蘊的在地創生與傳播府城vs月津 +技專校院,,,,大學特色類深耕型,青銀共創攜手在地共築智慧高齡友善社區 +技專校院,29,雲嘉南,國立虎尾科技大學,大學特色類萌芽型,深耕虎尾溪流域—他里霧平原螢光計畫 +技專校院,,,,大學特色類萌芽型,在地固著、國際流動–文化永續跨域實踐 +技專校院,,,,大學特色類深耕型,永續環境-傳續師徒精神-承續農業區域優勢 +技專校院,30,雲嘉南,國立雲林科技大學,大學特色類萌芽型,雲林養雞產業之社會實踐計畫:溯源供應鏈之塑造與永續營運 +技專校院,,,,大學特色類萌芽型,淺山農村的社會設計培力共構計畫 +技專校院,31,雲嘉南,崑山科技大學,大學特色類萌芽型,既培力也使力-以人才培育為底蘊創生新官田 +技專校院,,,,大學特色類萌芽型,南關線的飲食文化學堂–慢.食.行.旅計畫 +技專校院,,,,國際連結類萌芽型,永康工業區及鄰近區域暨國際化綠色需求和永續發展 +技專校院,32,雲嘉南,嘉南藥理大學,大學特色類萌芽型,濃濃香洋風,再造關廟情 +技專校院,,,,大學特色類萌芽型,營造Alia(e)n宜居地 +技專校院,,,,大學特色類萌芽型,永續安南環境生態與綠色產業 +技專校院,33,高屏澎東,大仁科技大學,大學特色類萌芽型,社區食品安全防護網與永續環境經營 +技專校院,,,,大學特色類萌芽型,長照知識整合與實踐-營造屏東在地幸福活躍老化新願景 +技專校院,,,,大學特色類萌芽型,台9線原鄉特色加值發展-獅子鄉文化資產永續 +技專校院,,,,大學特色類萌芽型,書香舒活宜居城:田園趣產業的推動與實踐 +技專校院,34,高屏澎東,樹德科技大學,大學特色類萌芽型,城鄉資訊能力深化培育與應用推廣計畫 +技專校院,,,,大學特色類深耕型,橫山USR綠色內涵整體實踐行動計畫 +技專校院,35,高屏澎東,樹人醫護管理專科學校,大學特色類萌芽型,青銀攜手銀髮樂活、跨界整合實踐計畫 +,36,高屏澎東,輔英科技大學,大學特色類萌芽型,大發工業區鄰近敏感區域永續健康大氣環境營造與環境教育拓展計畫 +,,,,大學特色類萌芽型,永續健康促進人才培育-深耕在地時間銀行及失智照護~輔英憶路共老守護,營造共生共好社區~ +技專校院,37,高屏澎東,國立澎湖科技大學,大學特色類萌芽型,文化、食安、長照—澎湖健康福祉營造工程計畫 +技專校院,38,高屏澎東,高苑科技大學,大學特色類萌芽型,高雄市大岡山地區東亞多元文化融合總體營造 +技專校院,39,高屏澎東,國立屏東科技大學,大學特色類萌芽型,從共森到創生之路--里山林下經濟網絡推動計畫 +技專校院,40,高屏澎東,國立高雄科技大學,大學特色類萌芽型,安居桃花源.港都山線韌性城鄉營建計畫 +技專校院,,,,大學特色類萌芽型,「智慧守望,環境再生」計畫(e-WATCHER) +技專校院,,,,大學特色類深耕型,海岸創生鑽石魚鄉-高雄永安漁村實踐計畫 +技專校院,,,,大學特色類深耕型,「春燕築巢.地方創生」從新農業出發 +技專校院,,,,國際連結類深耕型,鄰家好漁形塑計畫 +技專校院,41,高屏澎東,國立高雄餐旅大學,大學特色類萌芽型,台灣風土在地酒文化復育、教育及推廣發展實踐計畫 +技專校院,42,高屏澎東,文藻外語大學,大學特色類萌芽型,「溫暖白色巨塔的小螺絲釘-文藻國際志工共創就醫無障礙」USR社會實踐計畫 +技專校院,,,,大學特色類萌芽型,藻到新力亮~文藻USR新住民(新移工)關懷增能計畫 +技專校院,43,高屏澎東,正修科技大學,大學特色類萌芽型,蕉傲?大旗山典範創新合作生產推動計畫 +技專校院,,,,大學特色類萌芽型,食在安心,銀向健康,攜手樂活新林園 +技專校院,,,,大學特色類萌芽型,高山秘境、市外桃源-偏鄉產業升級暨品牌加值實踐計畫 +技專校院,,,,大學特色類萌芽型,沁透新埤-打造新埤社會責任學習大學協助偏鄉地方產業升級計畫 +技專校院,44,高屏澎東,美和科技大學,大學特色類萌芽型,屏東可可孵夢.產業破殼之創生實踐計畫 +,,,,, +深耕計畫第二部分 全球鏈結核定學校,,,,, +一、Global Taiwan 全校型學校,,,,, +學校代碼,學校名稱,,,, +2,國立清華大學,,,, +3,國立臺灣大學,,,, +5,國立成功大學,,,, +7,國立交通大學,,,, +二、Global Taiwan 研究中心,,,,, +學校名稱,領域,計畫名稱,,, +中國醫藥大學,醫學,新藥開發研究中心,,, +中國醫藥大學,醫學,中醫藥研究中心,,, +長庚大學,生命科學/農學,新興病毒感染研究中心,,, +長庚大學,生命科學/農學,健康老化研究中心,,, +長庚大學,醫學,分子醫學研究中心,,, +高雄醫學大學,生命科學/農學,環境醫學研究中心,,, +國立中山大學,社會科學,智慧電子商務研究中心,,, +國立中山大學,理學,晶體研究中心,,, +國立中央大學,理學,地震災害鏈風險評估及管理中心,,, +國立中央大學,理學,高能與強場物理研究中心,,, +國立中央大學,理學,太空科學與科技研究中心,,, +國立中正大學,工學(一般),前瞻製造系統頂尖研究中心,,, +國立中正大學,社會科學,高齡跨域創新研究中心,,, +國立中興大學,生命科學/農學,前瞻植物生技研究中心,,, +國立中興大學,生命科學/農學,永續農業創新發展中心,,, +國立中興大學,生命科學/農學,鳥禽遺傳資源暨動物生技研究中心,,, +國立陽明交通大學,工學(一般),智慧半導體奈米系統技術研究中心,,, +國立陽明交通大學,工學(一般),開源智能聯網研究中心,,, +國立陽明交通大學,工學(一般),神經調控醫療電子系統研究中心,,, +國立陽明交通大學,生命科學/農學,智慧型藥物與智能生物裝置研究中心,,, +國立陽明交通大學,社會科學,文化研究國際中心,,, +國立陽明交通大學,理學,新世代功能性物質研究中心,,, +國立陽明交通大學,醫學,腦科學研究中心,,, +國立陽明交通大學,醫學,腫瘤惡化卓越研究中心,,, +國立成功大學,工學(一般),前瞻醫療器材科技中心,,, +國立成功大學,工學(一般),智慧製造研究中心,,, +國立成功大學,工學(一般),跨維綠能材料研究中心,,, +國立成功大學,生命科學/農學,國際傷口修復與再生中心,,, +國立成功大學,生命科學/農學,前瞻蝦類養殖國際研發中心,,, +國立成功大學,社會科學,Fintech商創研究中心,,, +國立成功大學,醫學,奈米醫學研究中心,,, +國立政治大學,人文藝術,華人文化主體性研究中心,,, +國立政治大學,社會科學,臺灣政經傳播研究中心,,, +國立清華大學,工學(一般),高熵材料研發中心,,, +國立清華大學,理學,前瞻物質基礎與應用科學中心,,, +國立清華大學,理學,前瞻量子科技研究中心,,, +國立清華大學,醫學,腦科學研究中心,,, +國立臺灣大學,工學(一般),前瞻綠色材料高值化研究中心,,, +國立臺灣大學,社會科學,計量理論與應用研究中心,,, +國立臺灣大學,理學,新穎材料原子級科學研究中心,,, +國立臺灣大學,理學,永續地球尖端科學研究中心,,, +國立臺灣大學,醫學,精準醫學研究中心,,, +國立臺灣師範大學,人文藝術,華語文與科技研究中心計畫,,, +國立臺灣師範大學,社會科學,學習科學跨國頂尖研究中心計畫,,, +國立臺灣海洋大學,工學(一般),海洋工程科技中心,,, +國立臺灣海洋大學,理學,海洋中心,,, +臺北醫學大學,醫學,癌症轉譯研究中心,,, +正修科技大學,生命科學/農學,環境毒物與新興汙染物研究中心,,, +國立虎尾科技大學,工學(技職),智能機械與智慧製造研究中心,,, +國立屏東科技大學,生命科學/農學,動物製劑研究中心,,, +國立高雄科技大學,工學(技職),前瞻模具技術研究發展中心,,, +國立雲林科技大學,人文藝術,智能地域設計服務研究中心,,, +國立雲林科技大學,工學(技職),智慧辨識產業服務研究中心,,, +國立臺北科技大學,工學(技職),智慧紡織科技研發中心,,, +國立臺北科技大學,工學(技職),新世代住商與工業節能研究中心,,, +國立臺灣科技大學,工學(技職),臺灣建築科技中心,,, +國立臺灣科技大學,工學(技職),高速3D列印研究中心,,, +國立臺灣科技大學,工學(技職),網宇實體系統創新中心,,, +崑山科技大學,工學(技職),綠能科技研究中心,,, diff --git a/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/year2023.csv b/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/year2023.csv new file mode 100644 index 00000000..48654724 --- /dev/null +++ b/The attainments and realizations of my dreams/Yearly Higher Education Budget Allotment/year2023.csv @@ -0,0 +1,508 @@ +高等教育深耕計畫核定經費 (一般大學),,,, +類別,學校代碼,學校名稱,核定經費, +,,,單位:元, +一般大學,1,國立政治大學,"332,581,716", +一般大學,2,國立清華大學,"1,227,485,103", +一般大學,3,國立臺灣大學,"2,466,494,187", +一般大學,4,國立臺灣師範大學,"324,963,949", +一般大學,5,國立成功大學,"1,421,845,095", +一般大學,6,國立中興大學,"450,197,237", +一般大學,7,國立陽明交通大學,"1,321,464,208", +一般大學,8,國立中央大學,"426,576,212", +一般大學,9,國立中山大學,"405,826,790", +一般大學,12,國立臺灣海洋大學,"136,547,127", +一般大學,13,國立中正大學,"138,023,217", +一般大學,14,國立高雄師範大學,"50,450,179", +一般大學,15,國立彰化師範大學,"77,873,704", +一般大學,17,國立臺北大學,"98,142,220", +一般大學,18,國立嘉義大學,"67,795,521", +一般大學,19,國立高雄大學,"52,383,303", +一般大學,20,國立東華大學,"77,756,120", +一般大學,21,國立暨南國際大學,"89,662,348", +一般大學,28,國立臺北藝術大學,"57,484,349", +一般大學,29,國立臺灣藝術大學,"60,668,797", +一般大學,30,國立臺東大學,"64,098,591", +一般大學,31,國立宜蘭大學,"60,866,935", +一般大學,32,國立聯合大學,"48,254,839", +一般大學,35,國立臺南藝術大學,"18,035,952", +一般大學,36,國立臺南大學,"52,336,642", +一般大學,37,國立臺北教育大學,"42,922,168", +一般大學,39,國立臺中教育大學,"61,422,484", +一般大學,44,國立體育大學,"43,469,196", +一般大學,48,國立金門大學,"30,595,162", +一般大學,49,國立臺灣體育運動大學,"33,282,255", +一般大學,52,國立屏東大學,"71,360,523", +一般大學,1001,東海大學,"118,910,367", +一般大學,1002,輔仁大學,"107,901,179", +一般大學,1003,東吳大學,"97,295,635", +一般大學,1004,中原大學,"155,026,796", +一般大學,1005,淡江大學,"111,196,814", +一般大學,1006,中國文化大學,"72,749,681", +一般大學,1007,逢甲大學,"148,700,886", +一般大學,1008,靜宜大學,"103,366,677", +一般大學,1009,長庚大學,"112,670,208", +一般大學,1010,元智大學,"107,201,017", +一般大學,1011,中華大學,"49,337,949", +一般大學,1012,大葉大學,"41,843,361", +一般大學,1013,華梵大學,"36,702,532", +一般大學,1014,義守大學,"94,198,796", +一般大學,1015,世新大學,"63,380,404", +一般大學,1016,銘傳大學,"77,610,491", +一般大學,1017,實踐大學,"82,591,395", +一般大學,1019,高雄醫學大學,"155,776,156", +一般大學,1020,南華大學,"59,765,478", +一般大學,1021,真理大學,"15,031,132", +一般大學,1022,大同大學,"49,711,476", +一般大學,1027,慈濟大學,"61,470,333", +一般大學,1028,臺北醫學大學,"276,161,839", +一般大學,1029,中山醫學大學,"59,791,865", +一般大學,1033,長榮大學,"51,477,733", +一般大學,1035,中國醫藥大學,"220,442,897", +一般大學,1039,玄奘大學,"30,102,776", +一般大學,1048,亞洲大學,"73,750,020", +一般大學,1049,開南大學,"13,936,583", +一般大學,1050,佛光大學,"45,680,178", +一般大學,1058,明道大學,"1,725,950", +一般大學,1067,台灣首府大學,"400,000", +一般大學,1079,康寧大學,"4,682,000", +一般大學,1125,中信金融管理學院,"20,290,218", +一般大學,1195,馬偕醫學院,"41,308,616", +一般大學,1196,法鼓文理學院,"2,216,065", +一般大學,3002,臺北市立大學,"55,253,550", +一般大學,1R03,臺北基督書院,"316,000", +一般大學,1R04,一貫道天皇學院,"95,000", +一般大學,"【備註】 + 1. 學校排序依教育部統計處學校代碼排序呈現。 + 2. 以上含深耕計畫第一部分(主冊計畫、主冊專章、附冊、附錄一、附錄二)及第二部分(全校型、特色領域研究中心)之經費。",,, +,,,, +高等教育深耕計畫核定經費 (技專校院),,,, +類別,學校代碼,學校名稱,核定經費, +,,,單位:元, +技專校院,22,國立臺灣科技大學,424512000, +技專校院,23,國立雲林科技大學,236482000, +技專校院,24,國立屏東科技大學,177178463, +技專校院,25,國立臺北科技大學,337399000, +技專校院,33,國立虎尾科技大學,242324000, +技專校院,42,國立澎湖科技大學,33509000, +技專校院,43,國立勤益科技大學,150680000, +技專校院,46,國立臺北護理健康大學,98546000, +技專校院,47,國立高雄餐旅大學,85218000, +技專校院,50,國立臺中科技大學,48859000, +技專校院,51,國立臺北商業大學,50628000, +技專校院,53,國立高雄科技大學,397181000, +技專校院,144,國立臺灣戲曲學院,31982000, +技專校院,221,國立臺南護理專科學校,26030000, +技專校院,222,國立臺東專科學校,32777000, +技專校院,1018,朝陽科技大學,99241000, +技專校院,1023,南臺科技大學,186114000, +技專校院,1024,崑山科技大學,184720000, +技專校院,1025,嘉南藥理大學,104146000, +技專校院,1026,樹德科技大學,93569000, +技專校院,1030,龍華科技大學,147951000, +技專校院,1031,輔英科技大學,43572618, +技專校院,1032,明新科技大學,64005000, +技專校院,1034,弘光科技大學,122812500, +技專校院,1036,健行科技大學,58575650, +技專校院,1037,正修科技大學,242848000, +技專校院,1038,萬能科技大學,25543500, +技專校院,1040,建國科技大學,27487000, +技專校院,1041,明志科技大學,109540000, +技專校院,1042,高苑科技大學,2313930, +技專校院,1043,大仁科技大學,45623000, +技專校院,1044,聖約翰科技大學,22008000, +技專校院,1045,嶺東科技大學,57443000, +技專校院,1046,中國科技大學,73590000, +技專校院,1047,中臺科技大學,56503000, +技專校院,1051,台南應用科技大學,43023000, +技專校院,1052,遠東科技大學,66229000, +技專校院,1053,元培醫事科技大學,39243000, +技專校院,1054,景文科技大學,58411000, +技專校院,1055,中華醫事科技大學,54675000, +技專校院,1056,東南科技大學,25553000, +技專校院,1057,德明財經科技大學,54490000, +技專校院,1060,南開科技大學,34499000, +技專校院,1061,中華科技大學,34005000, +技專校院,1062,僑光科技大學,37334000, +技專校院,1063,育達科技大學,19240000, +技專校院,1064,美和科技大學,41718000, +技專校院,1065,吳鳳科技大學,28633000, +技專校院,1066,環球科技大學,5240000, +技專校院,1068,中州科技大學,412500, +技專校院,1069,修平科技大學,49545000, +技專校院,1070,長庚科技大學,63631000, +技專校院,1071,臺北城市科技大學,32869000, +技專校院,1072,敏實科技大學,10780000, +技專校院,1073,醒吾科技大學,73818000, +技專校院,1075,文藻外語大學,64316000, +技專校院,1076,華夏科技大學,25605000, +技專校院,1077,慈濟科技大學,52205000, +技專校院,1078,致理科技大學,88388100, +技專校院,1080,宏國德霖科技大學,26560000, +技專校院,1081,東方設計大學,4509000, +技專校院,1082,崇右影藝科技大學,16770000, +技專校院,1083,台北海洋科技大學,34095000, +技專校院,1084,亞東科技大學,33970000, +技專校院,1148,大漢技術學院,10752550, +技專校院,1168,南亞技術學院,14316000, +技專校院,1183,黎明技術學院,28610000, +技專校院,1185,經國管理暨健康學院,21482000, +技專校院,1188,大同技術學院,2110000, +技專校院,1282,馬偕醫護管理專科學校,31064000, +技專校院,1283,仁德醫護管理專科學校,25441230, +技專校院,1284,樹人醫護管理專科學校,29115000, +技專校院,1285,慈惠醫護管理專科學校,19538000, +技專校院,1286,耕莘健康管理專科學校,36985000, +技專校院,1287,敏惠醫護管理專科學校,18038786, +技專校院,1289,育英醫護管理專科學校,11046000, +技專校院,1291,聖母醫護管理專科學校,12843000, +技專校院,1292,新生醫護管理專科學校,23361882, +技專校院,1293,崇仁醫護管理專科學校,18986000, +技專校院,"備註: +1.金額包含第一部分(主冊計畫、主冊專章、附冊、附錄一、附錄二)、第二部分。 +2.中州科技大學112年7月31日停辦。 +3.東方設計大學、高苑科技大學、環球科技大學、大同技術學院為專案輔導學校。",,, +,,,, +大學社會責任補助計畫(USR)-一般大學,,,, +類別,序號,學校名稱,計畫類型,計畫名稱 +一般大學,1,大同大學,大學特色類萌芽型,同興協力—應用公民設計科學於社區學習教學與場域實踐 +一般大學,2,大同大學,大學特色類深耕型,永續共榮在大同:優質教育與跨域實踐之差異群體服務基地加值計畫 +一般大學,3,中國文化大學,大學特色類萌芽型,北海岸社區韌性:在地永續知識與經濟創生 +一般大學,4,中國文化大學,大學特色類深耕型,共創光明頂:陽明山社區創生新願景 +一般大學,5,東吳大學,大學特色類萌芽型,北投心韌齡生活圈 +一般大學,6,東吳大學,大學特色類萌芽型,老士林新共生-建立跨世代社區支持網 +一般大學,7,東吳大學,大學特色類深耕型,文化永續•城市創生:士林學之建構 +一般大學,8,馬偕醫學院,大學特色類萌芽型,給三芝全面的愛:社區老人多層面健康促進計畫 +一般大學,9,馬偕醫學院,大學特色類萌芽型,脫穎而出成為茭佼者 +一般大學,10,國立政治大學,大學特色類萌芽型,以鄉村地區整體規劃落實里山經濟 +一般大學,11,國立政治大學,大學特色類萌芽型,雜貨店2.0老店新開: 順路經濟與社會資源整合平台計畫 +一般大學,12,國立陽明交通大學,大學特色類深耕型,部落之星:智慧偏鄉健康培力計畫 +一般大學,13,國立陽明交通大學,大學特色類深耕型,青銀攜手•科技協力•賦能社區•守護獨老行動計畫 +一般大學,14,國立臺北大學,大學特色類萌芽型,推動三鶯地區永續低碳經濟生活圈 +一般大學,15,國立臺北大學,大學特色類萌芽型,環抱海山深耕三峽:北大文化城的創生、活化與擴展 +一般大學,16,國立臺北大學,大學特色類深耕型,前瞻超高齡的大學3E行動計畫:Establishment、Engagement、and Empowerment +一般大學,17,國立臺北藝術大學,大學特色類萌芽型,漁村轉型、文化永續: 依海而生在地知識的轉譯與活用之共學共創 +一般大學,18,國立臺灣大學,大學特色類萌芽型,臺大?山林?學院 +一般大學,19,國立臺灣大學,大學特色類萌芽型,文化|健康:文化安全健康促進推動整合計畫 +一般大學,20,國立臺灣大學,大學特色類萌芽型,感測公民培力、環境舒適度健檢及在地社區氣候行動:一個科學社會溝通及循證治理過程的探索 +一般大學,21,國立臺灣大學,大學特色類深耕型,大學PLUS:臺灣鄉創俱樂部 +一般大學,22,國立臺灣大學,大學特色類深耕型,攜手?雲林-特色農業產區 深耕產業鏈結 +一般大學,23,國立臺灣師範大學,大學特色類萌芽型,全球在地取向的金門地方創生與青創培力計畫 +一般大學,24,國立臺灣師範大學,大學特色類萌芽型,臺灣心連新-運用前瞻科技提昇新住民及其子女華語文能力及雙語師資培育計畫 +一般大學,25,國立臺灣師範大學,大學特色類深耕型,深耕偏鄉教育:深化、廣化、國際化、永續化 +一般大學,26,國立臺灣師範大學,大學特色類深耕型,打造高齡者數位包容智慧長健學苑計畫 +一般大學,27,國立臺灣海洋大學,大學特色類萌芽型,雲林四口,里海漁鄉-低碳×創生×永續×關懷計畫 +一般大學,28,國立臺灣海洋大學,大學特色類深耕型,貢寮美境山海川區域發展深耕計畫 +一般大學,29,國立臺灣海洋大學,大學特色類深耕型,智慧樂活水產村 +一般大學,30,國立臺灣海洋大學,大學特色類深耕型,打造國際旅遊島-智慧共享經濟與永續實踐 +一般大學,31,國立臺灣海洋大學,永續發展類國際合作型,三漁興旺-國際藍色經濟示範區 +一般大學,32,國立臺灣藝術大學,大學特色類萌芽型,文化河流 • 文資串流 —淡水河水系流域文化資產保存計畫 +一般大學,33,淡江大學,大學特色類萌芽型,守滬樂齡宜然自得:建置以長者為關懷的「為愛AI陪伴」手機APP +一般大學,34,淡江大學,大學特色類萌芽型,為樂齡而行:跨代原力、青銀共創 +一般大學,35,淡江大學,大學特色類深耕型,農情食課:建構北海岸永續食農教育基地/第二期計畫主案:「農」情「食課」-無毒、有機印象淡水 +一般大學,36,淡江大學,大學特色類深耕型,淡北風情e線牽、海陸旅遊全體驗/第二期計畫主案:淡蘭海陸輕旅遊、智慧互動趴趴走 +一般大學,37,淡江大學,永續發展類特色永續型,淡水好生活:山海河賦創設計行動/第二期計畫主案:淡水好生活–學習型城鄉建構計畫 +一般大學,38,華梵大學,大學特色類萌芽型,乘龍風蘊耀大崙,古道帶動旅創新生命:?淡蘭古道為主軸的地方創生實踐 +一般大學,39,華梵大學,大學特色類萌芽型,石碇之音-百年石頭屋藝術造鎮參與規劃工作站、工藝駐村與行旅藝文體驗計畫 +一般大學,40,華梵大學,大學特色類萌芽型,無人機山區防災救災系統-石碇模式 +一般大學,41,實踐大學,大學特色類萌芽型,漸凍症病友科技生活設計 +一般大學,42,實踐大學,大學特色類萌芽型,內門文創生活之活化:文化為心、創意為魂、科技為魄 +一般大學,43,實踐大學,大學特色類萌芽型,點亮城市裡的偏鄉─光點三創實踐計畫 +一般大學,44,實踐大學,大學特色類萌芽型,北投學-在北投向北投學 +一般大學,45,實踐大學,大學特色類萌芽型,囊螢東高【與南島語族相遇】創課微旅:螢光發掘、囊袋維持陪伴計畫內山篇 +一般大學,46,臺北市立大學,大學特色類萌芽型,「你我共好」的善循環-社區永續的倡導、關懷與場域經營 +一般大學,47,臺北市立大學,大學特色類萌芽型,臺北城西文化地景的沉浸式再現:人文藝術結合城市行銷培力的永續實踐 +一般大學,48,臺北醫學大學,大學特色類萌芽型,以街區經濟為根基之中草藥文化復振與創新 +一般大學,49,臺北醫學大學,大學特色類萌芽型,智齡質感生活聚落示範計畫2.0:邁向淨零綠生活 +一般大學,50,臺北醫學大學,大學特色類萌芽型,永續綠能飲食救地球 +一般大學,51,臺北醫學大學,大學特色類深耕型,都會長照青銀創生永續:建構高齡健康失智友善101生態圈 +一般大學,52,輔仁大學,大學特色類萌芽型,復元力:惜食分享 共生新莊 +一般大學,53,輔仁大學,大學特色類萌芽型,輔仁好學·好(ㄏㄠˋ)學新莊計畫 +一般大學,54,銘傳大學,大學特色類萌芽型,龜旅價值共創-從文化走讀到土地連結 +一般大學,55,中原大學,大學特色類萌芽型,永續社區環保公益博物館串聯計劃 +一般大學,56,中原大學,大學特色類深耕型,團結經濟、文化夥伴-桃園大海社區文化創生計畫III-航空城計畫進行式的人文延續 +一般大學,57,中原大學,永續發展類國際合作型,流動與鏈結:桃園埤圳文化與國際多元鏈結 +一般大學,58,中華大學,大學特色類萌芽型,馥活茶花智慧創生計畫 +一般大學,59,中華大學,大學特色類萌芽型,驛動新埔-種希望樹、點幸福燈之綠色共生 +一般大學,60,元智大學,大學特色類萌芽型,綠色循環經濟-創新創業實踐場 +一般大學,61,元智大學,大學特色類萌芽型,艾妲資訊培力 +一般大學,62,元智大學,大學特色類深耕型,寰宇文化領航 +一般大學,63,玄奘大學,大學特色類萌芽型,泰雅爾·巴來─深度部落休閒產業推動計畫 +一般大學,64,玄奘大學,大學特色類萌芽型,新埔旱坑柿家創新永續計畫 +一般大學,65,佛光大學,大學特色類萌芽型,建構宜蘭茶產業永續發展的跨領域人才共培機制 +一般大學,66,長庚大學,大學特色類萌芽型,『職能、共融、永續』-身心障礙者工作培力實踐計畫 「第二期HUB計畫主案:職人創造,能力營造-共建身心障礙者的就業環境與社區共融計畫」 +一般大學,67,長庚大學,大學特色類萌芽型,早期療育及健康發展促進創新實踐計劃 +一般大學,68,長庚大學,大學特色類深耕型,人口老化社區健康照護體系建構-在地與偏鄉 +一般大學,69,國立中央大學,大學特色類萌芽型,身生不息─桃園身障包容科技與包容創業教育 +一般大學,70,國立中央大學,大學特色類深耕型,mbhoyaw「復興」─以永續為關鍵詞的跨域共作 +一般大學,71,國立中央大學,永續發展類國際合作型,海好友你─桃海三生開闊國際夥伴永續力 +一般大學,72,國立東華大學,大學特色類深耕型,智慧淨洄瀾合作永共融 +一般大學,73,國立東華大學,永續發展類特色永續型,比鄰共好:柔韌永續之共好生活實踐 +一般大學,74,國立清華大學,大學特色類萌芽型,TNUNAN歌劇音樂會:以文化回應式教學推動泰雅醫療人才培育計畫 +一般大學,75,國立清華大學,大學特色類萌芽型,永續發展教育的跨領域韌性整合與社會實踐: 以南寮沿海社區與自然谷為里山海實踐場域 +一般大學,76,國立清華大學,大學特色類萌芽型,〝S+M+ART〞跨學科與創客藝術在地智慧活氧計畫 +一般大學,77,國立清華大學,永續發展類特色永續型,REAL+:新竹區域產業與文化支持系統 +一般大學,78,國立聯合大學,大學特色類萌芽型,聯合IN苗栗加速食農教育→永續環境 +一般大學,79,國立聯合大學,大學特色類萌芽型,苑裡藺草編織工藝的互惠展銷體驗設計 +一般大學,80,國立聯合大學,大學特色類萌芽型,共下生活學習實驗室:打哪叭共創聚落計畫 +一般大學,81,慈濟大學,大學特色類萌芽型,社區健康領航員-跨族群健康upup計畫 +一般大學,82,慈濟大學,大學特色類深耕型,里山團結碳經濟-永續消費與生產的共學實踐 +一般大學,83,中山醫學大學,大學特色類萌芽型,跨域培力,共創樂活 +一般大學,84,中國醫藥大學,大學特色類萌芽型,中西醫整合優質照護,守護兒童與青少年健康計劃 +一般大學,85,中國醫藥大學,大學特色類萌芽型,中藥養生-西藥精準:食品藥物安全鏈結之社會實踐 +一般大學,86,亞洲大學,大學特色類萌芽型,學習不孤單:偏鄉AI雙語學伴培育計畫 +一般大學,87,亞洲大學,大學特色類萌芽型,食品安全與健康的守護者 +一般大學,88,亞洲大學,大學特色類深耕型,永續高齡失智友善包容社區:數位創新x護智處方x社會共融 +一般大學,89,東海大學,大學特色類萌芽型,一所大學守護一條河的四校聯盟行動 +一般大學,90,東海大學,大學特色類萌芽型,大肚山地方教育創生2.0 +一般大學,91,東海大學,永續發展類特色永續型,臺中市西屯區開放養生村的典範建構與擴散 +一般大學,92,國立中興大學,永續發展類國際合作型,浪愛無國界:流浪動物減量與福祉實踐 +一般大學,93,國立彰化師範大學,大學特色類萌芽型,彰化風光 風光彰化 +一般大學,94,國立彰化師範大學,大學特色類萌芽型,生態家園?城鄉永續:彰化生態藝術計畫 +一般大學,95,國立彰化師範大學,大學特色類萌芽型,美「蜊」芳苑、寶「蜆」大城:氣候變遷下彰化雙城之產業與環境永續計畫 +一般大學,96,國立彰化師範大學,大學特色類萌芽型,白沙×共好 深耕在地向前行 +一般大學,97,國立暨南國際大學,大學特色類萌芽型,暨大「相遇東南亞」的啟示:共耘RAMTAU香料共和園 +一般大學,98,國立暨南國際大學,大學特色類萌芽型,Walk Tall:戶外教育學習生態系統創新計畫 +一般大學,99,國立暨南國際大學,大學特色類萌芽型,水沙連未來教育行動聯盟 +一般大學,100,國立暨南國際大學,永續發展類國際合作型,水沙連產業永續發展計畫-產業鏈結x跨域人才x國際合作 +一般大學,101,國立暨南國際大學,永續發展類特色永續型,綠色水沙連永續價值與人才培育升級計畫:科技x循環x淨零 +一般大學,102,逢甲大學,大學特色類萌芽型,中寮行動-倡議偏鄉群落生境的社會影響力 +一般大學,103,逢甲大學,大學特色類萌芽型,臺中市文化城中城地方創生計畫:生活故事書院 +一般大學,104,逢甲大學,大學特色類萌芽型,安居樂業-打造永續韌性部落的教育示範場域 +一般大學,105,逢甲大學,永續發展類國際合作型,農村減碳-綠色諧能鏈結國際永續共好行動 +一般大學,106,靜宜大學,大學特色類萌芽型,淺山精靈的守護:生物多樣性的行動倡議與環境教育實踐 +一般大學,107,靜宜大學,大學特色類深耕型,建構具韌性的幸福銀髮生態圈 +一般大學,108,長榮大學,大學特色類萌芽型,相約檨仔腳-走向整全的社區經濟與照顧之路2.0 +一般大學,109,長榮大學,永續發展類國際合作型,綠色社區根與芽行動計畫-從在地到國際 +一般大學,110,南華大學,大學特色類萌芽型,推動碳中和農業 +一般大學,111,南華大學,永續發展類國際合作型,擴散慢城意涵-營造永續宜居城鄉生活 +一般大學,112,國立中正大學,大學特色類萌芽型,共創長者幸福人生:科際整合人權實踐方案 +一般大學,113,國立成功大學,大學特色類萌芽型,長短樹下的微風-環境療癒場域之建構 +一般大學,114,國立成功大學,大學特色類深耕型,惡地協作2.0:H.E.A.R.T.串起共學、共做、共感的淺山心生活 +一般大學,115,國立成功大學,永續發展類國際合作型,相伴2026:互為主體、互利共好、底蘊再創 +一般大學,116,國立成功大學,永續發展類特色永續型,台南400年:從倒風內海到東原山林溪北傳統特色產業的升級之路:復振與新生 +一般大學,117,國立嘉義大學,大學特色類萌芽型,加糖笑瞇瞇─懸絲偶天團與糖文化的永續計畫 +一般大學,118,國立嘉義大學,大學特色類萌芽型,跨域STEAM 雙語+E 共譜嘉鄉好樂章 +一般大學,119,國立臺南大學,大學特色類萌芽型,幸福集氣,讓愛延續 +一般大學,120,國立臺南大學,大學特色類萌芽型,為偏鄉而教—打造七股偏鄉教育補給站3.0 +一般大學,121,高雄醫學大學,大學特色類萌芽型,永續荖濃人才培育與健康發展計畫 +一般大學,122,高雄醫學大學,大學特色類萌芽型,青銀攜手健康促進_旗津區銀髮及長照產業優化加值發展計畫 +一般大學,123,高雄醫學大學,大學特色類深耕型,空污下的大學社會責任-環境教育與健康促進永續發展計畫 +一般大學,124,高雄醫學大學,永續發展類國際合作型,永續不只一夏-那瑪夏及國際原鄉永續發展計畫 +一般大學,125,國立中山大學,大學特色類萌芽型,作為NATIVE博物館的霧台-原民社會自然文化共構之永續學習計畫 +一般大學,126,國立中山大學,大學特色類深耕型,產學合創·跨域實踐:共構地方永續協作平台 +一般大學,127,國立中山大學,永續發展類國際合作型,邁向永續轉型:城市共事館的全球在地實踐 +一般大學,128,國立屏東大學,大學特色類萌芽型,屏東地方創生式:共學、共作與共生實踐計畫 +一般大學,129,國立屏東大學,大學特色類萌芽型,朱雀先驅:屏東偏鄉三師共學模式 +一般大學,130,國立屏東大學,大學特色類深耕型,讓生命不同凡「想」-身心障礙成人賦能(empowerment)支持 +一般大學,131,國立高雄大學,大學特色類萌芽型,韌性社區自主防災與永續城市培力計畫 +一般大學,132,國立高雄師範大學,大學特色類萌芽型,原民築夢創生機—瑪家鄉原民產業創新加值 +一般大學,133,國立高雄師範大學,大學特色類萌芽型,惡地社會學:高雄月世界地方創生實踐與永續社區聯動網培力計畫 +一般大學,134,國立高雄師範大學,大學特色類萌芽型,小民再造 市集再生 +一般大學,135,國立臺東大學,大學特色類萌芽型,從我到我們:大學與社區跨域共做共好社會實踐計畫 +一般大學,136,國立臺東大學,大學特色類萌芽型,都蘭之蘭調創生—友善土地的共作共好 +一般大學,137,國立臺東大學,大學特色類深耕型,臺東Y-2計畫:共創山海沙城好未來 +,,,, +大學社會責任補助計畫(USR)-技專校院,,,, +類別,序號,學校名稱,計畫類型,計畫名稱 +技專校院,1,中國科技大學,大學特色類萌芽型,共創深坑文化永續韌性社區與多元加值計畫 +技專校院,2,中國科技大學,大學特色類萌芽型,台北市黎安里社區微旅行 - 邀約鳥語、花香、人情為伴 +技專校院,3,中華科技大學,大學特色類萌芽型,環境認知調研與空間裝置實作之社會性實踐-以基隆為行動基地 +技專校院,4,中華科技大學,大學特色類萌芽型,”原“創教育–原民技藝文化推廣 +技專校院,5,台北海洋科技大學,大學特色類萌芽型,魅力士社-深耕活化生態社子島 +技專校院,6,台北海洋科技大學,大學特色類萌芽型,銀造在地健康關懷青銀樂活俱樂部-共創共學、友善高齡、健康福祉實踐推動計畫 +技專校院,7,宏國德霖科技大學,大學特色類萌芽型,青銀創生暨培力養成計畫-社創大頂埔:從零開始的夢想 +技專校院,8,亞東科技大學,大學特色類萌芽型,翻轉社區高齡復健患者及應用於醫療院所與遠距科技照護大行動 +技專校院,9,亞東科技大學,大學特色類萌芽型,新北師生資訊科技增能計畫 +技專校院,10,明志科技大學,大學特色類萌芽型,Co-op Design—走入三角湧社區文化生活實驗 +技專校院,11,明志科技大學,大學特色類萌芽型,新北產業永續發展2.0 +技專校院,12,明志科技大學,大學特色類深耕型,北臺首學帶狀文物館深耕計畫 +技專校院,13,東南科技大學,大學特色類萌芽型,淡蘭市場科技數位文旅典藏服務培力計畫 +技專校院,14,致理科技大學,大學特色類萌芽型,女王的呼召—萬金國際旅遊實驗共生協作平台 +技專校院,15,致理科技大學,大學特色類萌芽型,青銀微社群就醫陪伴社區共好計畫 +技專校院,16,耕莘健康管理專科學校,大學特色類萌芽型,「足好」-照顧者身心適能健康促進計畫 +技專校院,17,耕莘健康管理專科學校,大學特色類萌芽型,循環永續、共伴創生「第二期計畫主案:宜蘭三星鄉農棄物六級產業與農村創生計畫」 +技專校院,18,耕莘健康管理專科學校,大學特色類萌芽型,~為愛走動 莘口相連-讓愛傳出去 口腔照護服務交流計畫 +技專校院,19,馬偕醫護管理專科學校,大學特色類萌芽型,承載幸福,偏鄉傳愛 +技專校院,20,馬偕醫護管理專科學校,大學特色類萌芽型,馬偕護 創生榮:活絡在地好所在,共享樂齡新生活 +技專校院,21,國立臺北科技大學,大學特色類萌芽型,漁村真本事-萬里野柳海岸地景保育與漁村文化永續 +技專校院,22,國立臺北科技大學,大學特色類萌芽型,鶯歌陶瓷培力與科技驅動計畫 +技專校院,23,國立臺北科技大學,大學特色類萌芽型,木創文化深根攪動計畫(Ⅱ) +技專校院,24,國立臺北科技大學,永續發展類特色永續型,原住民部落安居構築與綠色樂業推動計畫 +技專校院,25,國立臺北護理健康大學,大學特色類萌芽型,後疫情時代高齡與幼兒身心健康全方位升級計畫—社區服務支持系統的社會實踐 +技專校院,26,國立臺北護理健康大學,大學特色類深耕型,鏈結資源永續健康-「北護護你健康、青銀共好深耕計畫」;第二期計畫主案:鏈結區域資源升級長照專業-「北護護你健康、青銀共好標竿計畫」 +技專校院,27,國立臺灣科技大學,大學特色類萌芽型,活力創齡-共創共學習 +技專校院,28,國立臺灣科技大學,大學特色類萌芽型,共好 Spark : 走在我的身邊,成為我的夥伴 +技專校院,29,國立臺灣科技大學,大學特色類深耕型,「城南無限-都市山城與無限大學的永續共築計畫」 +技專校院,30,國立臺灣科技大學,永續發展類國際合作型,行動工程師培育計畫 +技專校院,31,國立臺灣科技大學,永續發展類特色永續型,I-Villages: Mobility for Change 城鄉牽手移動力再建構計畫 +技專校院,32,景文科技大學,大學特色類萌芽型,永續餐飲SDGs教育及社會責任計畫 +技專校院,33,經國管理暨健康學院,大學特色類萌芽型,「幼」「健」「美」好吾鄉?從幼兒園到家庭、社區的健康促進與美力養成計劃 +技專校院,34,聖約翰科技大學,大學特色類萌芽型,北海岸跨領域共學共創共耕基地建構與創新生活文化圈整合創生深耕計畫 +技專校院,35,德明財經科技大學,大學特色類萌芽型,德明甘丹內科園區永續時尚實踐計畫 +技專校院,36,德明財經科技大學,大學特色類萌芽型,內湖金面山在地風華-永續實踐計畫 +技專校院,37,黎明技術學院,大學特色類萌芽型,共鳴-攜手臺北啟聰學校建構聽障共融環境計畫 +技專校院,38,黎明技術學院,大學特色類萌芽型,新北市新泰樹地區新住民及新二代時尚民生職能提升培育計畫 +技專校院,39,育達科技大學,大學特色類萌芽型,「肌」不可失、「活」力飲食-肌活樂齡打造苗栗幸福城市計畫 +技專校院,40,明新科技大學,大學特色類萌芽型,客話茶金三生味-韌性茶鄉創生計畫 +技專校院,41,明新科技大學,大學特色類萌芽型,新竹縣五峰鄉隘蘭軌跡人文、生態、空間、孵創基地計畫 +技專校院,42,長庚科技大學,大學特色類萌芽型,保骨防跌、樂活膳食、科技失智辨識–永續高齡友善社區計畫 +技專校院,43,長庚科技大學,大學特色類萌芽型,破繭而出的形象曙光 +技專校院,44,長庚科技大學,大學特色類萌芽型,多元新視界,攜手嘉移人 +技專校院,45,長庚科技大學,大學特色類萌芽型,在地紮根•社會共生-教養賦能計畫 +技專校院,46,健行科技大學,大學特色類萌芽型,陽光樂活、綠能永續扎根計畫 +技專校院,47,敏實科技大學,大學特色類萌芽型,青山綠水好茶庄:台三線茶產業智慧種植、環境永續與創新商業應用實踐計畫 +技專校院,48,慈濟科技大學,大學特色類萌芽型,有機淨零新農業-光復萬榮產銷班青銀共創計畫 +技專校院,49,慈濟科技大學,大學特色類萌芽型,社區協力建構偏鄉失智照顧培力及支持服務網 +技專校院,50,龍華科技大學,大學特色類萌芽型,桃園新屋石滬文化永續發展計劃 +技專校院,51,龍華科技大學,大學特色類萌芽型,自閉症特教生適應性科技與食農教育-龍潭肯納社福莊園 +技專校院,52,龍華科技大學,大學特色類萌芽型,?牽手龜山—保育、人文、科技的共榮與昇華? +技專校院,53,龍華科技大學,大學特色類萌芽型,樂生生樂—樂生公?教育園區地方特色之發展 +技專校院,54,中臺科技大學,大學特色類萌芽型,文資蘊生-永續文化資源與創新人才培育 +技專校院,55,弘光科技大學,大學特色類萌芽型,中部沿海邁向低碳、綠能與韌性生態社區共築計畫 +技專校院,56,南開科技大學,大學特色類深耕型,建置在地優質老化永續長照服務網—打造南投不老城鎮 +技專校院,57,修平科技大學,大學特色類萌芽型,再現田頭水?田中、社頭、二水區域整合計畫 +技專校院,58,修平科技大學,大學特色類萌芽型,文蛤智慧養殖與科學管理永續發展計畫 +技專校院,59,國立勤益科技大學,大學特色類萌芽型,想到鐵工就是台中—鐵工藝術再創新猷 +技專校院,60,國立勤益科技大學,大學特色類深耕型,中臺灣菇類產業創生與永續經營提升計畫 +技專校院,61,國立臺中科技大學,大學特色類萌芽型,智慧創新樂齡共融長照屋 +技專校院,62,國立臺中科技大學,大學特色類萌芽型,打造山城永續農業新亮點-休閒農業價值創新計畫 +技專校院,63,朝陽科技大學,大學特色類萌芽型,北溝復麗—文化、生態共融村 +技專校院,64,朝陽科技大學,大學特色類萌芽型,貓堳C農設計培力再生活化 +技專校院,65,朝陽科技大學,大學特色類萌芽型,果香山城-苗圃幸福心,友善人文暨城鄉共好計畫 +技專校院,66,朝陽科技大學,大學特色類深耕型,「雜糧紮根,豐味深釀」崙元廊道增韌擴散計畫 +技專校院,67,朝陽科技大學,永續發展類特色永續型,幼老共園輔導平台的建構與代間學習促進世代共融的實踐 +技專校院,68,僑光科技大學,大學特色類萌芽型,烏溪流「育」,創意長銷 +技專校院,69,嶺東科技大學,大學特色類萌芽型,產業再興—跨域社會設計翻轉新社農創品牌價值 +技專校院,70,嶺東科技大學,大學特色類萌芽型,智機減碳,從嶺做起:碳盤輔導人才培育 +技專校院,71,中華醫事科技大學,永續發展類特色永續型,臺南溪北淺山銀髮健康基地深耕永續計畫 +技專校院,72,台南應用科技大學,大學特色類萌芽型,消失的針線-刺繡技藝傳承與記憶延伸 +技專校院,73,台南應用科技大學,大學特色類深耕型,志在琉鄉-全島啟動˙價值再造 +技專校院,74,南臺科技大學,大學特色類萌芽型,藏碳蘊漁:古都土城仔綠電創能與智動養殖之跨界整合永續淨零發展計畫 +技專校院,75,南臺科技大學,大學特色類萌芽型,跨樂尬陣:南流西起共融藝起來 +技專校院,76,南臺科技大學,大學特色類萌芽型,點亮左鎮相放伴—創意生活加值計畫 +技專校院,77,南臺科技大學,大學特色類深耕型,文化底?的在地創生與傳播--府城vs月津 +技專校院,78,南臺科技大學,永續發展類特色永續型,青銀共創打造在地智慧自在不老力 +技專校院,79,國立虎尾科技大學,大學特色類萌芽型,「花」現虎尾,永續共融 +技專校院,80,國立虎尾科技大學,永續發展類特色永續型,農業共學地方創生世代共好—取徑綠心到綠港之價值共創 +技專校院,81,國立雲林科技大學,大學特色類萌芽型,從心靈遍路到智能觀光:雲林朝聖廊帶的地方設計 +技專校院,82,崑山科技大學,大學特色類萌芽型,以農漁業廢棄資材循環再利用為基石、建構淨零碳排永續家園 +技專校院,83,崑山科技大學,永續發展類國際合作型,永保安康Going Green-從在地邁向國際綠色關懷 +技專校院,84,嘉南藥理大學,大學特色類萌芽型,二仁溪流域 後現代城鎮漣漪翻轉策略: 逆勢啟動南方聚落軸線復興力量 「第二期計畫主案:裡仁唯美:台南府城南方村落綴思關懷 計畫、副案:二仁溪流域環境生態在地關懷」 +技專校院,85,嘉南藥理大學,大學特色類萌芽型,青銀共生~活酪大內樂居地 +技專校院,86,嘉南藥理大學,大學特色類萌芽型,西港風_敘事雲 +技專校院,87,嘉南藥理大學,大學特色類萌芽型,永續安南環境生態與綠色產業 +技專校院,88,嘉南藥理大學,大學特色類深耕型,嘉藥攜手阿蓮: 賦能偏鄉社區x築夢幸福家園 「第二期計畫主案:營造Alia(e)n宜居地 計畫、副案:濃濃香洋風,再造關廟情 計畫」 +技專校院,89,大仁科技大學,大學特色類萌芽型,三生三化三十?高樹-智慧低碳農業心vs.科技?幼關懷情 +技專校院,90,大仁科技大學,大學特色類萌芽型,小琉球幸福島 環境 x 健康 x 文化 +技專校院,91,大仁科技大學,大學特色類萌芽型,長照知?整合與實踐-20X80牽手微伴計畫 +技專校院,92,文藻外語大學,大學特色類萌芽型,「SDGs」看見需要·千手扶學 「第二期計畫主案:USR-hub 看見需要·千手扶學計畫」 +技專校院,93,文藻外語大學,大學特色類萌芽型,OUR TOWN 社區永續跨域共創平台計畫「第二期:USR-hub Our Town 社區體驗遊程國際平台及觀光文化導覽USR HUB 二案」 +技專校院,94,文藻外語大學,大學特色類萌芽型,藻到新力亮∼文藻USR新住民/新移工關懷培力計畫「第二期計畫主案:藻到新力亮∼文藻USR新住民/新移工關懷培力計畫」 +技專校院,95,正修科技大學,大學特色類萌芽型,齊聚新民·旗育津采 +技專校院,96,正修科技大學,大學特色類萌芽型,蕉傲?大旗山典範創新合作生產實踐計畫 +技專校院,97,正修科技大學,大學特色類萌芽型,新埤纖境- 創造新埤鄉的再生力量 +技專校院,98,正修科技大學,大學特色類萌芽型,食在安心 銀造健康 永續欣林園 +技專校院,99,美和科技大學,大學特色類萌芽型,漁網石斑 靚食啖鮮-屏東石斑魚產業鏈加值計畫 +技專校院,100,國立屏東科技大學,大學特色類萌芽型,沿山185熱帶有機廊道-農業數位轉型及生態系建構之USR實踐計畫 +技專校院,101,國立屏東科技大學,大學特色類萌芽型,點亮馬卡道健康農產業振興與優化 +技專校院,102,國立屏東科技大學,大學特色類萌芽型,國境南灣飛夢園 +技專校院,103,國立屏東科技大學,大學特色類萌芽型,老幼共榮、幸福陪伴-營造屏東老幼永續幸福家園 +技專校院,104,國立屏東科技大學,大學特色類深耕型,里山根經濟-林下經濟、生態旅遊的軸帶深耕與農林地碳匯人才培育 +技專校院,105,國立高雄科技大學,大學特色類萌芽型,竹夢樂學+遊活園田 +技專校院,106,國立高雄科技大學,大學特色類深耕型,無碳理想 淨零橋楠 +技專校院,107,國立高雄科技大學,大學特色類深耕型,海岸創生 社會創新-高雄漁村實踐計畫 +技專校院,108,國立高雄科技大學,永續發展類國際合作型,鄰家好漁形塑計畫 +技專校院,109,國立高雄科技大學,永續發展類特色永續型,U can do it! 高雄山都心永續藍圖 (第二期計畫主案:安居桃花源.港都山線韌性城鄉營建計畫) +技專校院,110,國立澎湖科技大學,大學特色類萌芽型,與海為生-澎湖混獲資源化與海洋食魚教育 +技專校院,111,輔英科技大學,大學特色類萌芽型,琉連忘返 愛待琉鄉-東琉連線在地安養精準健康促進人力養成計劃 +技專校院,112,輔英科技大學,大學特色類萌芽型,南高雄產業園區永續健康環境營造與環境教育拓展計畫 +技專校院,113,樹德科技大學,大學特色類萌芽型,青銀共創 活躍老化-社區照顧人才的培育與實作 +技專校院,114,樹德科技大學,永續發展類特色永續型,橫山USR 333-1 綠色永續 x 整體實踐 +,,,, +深耕計畫第二部分 全球鏈結核定學校,,,, +一、Global Taiwan 全校型學校,,,, +學校代碼,學校名稱,,, +2,國立清華大學,,, +3,國立臺灣大學,,, +5,國立成功大學,,, +7,國立陽明交通大學,,, +二、Global Taiwan 研究中心,,,, +學校類別,學校名稱,領域,計畫名稱, +一般大學,中國醫藥大學,醫學,新藥開發研究中心, +一般大學,中國醫藥大學,醫學,中醫藥研究中心, +一般大學,中國醫藥大學,生命科學,癌症生物精準醫學研究中心, +一般大學,長庚大學,生命科學,新興病毒感染研究中心, +一般大學,高雄醫學大學,生命科學,精準環境醫學研究中心, +一般大學,國立中山大學,工學一般,6G 通訊與感測研究中心, +一般大學,國立中山大學,醫學,代謝異常脂肪肝卓越研究中心, +一般大學,國立中山大學,理學,氣膠科學研究中心, +一般大學,國立中山大學,理學,晶體研究中心, +一般大學,國立中山大學,社會科學,策略與人力資本研究中心, +一般大學,國立中山大學,社會科學,永續智慧電子商務研究中心, +一般大學,國立中央大學,理學,太空科學與科技研究中心, +一般大學,國立中央大學,理學,地震災害鏈風險評估及管理研究中心, +一般大學,國立中央大學,理學,高能與強場物理研究中心, +一般大學,國立中正大學,工學一般,前瞻製造系統頂尖研究中心, +一般大學,國立中興大學,農學,永續農業創新發展中心, +一般大學,國立中興大學,農學,前瞻植物與食?尖端生技研究中心, +一般大學,國立中興大學,農學,鳥禽遺傳資源暨動物生技研究中心, +一般大學,國立中興大學,理學,前瞻永續負碳資源創意研究中心, +一般大學,國立成功大學,工學一般,跨維綠能材料研究中心, +一般大學,國立成功大學,工學一般,前瞻醫療器材科技中心, +一般大學,國立成功大學,醫學,奈米醫學研究中心, +一般大學,國立成功大學,農學,前瞻蝦類養殖國際研發中心, +一般大學,國立成功大學,農學,蘭花研發中心, +一般大學,國立成功大學,理學,前沿量子科技研究中心, +一般大學,國立政治大學,社會科學,企業永續管理研究中心, +一般大學,國立政治大學,人文藝術,華人文化元宇宙研究中心, +一般大學,國立清華大學,工學一般,高熵材?研發中心, +一般大學,國立清華大學,工學一般,智慧感知?網研究中心, +一般大學,國立清華大學,醫學,腦科學研究中心, +一般大學,國立清華大學,理學,前瞻?子科技研究中心, +一般大學,國立清華大學,社會科學,韌性研究中心, +一般大學,國立清華大學,人文藝術,水下考古暨水下文化資產研究中心, +一般大學,國立清華大學,人文藝術,臺灣語言多樣性永續發展中心, +一般大學,國立陽明交通大學,工學一般,前瞻半導體技術研究中心, +一般大學,國立陽明交通大學,醫學,腫瘤與免疫學研究中心, +一般大學,國立陽明交通大學,醫學,全方位健康長壽跨領域研究中心, +一般大學,國立陽明交通大學,醫學,腦科學研究中心, +一般大學,國立陽明交通大學,生命科學,智慧型藥物與智能生物裝置研究中心, +一般大學,國立陽明交通大學,理學,新世代功能性物質研究中心, +一般大學,國立陽明交通大學,人文藝術,文化研究國際中心, +一般大學,國立臺灣大學,工學一般,前瞻?色材?高值化研究中心, +一般大學,國立臺灣大學,工學一般,尖端生醫計算及影像研究中心, +一般大學,國立臺灣大學,工學一般,數據智慧與系統研究中心, +一般大學,國立臺灣大學,生命科學,精準醫學研究中心, +一般大學,國立臺灣大學,農學,農業零碳技術與管理創新研究中心, +一般大學,國立臺灣大學,理學,新穎材料原子級科學研究中心, +一般大學,國立臺灣大學,理學,永續地球尖端科學研究中心, +一般大學,國立臺灣大學,社會科學,計量理論與應用研究中心, +一般大學,國立臺灣大學,社會科學,群體健康與福祉研究中心, +一般大學,國立臺灣大學,社會科學,臺灣韌性社會研究中心, +一般大學,國立臺灣師範大學,社會科學,學習科學跨國頂尖研究中心, +一般大學,國立臺灣師範大學,人文藝術,華語文與科技研究中心, +一般大學,國立臺灣師範大學,人文藝術,國際台灣學研究中心, +一般大學,國立臺灣師範大學,人文藝術,社會情緒教育與發展研究中心, +一般大學,國立臺灣海洋大學,理學,海洋中心:全球變遷下海洋與水產的調適與因應, +一般大學,臺北醫學大學,醫學,癌症轉譯研究中心, +一般大學,臺北醫學大學,醫學,腦意識創新轉譯研究中心, +技專校院,正修科技大學,生命科學,環境毒物與新興汙染物研究中心, +技專校院,正修科技大學,人文藝術,文物修護研究中心, +技專校院,南臺科技大學,工學技專,高階智慧生醫聯合研究中心, +技專校院,國立虎尾科技大學,工學技專,智能機械與智慧製造研究中心, +技專校院,國立屏東科技大學,農學,動物製劑研究中心, +技專校院,國立屏東科技大學,農學,永續智慧養豬技術研究中心, +技專校院,國立高雄科技大學,工學技專,"前瞻金屬成形技術研究發展中心 +", +技專校院,國立雲林科技大學,工學技專,智慧辨識產業服務研究中心, +技專校院,國立雲林科技大學,人文藝術,智能地域設計服務研究中心, +技專校院,國立臺北科技大學,工學技專,新世代住商與工業節能研究中心, +技專校院,國立臺北科技大學,工學技專,高值生醫材料研究與商品化中心, +技專校院,國立臺灣科技大學,工學技專,永續電化學能源發展中心, +技專校院,國立臺灣科技大學,工學技專,智慧製造創新中心, +技專校院,國立臺灣科技大學,工學技專,臺灣建築科技中心, +技專校院,國立臺灣科技大學,工學技專,異質整合矽光電晶片研發中心, +技專校院,國立臺灣科技大學,工學技專,"臺灣高速3D?印研究中心 +", +技專校院,國立臺灣科技大學,社會科學,技職賦能研究中心, +技專校院,崑山科技大學,工學技專,綠能科技研究中心, diff --git a/The attainments and realizations of my dreams/Yearly increase of government's payroll/Local government/2024 Cities.py b/The attainments and realizations of my dreams/Yearly increase of government's payroll/Local government/2024 Cities.py new file mode 100644 index 00000000..0b0f0a06 --- /dev/null +++ b/The attainments and realizations of my dreams/Yearly increase of government's payroll/Local government/2024 Cities.py @@ -0,0 +1,87 @@ +from collections import namedtuple + +import matplotlib.pyplot as plt +import numpy as np + +Student = namedtuple('Student', ['name', 'grade', 'gender']) +Score = namedtuple('Score', ['value', 'unit', 'percentile']) + + +def to_ordinal(num): + """Convert an integer to an ordinal string, e.g. 2 -> '2nd'.""" + suffixes = {str(i): v + for i, v in enumerate(['th', 'st', 'nd', 'rd', 'th', + 'th', 'th', 'th', 'th', 'th'])} + v = str(num) + # special case early teens + if v in {'11', '12', '13'}: + return v + 'th' + return v + suffixes[v[-1]] + + +def format_score(score): + """ + Create score labels for the right y-axis as the test name followed by the + measurement unit (if any), split over two lines. + """ + return f'{score.value}\n{score.unit}' if score.unit else str(score.value) + + +def plot_student_results(student, scores_by_test, cohort_size): + fig, ax1 = plt.subplots(figsize=(9, 7), layout='constrained') + fig.canvas.manager.set_window_title('Eldorado K-8 Fitness Chart') + + ax1.set_title(student.name) + ax1.set_xlabel( + 'Percentile Ranking Across {grade} Grade {gender}s\n' + 'Cohort Size: {cohort_size}'.format( + grade=to_ordinal(student.grade), + gender=student.gender.title(), + cohort_size=cohort_size)) + + test_names = list(scores_by_test.keys()) + percentiles = [score.percentile for score in scores_by_test.values()] + + rects = ax1.barh(test_names, percentiles, align='center', height=0.5) + # Partition the percentile values to be able to draw large numbers in + # white within the bar, and small numbers in black outside the bar. + large_percentiles = [to_ordinal(p) if p > 40 else '' for p in percentiles] + small_percentiles = [to_ordinal(p) if p <= 40 else '' for p in percentiles] + ax1.bar_label(rects, small_percentiles, + padding=5, color='black', fontweight='bold') + ax1.bar_label(rects, large_percentiles, + padding=-32, color='white', fontweight='bold') + + ax1.set_xlim([0, 100]) + ax1.set_xticks([0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]) + ax1.xaxis.grid(True, linestyle='--', which='major', + color='grey', alpha=.25) + ax1.axvline(50, color='grey', alpha=0.25) # median position + + # Set the right-hand Y-axis ticks and labels + ax2 = ax1.twinx() + # Set equal limits on both yaxis so that the ticks line up + ax2.set_ylim(ax1.get_ylim()) + # Set the tick locations and labels + ax2.set_yticks( + np.arange(len(scores_by_test)), + labels=[format_score(score) for score in scores_by_test.values()]) + + ax2.set_ylabel('Test Scores') + + +student = Student(name='The number of new permanent staffs each local government plans to hire for 2025', grade=2, gender='Boy') + +scores_by_test = { + 'Pacer Test': Score(7, 'laps', percentile=37), + 'Flexed Arm\n Hang': Score(48, 'sec', percentile=95), + 'Mile Run': Score('12:52', 'min:sec', percentile=73), + 'Agility': Score(17, 'sec', percentile=60), + 'Push Ups': Score(14, '', percentile=16), +} + +plot_student_results(student, scores_by_test, cohort_size=62) +plt.show() + +# References: +# 1. https://matplotlib.org/stable/gallery/statistics/barchart_demo.html#sphx-glr-gallery-statistics-barchart-demo-py \ No newline at end of file diff --git a/The attainments and realizations of my dreams/Yearly increase of government's payroll/Local government/__init__.py b/The attainments and realizations of my dreams/Yearly increase of government's payroll/Local government/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Yearly increase of government's payroll/National government/__init__.py b/The attainments and realizations of my dreams/Yearly increase of government's payroll/National government/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/Yearly increase of government's payroll/__init__.py b/The attainments and realizations of my dreams/Yearly increase of government's payroll/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/The attainments and realizations of my dreams/data_gov.py b/The attainments and realizations of my dreams/data_gov.py new file mode 100644 index 00000000..e472e033 --- /dev/null +++ b/The attainments and realizations of my dreams/data_gov.py @@ -0,0 +1 @@ +# https://data.gov.tw/ \ No newline at end of file