{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"authorship_tag":"ABX9TyM3N6YHhBILi8HPaV3jYDeV"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"markdown","source":["# Plotting Categorical Data\n","\n","For our purposes, categorical data is defined as qualitative, nominal, or ordinal data that is discrete, or non-continuous. Categorical data contrasts with numerical data that is continuous. The axis type determines how the data is plotted in the resulting figure.\n","\n","Axis types recognized in `plotly`:\n","- `linear`\n","- `log`\n","- `date`\n","- `category`\n","- `multicategory`\n","\n","The axis type is auto-detected by `plotly` based on the data linked to the specific axis.\n","- If `plotly` does not recognize the data as `multicategory`, `date`, or `category` (it checks sequentially in that order), it defaults to `linear`.\n","- When testing for `multicategory` data, `plotly` looks to see if there is a nested array.\n","- When testing for `date` or `category`, `plotly` requires more than twice as many distinct date or category strings as distinct numbers in order to choose one of these axis types.\n","\n","We can imagine scenarios in which we are working with categorical data that would not be accurately auto-detected by `plotly`. We can instruct `plotly` to recognize an axis as having categorical data through the `xaxis_type` and `yaxis_type` attributes."],"metadata":{"id":"6WsGiPhHgR-w"}},{"cell_type":"markdown","source":["## Example #1\n","\n","An example of categorical data represented as a bar chart."],"metadata":{"id":"9vA7jmE_gX1r"}},{"cell_type":"code","execution_count":2,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":542},"id":"4CvfdT6XgPLV","executionInfo":{"status":"ok","timestamp":1706150731899,"user_tz":300,"elapsed":211,"user":{"displayName":"Katherine Walden","userId":"17094108395123900917"}},"outputId":"07340568-c110-4ad9-de30-1a7aed2435d5"},"outputs":[{"output_type":"display_data","data":{"text/html":["\n","
\n","\n","