{ "cells": [ { "cell_type": "markdown", "id": "2a51cb88-6706-4266-a2c0-794dad6ef810", "metadata": {}, "source": [ "# Customizing `geom_pie()`\n", "Two new parameters have been added to the `geom_pie()` function:\n", "\n", "- `direction`: Controls the sector layout, allowing it to be drawn either clockwise or counterclockwise.\n", "- `start`: Specifies the starting angle of the pie chart in degrees." ] }, { "cell_type": "code", "execution_count": 1, "id": "83168fbc-3b0d-4899-998b-5339d4edc47f", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from lets_plot import *\n", "LetsPlot.setup_html()\n", "\n", "data = {\n", " 'name': ['a', 'b', 'c', 'd', 'b'], \n", " 'value': [ 40, 90, 10 , 50, 20]}\n", "p = ggplot(data, aes(fill='name', weight='value')) " ] }, { "cell_type": "markdown", "id": "a7e003fa-b531-498a-abdc-f80aaf1d85ca", "metadata": {}, "source": [ "By default, the first sector is positioned counterclockwise from the start point (12 o’clock), while the remaining sectors are arranged clockwise." ] }, { "cell_type": "code", "execution_count": 2, "id": "d97a17aa-aaa6-4c00-b52e-3d728f12d7b3", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ], "text/plain": [ "