{"id":21536672,"url":"https://github.com/kartmaan/plotly-intervals","last_synced_at":"2026-05-10T07:38:03.874Z","repository":{"id":155750874,"uuid":"564943917","full_name":"Kartmaan/plotly-intervals","owner":"Kartmaan","description":"Group values from a Pandas Series according to given intervals and represent them graphically with Plotly","archived":false,"fork":false,"pushed_at":"2023-04-29T14:06:09.000Z","size":37,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-24T07:29:59.795Z","etag":null,"topics":["bar-chart","grouping","grouping-plots","intervals","intervals-chart","numpy","numpy-arrays","orca","pandas","pandas-series","percentile","pie-chart","plot","plotly","plotting","values"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kartmaan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-11-11T22:00:13.000Z","updated_at":"2024-05-06T14:23:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"a924e0d1-e186-4944-895c-8a691f020641","html_url":"https://github.com/Kartmaan/plotly-intervals","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"f59dc44ea27f625d43a8d079396b28c15529af54"},"previous_names":["kartmaan/plotly-intervals"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kartmaan%2Fplotly-intervals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kartmaan%2Fplotly-intervals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kartmaan%2Fplotly-intervals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kartmaan%2Fplotly-intervals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kartmaan","download_url":"https://codeload.github.com/Kartmaan/plotly-intervals/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244104858,"owners_count":20398748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bar-chart","grouping","grouping-plots","intervals","intervals-chart","numpy","numpy-arrays","orca","pandas","pandas-series","percentile","pie-chart","plot","plotly","plotting","values"],"created_at":"2024-11-24T03:20:57.182Z","updated_at":"2026-05-10T07:38:03.822Z","avatar_url":"https://github.com/Kartmaan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# plotly_intervals\nA function that groups values from a Pandas Series according to given intervals \nand represent them graphically in the form of bar chart or pie chart with Plotly. Serval \nparameters can be adjusted :\n- The plot title\n- x/y axis labels\n- The intervals chosen for the grouping of values (example: [[0,5], [5,10], ...]\n- If no interval is defined, default intervals will be generated from the values present in the Pandas Series\n- Display a last interval grouping all the values greater than the last given interval\n- The plot kind (bar chart or pie chart)\n- Grid display\n- Choice of bar color for bar chart\n- The output (static/non-interactive image, interactive figure, plotly Figure object, bytes, intervals dictionnary)\n\n# Exemples\nFor this example we will use a dataset on exoplanets and recover in the form of Pandas Series the column relating to the distance of planetary systems from us :\n\n```\ndist = df['sy_dist']\n```\n\nTo start we will simply insert the Series into the function without adding any parameters :\n\n```\nplot_group(dist)\n```\n\n![dist](https://user-images.githubusercontent.com/11463619/201731901-2a962c4e-8157-406c-8779-5dc4704f636f.png)\n\n**Intervals have been defined automatically** by the function **based on the values present in the Series** and their dispersion (see the comments in the function for more information).\n\nNow let's relaunch the function but adding some parameters and, in particular, **custom intervals**.\n\n```\n# Custom intervals\ninter = [[0,25], [25,50], [75,100], [100,125], [125,150]]\n\nplot_group(dist,\nintervals = inter, \ntitle='Distance of exoplanets from us', \nx_label='Distance [parsec]',\ny_label='Number of exoplanets',\nbar_color='#b4522b')\n```\n\n![dist_inter](https://user-images.githubusercontent.com/11463619/201731894-64b68c28-929c-4196-9eb0-ac64d143b4ad.png)\n\nThe `higher_vals` parameter allows to add a last interval grouping all the values of the Series greater than the last interval provided\n\n```\n# Custom intervals\ninter = [[0,400], [400,800], [800,1200]]\n\nplot_group(dist,\nintervals = inter,\nhigher_vals=True,\ntitle='Distance of exoplanets from us', \nx_label='Distance [parsec]',\ny_label='Number of exoplanets',\nbar_color='#b4522b')\n```\n\n![dist_high](https://user-images.githubusercontent.com/11463619/201738946-b9657aca-c540-46b7-9cbc-b19d87ffb982.png)\n\nThe representation can also be done in the form of a pie chart :\n\n``` \ninter = [[0,400], [400,800], [800,1200]]\n\nplot_group(dist,\nkind='pie_hole',\nintervals = inter,\nhigher_vals=True, \ntitle='Distance of exoplanets from us')\n```\n\n![dist_pie](https://user-images.githubusercontent.com/11463619/201741980-02ba18a3-616e-48d6-9082-0db64e9b7f16.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkartmaan%2Fplotly-intervals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkartmaan%2Fplotly-intervals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkartmaan%2Fplotly-intervals/lists"}