{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\n\nvegetables = [\"Econolodge\", \"Days Inn\", \"Hyatt\", \"Marriott\",\n              \"Wyndham\", \"Hilton\", \"Sheraton\"]\nfarmers = [\"Brian Folks\", \"Satish Kartan\", \"Sharmistha Barai\",\n           \"Louis Broadway\", \"Raven Standifer\", \"Robert Poole\", \"Kendrick Davis\"]\n\nharvest = np.array([[0.8, 2.4, 2.5, 3.9, 0.0, 4.0, 0.0],\n                    [2.4, 0.0, 4.0, 1.0, 2.7, 0.0, 0.0],\n                    [1.1, 2.4, 0.8, 4.3, 1.9, 4.4, 0.0],\n                    [0.6, 0.0, 0.3, 0.0, 3.1, 0.0, 0.0],\n                    [0.7, 1.7, 0.6, 2.6, 2.2, 6.2, 0.0],\n                    [1.3, 1.2, 0.0, 0.0, 0.0, 3.2, 5.1],\n                    [0.1, 2.0, 0.0, 1.4, 0.0, 1.9, 6.3]])\n\n\nfig, ax = plt.subplots()\nim = ax.imshow(harvest)\n\n# We want to show all ticks...\nax.set_xticks(np.arange(len(farmers)))\nax.set_yticks(np.arange(len(vegetables)))\n# ... and label them with the respective list entries\nax.set_xticklabels(farmers)\nax.set_yticklabels(vegetables)\n\n# Rotate the tick labels and set their alignment.\nplt.setp(ax.get_xticklabels(), rotation=45, ha=\"right\",\n         rotation_mode=\"anchor\")\n\n# Loop over data dimensions and create text annotations.\nfor i in range(len(vegetables)):\n    for j in range(len(farmers)):\n        text = ax.text(j, i, harvest[i, j],\n                       ha=\"center\", va=\"center\", color=\"w\")\n\nax.set_title(\"Times An Individual Visits A Hotel Per Year\")\nfig.tight_layout()\nplt.show()","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2021-05-21T05:48:06.505388Z","iopub.execute_input":"2021-05-21T05:48:06.505868Z","iopub.status.idle":"2021-05-21T05:48:06.879560Z","shell.execute_reply.started":"2021-05-21T05:48:06.505827Z","shell.execute_reply":"2021-05-21T05:48:06.878320Z"},"trusted":true},"execution_count":null,"outputs":[]}]}