{"id":24560167,"url":"https://github.com/dxe4/python-ggplot","last_synced_at":"2026-03-06T08:02:18.882Z","repository":{"id":272057057,"uuid":"915397546","full_name":"dxe4/python-ggplot","owner":"dxe4","description":"The plotting library for perfectionists with deadlines","archived":false,"fork":false,"pushed_at":"2025-06-21T19:18:56.000Z","size":36778,"stargazers_count":5,"open_issues_count":41,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-11T11:52:37.560Z","etag":null,"topics":["graphics","plot","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dxe4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"Roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-11T18:34:53.000Z","updated_at":"2025-06-10T10:46:30.000Z","dependencies_parsed_at":"2025-01-11T19:38:13.943Z","dependency_job_id":"b4b2bd62-40d9-45ac-ad68-f643e99619d3","html_url":"https://github.com/dxe4/python-ggplot","commit_stats":null,"previous_names":["dxe4/python-ggplot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dxe4/python-ggplot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxe4%2Fpython-ggplot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxe4%2Fpython-ggplot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxe4%2Fpython-ggplot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxe4%2Fpython-ggplot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dxe4","download_url":"https://codeload.github.com/dxe4/python-ggplot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxe4%2Fpython-ggplot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30166863,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T07:56:45.623Z","status":"ssl_error","status_checked_at":"2026-03-06T07:55:55.621Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphics","plot","python"],"created_at":"2025-01-23T07:15:58.614Z","updated_at":"2026-03-06T08:02:18.826Z","avatar_url":"https://github.com/dxe4.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"plots are still in progress, but some examples:\n\n```python\nmpg = pd.read_csv(data_path / \"mpg.csv\")\nplot1 = ggplot(mpg, aes(\"class\", fill=\"drv\")) + geom_bar()\n\ndf = mpg.groupby([\"class\", \"cyl\"], as_index=False).agg(meanHwy=(\"hwy\", \"mean\"))\nplot2 = (\n    ggplot(df, aes(\"class\", \"cyl\", fill=\"meanHwy\"))\n    + geom_tile()\n    + geom_text(aes(text=\"meanHwy\"))\n    + scale_y_discrete()\n)\n\nplot3 = (\n    ggplot(mpg, aes(x=\"cty\", fill=\"class\"))\n    + geom_freqpoly(alpha=0.3)\n    + scale_x_continuous()\n)\n\nplot4 = ggplot(\n    mpg, aes(x=\"cty\", fill=\"class\")\n) + geom_histogram() + scale_x_continuous()\n\nmpg = mpg.copy(deep=True)\nmpg[\"cty\"] = mpg[\"cty\"].astype(float)\nplot5 = ggplot(mpg, aes(x=\"cty\", y=\"displ\", size=\"cyl\", color=\"cty\")) + geom_point()\n\nggmulti(\n    [plot1, plot2, plot3, plot4, plot5],\n    plots_path / \"gg_multi_pmg.png\",\n)\n```\n\u003cimg src=\"plots/gg_multi_pmg.png?v=1\" alt=\"gg_multi_pmg\" width=\"800px\"\u003e\n\n\n\n```python\n    weather = pd.read_csv(data_path / \"lincoln-weather.csv\")\n\n    month_order = [\n        \"January\",\n        \"February\",\n        \"March\",\n        \"April\",\n        \"May\",\n        \"June\",\n        \"July\",\n        \"August\",\n        \"September\",\n        \"October\",\n        \"November\",\n        \"December\",\n    ]\n    weather['Month'] = pd.Categorical(weather['Month'], categories=month_order, ordered=True)\n\n    plot = (\n        ggplot(\n            weather,\n            aes(x=\"Mean Temperature [F]\", fill=\"Month\"),\n        )\n        + ggridges(\"Month\", overlap=1.7)\n        + geom_area(stat=\"bin\", alpha=0.7)\n        + ylab(rotate=-30)\n    )\n\n    res = ggcreate(plot)\n    ggdraw_plot(res, plots_path / \"ridgets_weather.png\")\n```\n\u003cimg src=\"plots/ridgets_weather.png?v=1\" alt=\"ridgets_weather\" width=\"400px\"\u003e\n\n\n```python\n    rng = np.random.default_rng(42)\n\n    x_vals = np.repeat(np.arange(28), 28)\n    y_vals = np.tile(np.arange(28), 28)\n    z_vals = rng.random(28 * 28)\n\n    df = pd.DataFrame({\n        'xs': x_vals.astype(float),\n        'ys': y_vals.astype(float),\n        'zs': z_vals\n    })\n    plot = ggplot(df, aes(\"xs\", \"ys\", fill=\"zs\")) + geom_tile()\n    res = ggcreate(plot)\n    ggdraw_plot(res, plots_path / \"geom_tile.png\")\n```\n\u003cimg src=\"plots/geom_tile.png?v=1\" alt=\"geom_tile\" width=\"400px\"\u003e\n\n\n```python\nmpg = pd.read_csv(data_path / \"mpg.csv\")\n\ndf = mpg.groupby([\"class\", \"cyl\"], as_index=False).agg(meanHwy=(\"hwy\", \"mean\"))\n\nplot = (\n    ggplot(df, aes(\"class\", \"cyl\", fill=\"meanHwy\"))\n    + geom_tile()\n    + geom_text(aes(text=\"meanHwy\"))\n    + scale_y_discrete()\n)\nres = ggcreate(plot)\nggdraw_plot(res, plots_path / \"geom_tile_mpg.png\")\n```\n\u003cimg src=\"plots/geom_tile_mpg.png?v=1\" alt=\"geom_tile\" width=\"400px\"\u003e\n\n\n```python\n    mpg = pd.read_csv(data_path / \"mpg.csv\")\n    plot = (\n        ggplot(mpg, aes(x=\"cty\", color=\"class\")) + geom_freqpoly() + scale_x_continuous()\n    )\n    res = ggcreate(plot)\n    ggdraw_plot(res, plots_path / \"geom_freqpoly.png\")\n```\n\u003cimg src=\"plots/geom_freqpoly_cty_class.png?v=1\" alt=\"gg_point\" width=\"400px\"\u003e\n\n```python\ndiamonds = pd.read_csv(data_path / \"diamonds.csv\")\nplot = ggplot(\n    diamonds, aes(\"price\", color=\"cut\")\n) + geom_freqpoly(\n) + ylab(\n    label=\"custom label\",\n    rotate=-45\n) + xlab(\n    rotate=45,\n    tick_margin=2.5\n)\nres = ggcreate(plot)\nggdraw_plot(res, plots_path / \"geom_freqpoly.png\")\n```\n\u003cimg src=\"plots/geom_freqpoly.png?v=1\" alt=\"gg_point\" width=\"400px\"\u003e\n\n```python\nmpg = pd.read_csv(data_path / \"mpg.csv\")\nplot = (\n    ggplot(mpg, aes(x=\"cty\", fill=\"class\"))\n    + geom_freqpoly(alpha=0.3)\n    + scale_x_continuous()\n)\nres = ggcreate(plot)\nggdraw_plot(res, plots_path / \"test_geom_freqpoly_cty_class_fill.png\")\n```\n\u003cimg src=\"plots/freqpoly_cty_class_fill.png?v=1\" alt=\"gg_point\" width=\"400px\"\u003e\n\n\n```python\nmpg = pd.read_csv(data_path / \"mpg.csv\")\nplot = ggplot(mpg, aes(x = 'displ')) + geom_histogram()\nres = ggcreate(plot)\nggdraw_plot(res, data_path / \"geom_histogram.png\")\n```\n\u003cimg src=\"plots/geom_histogram.png?v=1\" alt=\"geom_histogram\" width=\"400px\"\u003e\n\n```python\nmpg = pd.read_csv(data_path / \"mpg.csv\")\nplot = ggplot(mpg, aes(x=\"cty\", fill=\"class\")) + geom_histogram() + scale_x_continuous()\nres = ggcreate(plot)\nggdraw_plot(res, plots_path / \"geom_histogram_fill.png\")\n```\n\u003cimg src=\"plots/geom_histogram_fill.png?v=1\" alt=\"geom_histogram\" width=\"400px\"\u003e\n\n\n```python\n    np.random.seed(1234)\n\n    sex = np.repeat([\"F\", \"M\"], repeats=200)\n    weight = np.round(\n        np.concatenate(\n            [\n                np.random.normal(loc=55, scale=5, size=200),\n                np.random.normal(loc=65, scale=5, size=200),\n            ]\n        )\n    )\n\n    df = pd.DataFrame({\"sex\": pd.Categorical(sex), \"weight\": weight})\n\n    vline_gender_quantiles = (\n        df.groupby(\"sex\")[\"weight\"].quantile([0.05, 0.95]).reset_index()\n    )\n    global_quantiles: List[float] = list(df[\"weight\"].quantile([0.05, 0.95]))\n\n    plot = (\n        ggplot(df, aes(x=\"weight\", fill=\"sex\"))\n        + geom_area(stat=\"bin\", alpha=1)\n        + geom_vline(\n            data=vline_gender_quantiles,\n            aes=aes(xintercept=\"weight\"),\n            size=2,\n            line_type=\"dashed\",\n            inhert_aes=True,\n            alpha=0.7,\n        )\n        + geom_vline(\n            xintercept=global_quantiles, size=2.5, line_type=\"solid\", color=\"blue\"\n        )\n        + geom_hline(yintercept=10, size=1, alpha=0.7)\n    )\n    res = ggcreate(plot)\n    ggdraw_plot(res, plots_path / \"geom_area_stat_bin.png\")\n```\n\u003cimg src=\"plots/geom_area_stat_bin.png?v=1\" alt=\"geom_area_stat_bin\" width=\"400px\"\u003e\n\n\n```python\nmpg = pd.read_csv(data_path / \"mpg.csv\")\nmpg[\"cty\"] = mpg[\"cty\"].astype(float)\nplot = ggplot(mpg, aes(x=\"displ\", y=\"hwy\", color=\"cty\")) + geom_point()\nres = ggcreate(plot)\nggdraw_plot(res, plots_path / \"geom_point_with_continuous_color.png\")\n```\n\u003cimg src=\"plots/geom_point_with_continuous_color.png?v=1\" alt=\"geom_point_with_continuous_color\" width=\"400px\"\u003e\n\n\n```python\nmpg = pd.read_csv(data_path / \"mpg.csv\")\n\nmpg[\"cty\"] = mpg[\"cty\"].astype(float)\nmpg[\"mpgMean\"] = (mpg[\"cty\"] + mpg[\"hwy\"]) / 2.0\ndf_max = mpg.sort_values(\"mpgMean\").tail(1)\n\nplot = (\n    ggplot(mpg, aes(\"hwy\", \"displ\"))\n    + geom_point(aes(color=\"cty\"))\n    + geom_text(data=df_max, aes=aes(y=gg_col(\"displ\") + 0.2, text=\"model\"))\n    + geom_text(data=df_max, aes=aes(y=gg_col(\"displ\") - 0.2, text=\"mpgMean\"))\n)\nres = ggcreate(plot)\nggdraw_plot(res, plots_path / \"geom_point_and_text.png\")\n```\n\u003cimg src=\"plots/geom_point_and_text.png?v=1\" alt=\"geom_point_and_text\" width=\"400px\"\u003e\n\n\n```python\n    mt_cars = pd.read_csv(data_path / \"mtcars_r.csv\")\n\n    plot = (\n        ggplot(mt_cars, aes(x=\"wt\", y=\"mpg\"))\n        + geom_point()\n        + geom_abline(intercept=37, slope=-5, size=3.2)\n        + geom_vline(xintercept=3, color=\"blue\")\n        + geom_hline(yintercept=22, line_type=\"dashed\")\n        + annotate_text(\"Annotated text\", x=4, y=30, size=15, background_color=\"transparent\")\n        + annotate_text(\"🥸\", x=3, y=22, size=40, emoji=True)\n    )\n    res = ggcreate(plot)\n    ggdraw_plot(res, plots_path / \"geom_abline_vline_hline.png\")\n```\n\u003cimg src=\"plots/geom_abline_vline_hline.png?v=1\" alt=\"geom_abline_vline_hline\" width=\"400px\"\u003e\n\n\n```python\n    mpg = pd.read_csv(data_path / \"mpg.csv\")\n    mpg[\"hwy\"] = mpg[\"hwy\"].astype(float)\n    plot = (\n        ggplot(mpg, aes(\"displ\", \"hwy\"))\n        + geom_point(\n            data=mpg.loc[mpg[\"manufacturer\"] == \"subaru\"], color=\"orange\", size=3\n        )\n        + geom_point(size=1.5)\n        + annotate_curve(x=5, y=38, xend=3, yend=30, curvature=-0.3, arrow=True)\n        + annotate_text(text=\"subaru\", x=5, y=37, background_color=\"transparent\")\n        + annotate_point(x=4.95, y=36.3, color=\"orange\", size=3)\n        + annotate_point(x=4.95, y=36.3, color=\"black\", size=1.5)\n    )\n    res = ggcreate(plot)\n    ggdraw_plot(res, plots_path / \"annotate_curve.png\")\n```\n\u003cimg src=\"plots/annotate_curve.png?v=1\" alt=\"annotate_curve\" width=\"400px\"\u003e\n\n\n```python\nmpg = pd.read_csv(data_path / \"mpg.csv\")\nmpg[\"cty\"] = mpg[\"cty\"].astype(float)\nplot = ggplot(mpg, aes(x=\"cty\", y=\"displ\", size = \"cyl\", color=\"cty\")) + geom_point()\nres = ggcreate(plot)\nggdraw_plot(res, plots_path / \"geom_point_with_continuous_color_and_size.png\")\n```\n\u003cimg src=\"plots/geom_point_with_continuous_color_and_size.png?v=1\" alt=\"geom_point_with_continuous_color_and_size\" width=\"400px\"\u003e\n\n\n```python\n    df = create_dataframe()\n    plot = ggplot(\n        df, aes(\"tenors\", \"pathValues\", color = \"pathNames\")\n    ) + geom_line() + xlab(rotate=-90, tick_margin=3)\n    res = ggcreate(plot)\n    ggdraw_plot(res, plots_path / \"geom_line_With_color.png\")\n```\n\u003cimg src=\"plots/geom_line_With_color.png?v=1\" alt=\"geom_line_With_color\" width=\"400px\"\u003e\n\n\n```python\ndf = pd.DataFrame(\n    data={\n        \"trt\": pd.Categorical([1, 1, 2, 2]),\n        \"resp\": [1, 5, 3, 4],\n        \"group\": pd.Categorical([1, 2, 1, 2]),\n        \"upper\": [1.1, 5.3, 3.3, 4.2],\n        \"lower\": [0.8, 4.6, 2.4, 3.6],\n    }\n)\nplot = ggplot(df, aes(x=\"trt\", y=\"resp\", color=\"group\")) + geom_linerange(\n    aes(ymin=\"lower\", ymax=\"upper\")\n)\nres = ggcreate(plot)\nggdraw_plot(res, plots_path / \"geom_linerange.png\")\n```\n\u003cimg src=\"plots/geom_linerange.png?v=1\" alt=\"geom_linerange\" width=\"400px\"\u003e\n\n\n```python\n    mpg = pd.read_csv(data_path / \"mpg.csv\")\n    plot = ggplot(mpg, aes(\"class\")) + geom_bar()\n    res = ggcreate(plot)\n    ggdraw_plot(res, data_path / \"geom_bar.png\")\n```\n\u003cimg src=\"plots/geom_bar.png?v=1\" alt=\"geom_bar\" width=\"400px\"\u003e\n\n```python\n    mpg = pd.read_csv(data_path / \"mpg.csv\")\n    plot = ggplot(mpg, aes(\"class\", fill=\"drv\")) + geom_bar()\n    res = ggcreate(plot)\n    ggdraw_plot(res, plots_path / \"geom_bar_fill.png\")\n```\n\u003cimg src=\"plots/geom_bar_fill.png?v=1\" alt=\"gg_point\" width=\"400px\"\u003e\n\n\n```python\n    df = pd.DataFrame({\n        'g': ['a', 'a', 'a', 'b', 'b', 'b'],\n        'x': [1, 3, 5, 2, 4, 6],\n        'y': [2, 5, 1, 3, 6, 7]\n    })\n    plot = ggplot(\n        df, aes(x=\"x\", y=\"y\", fill=\"g\")\n    ) + geom_area(alpha=0.3) + geom_point(size=5)\n    res = ggcreate(plot)\n    ggdraw_plot(res, plots_path / \"geom_area_stat_identity.png\")\n```\n\u003cimg src=\"plots/geom_area_stat_identity.png?v=1\" alt=\"geom_area_stat_identity\" width=\"400px\"\u003e\n\n```python\n    mpg = pd.read_csv(data_path / \"mpg.csv\")\n    plot = ggplot(mpg, aes(x = 'displ', y = \"cty\", text = 'manufacturer')) + geom_text()\n    res = ggcreate(plot)\n    ggdraw_plot(res, data_path / \"geom_text.png\")\n```\n\u003cimg src=\"plots/geom_text.png?v=1\" alt=\"geom_text\" width=\"400px\"\u003e\n\n\n```python\n    df = pd.DataFrame(\n        data={\"dose\": [\"D0.5\", \"D1\", \"D2\"], \"bbb\": [4.2, 10, 29.5]}\n    )\n    plot = ggplot(df, aes(x=\"dose\", y=\"bbb\")) + geom_line() + geom_point()\n    res = ggcreate(plot)\n    ggdraw_plot(res, data_path / \"geom_line_and_point_with_linetype.png\")\n```\n\u003cimg src=\"plots/geom_line_and_point_with_linetype.png?v=1\" alt=\"geom_line_and_point\" width=\"400px\"\u003e\n\n```python\n    df = pd.DataFrame({\n        'x': [1, 3, 5, 2, 4, 6],\n        'y': [2, 5, 1, 3, 6, 7]\n    })\n    plot = ggplot(\n        df, aes(x=\"x\", y=\"y\")\n    ) + geom_area(alpha=0.3)\n    res = ggcreate(plot)\n    ggdraw_plot(res, plots_path / \"geom_area_simple.png\")\n```\n\u003cimg src=\"plots/geom_area_simple.png?v=1\" alt=\"geom_area_simple\" width=\"400px\"\u003e\n\n```python\nplots = _gg_multi_plots()\nggmulti(\n    plots,\n    plots_path / \"gg_multi_pmg_bottom_to_top.png\",\n    vertical_orientation=\"bottom_to_top\"\n)\n```\n\u003cimg src=\"plots/gg_multi_pmg_bottom_to_top.png?v=1\" alt=\"gg_multi_pmg_bottom_to_top\" width=\"400px\"\u003e\n\n```python\nplots = _gg_multi_plots()\nggmulti(\n    plots,\n    plots_path / \"gg_multi_pmg_right_to_left.png\",\n    horizontal_orientation=\"right_to_left\"\n)\n```\n\u003cimg src=\"plots/gg_multi_pmg_right_to_left.png?v=1\" alt=\"gg_multi_pmg_right_to_left\" width=\"400px\"\u003e\n\n\n```python\ndf = pd.DataFrame({\n    'trt': [1, 1, 2, 2],\n    'resp': [1, 5, 3, 4],\n    'group': pd.Categorical([1, 2, 1, 2]),\n    'upper': [1.5, 5.0, 3.3, 4.2],\n    'lower': [1, 4.0, 2.4, 3.6]\n})\nplot = ggplot(df, aes(x=\"trt\", y=\"resp\", color=\"group\")) + geom_error_bar(\n    aes(ymin=\"lower\", ymax=\"upper\"), size=20\n)\nres = ggcreate(plot)\nggdraw_plot(res, plots_path / \"geom_error_bar.png\")\n```\n\u003cimg src=\"plots/geom_error_bar.png?v=1\" alt=\"geom_error_bar\" width=\"400px\"\u003e\n\n![gg](plots/simple_test.png?v=1)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxe4%2Fpython-ggplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdxe4%2Fpython-ggplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxe4%2Fpython-ggplot/lists"}