# gify_plot
A simple Python package to turn your plots into gifs (Matplotlib, Seabron, Plotly).
# How to install it
`pip install gify_plot`
# Args
### Mandatory
- **original_df**:pd.DataFrame ==> a dataset containing at least three columns:
- xaxis_title (i.e., a list of int or flots; dates will be added in future, use only year for now; a range >= 20 years is suggested)
- yaxis_title (i.e., a list of int or flots )
- category (i.e., categorical variables, n groups <=7 suggested)
- **plot_type**:str ==> The plot_type changes according to plot_library
- **plot_library**:str ==> plt | sns | px (short forms for matplotlib.pyplot, seaborn and plotly.express)
- **name**:str ==> The name of pngs and gif given as output,
- **plot_title**:str
- **xaxis_title**:str ==> The name of the column with x values
- **yaxis_title**:str ==> The name of the column with y values
### Optional
- **colors** = ["blue","red","green","orange","violet","yellow","black","brown","cyan"] ==> it must have at least the same length of groups provided in the data
- **duration** = 100 ==> The delay in skipping to the next frame in ms
- **loop** = 0
- **save_frames** = True ==> If False, delete all png files that have been used to create the gif
# How to use it
```
# WARNING:
# Using more than 5/7 categories ends with a cluttered result.
# The fewer, the better.
# The following csv can be freely downlaoded at https://www.kaggle.com/datasets/sazidthe1/world-gdp-data?select=gdp_data.csv
df=pd.read_csv("gdp_data.csv")
temp_df=df[(df["country_name"].isin(["Italy","Spain"]))]
gify_plot(temp_df,
plot_type="line", plot_library="plt", name="test_gif",
plot_title="GDP per country", xaxis_title="year", yaxis_title="value", category="country_code",
save_frames=False
)
```
**OUTPUT**: It ouputs a list of png in the dedicated folder, along with the resulting gif.
# Supported libraries and plots:
- **plt** (i.e., matplotlib.pyplot):
- line
- bar
- scatter
- stackplot (no legend)
- **sns** (i.e., seaborn):
- lineplot
- scatterplot
- barplot
- **px** (i.e., plotly.express):
- line
- scatter
- area
- bar
Raw data
{
"_id": null,
"home_page": "https://github.com/FrancescoDiCursi/gify_plot",
"name": "gify-plot",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "gif,plot,seaborn,matplotlib,plotly",
"author": "Francesco Di Cursi",
"author_email": "f.dicursi@studenti.unipi.it",
"download_url": "https://files.pythonhosted.org/packages/68/b5/645fd1f79d752a530e794a528cefd28852b539c66fd325d29d0dc5cc3455/gify_plot-0.0.10.tar.gz",
"platform": null,
"description": "# gify_plot\r\nA simple Python package to turn your plots into gifs (Matplotlib, Seabron, Plotly).\r\n\r\n# How to install it\r\n`pip install gify_plot`\r\n\r\n# Args\r\n ### Mandatory\r\n - **original_df**:pd.DataFrame ==> a dataset containing at least three columns:\r\n - xaxis_title (i.e., a list of int or flots; dates will be added in future, use only year for now; a range >= 20 years is suggested)\r\n - yaxis_title (i.e., a list of int or flots )\r\n - category (i.e., categorical variables, n groups <=7 suggested)\r\n - **plot_type**:str ==> The plot_type changes according to plot_library\r\n - **plot_library**:str ==> plt | sns | px (short forms for matplotlib.pyplot, seaborn and plotly.express)\r\n - **name**:str ==> The name of pngs and gif given as output,\r\n - **plot_title**:str \r\n - **xaxis_title**:str ==> The name of the column with x values\r\n - **yaxis_title**:str ==> The name of the column with y values\r\n ### Optional\r\n - **colors** = [\"blue\",\"red\",\"green\",\"orange\",\"violet\",\"yellow\",\"black\",\"brown\",\"cyan\"] ==> it must have at least the same length of groups provided in the data\r\n - **duration** = 100 ==> The delay in skipping to the next frame in ms\r\n - **loop** = 0\r\n - **save_frames** = True ==> If False, delete all png files that have been used to create the gif\r\n\r\n# How to use it\r\n```\r\n# WARNING:\r\n\r\n# Using more than 5/7 categories ends with a cluttered result.\r\n# The fewer, the better.\r\n\r\n# The following csv can be freely downlaoded at https://www.kaggle.com/datasets/sazidthe1/world-gdp-data?select=gdp_data.csv\r\n\r\ndf=pd.read_csv(\"gdp_data.csv\")\r\ntemp_df=df[(df[\"country_name\"].isin([\"Italy\",\"Spain\"]))]\r\ngify_plot(temp_df,\r\n plot_type=\"line\", plot_library=\"plt\", name=\"test_gif\",\r\n plot_title=\"GDP per country\", xaxis_title=\"year\", yaxis_title=\"value\", category=\"country_code\",\r\n save_frames=False\r\n )\r\n```\r\n\r\n**OUTPUT**: It ouputs a list of png in the dedicated folder, along with the resulting gif.\r\n\r\n# Supported libraries and plots:\r\n- **plt** (i.e., matplotlib.pyplot):\r\n - line\r\n - bar\r\n - scatter\r\n - stackplot (no legend)\r\n- **sns** (i.e., seaborn):\r\n - lineplot\r\n - scatterplot\r\n - barplot\r\n- **px** (i.e., plotly.express):\r\n - line\r\n - scatter\r\n - area\r\n - bar\r\n\r\n\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A basic package to turn plots into gifs.",
"version": "0.0.10",
"project_urls": {
"Homepage": "https://github.com/FrancescoDiCursi/gify_plot"
},
"split_keywords": [
"gif",
"plot",
"seaborn",
"matplotlib",
"plotly"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6908c29a27e8b23f34f43fc6c5d5744d2135dda348503a4b47f18f7aa4da9657",
"md5": "a25060a5f53c8f7ae475ecb0cabd7c0f",
"sha256": "b789dae3aeca4ca43a5b8cf91d49f055ec7e01c711baab16cf9c1089932a2ac2"
},
"downloads": -1,
"filename": "gify_plot-0.0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a25060a5f53c8f7ae475ecb0cabd7c0f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6422,
"upload_time": "2023-09-29T03:11:03",
"upload_time_iso_8601": "2023-09-29T03:11:03.606987Z",
"url": "https://files.pythonhosted.org/packages/69/08/c29a27e8b23f34f43fc6c5d5744d2135dda348503a4b47f18f7aa4da9657/gify_plot-0.0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "68b5645fd1f79d752a530e794a528cefd28852b539c66fd325d29d0dc5cc3455",
"md5": "86f2b6834271456528915be6a9b13e02",
"sha256": "d80fdd73b930fdf12169eb0ef1be5841d351b2d53776d5bd84a5c4562a64cd00"
},
"downloads": -1,
"filename": "gify_plot-0.0.10.tar.gz",
"has_sig": false,
"md5_digest": "86f2b6834271456528915be6a9b13e02",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4193,
"upload_time": "2023-09-29T03:11:05",
"upload_time_iso_8601": "2023-09-29T03:11:05.295588Z",
"url": "https://files.pythonhosted.org/packages/68/b5/645fd1f79d752a530e794a528cefd28852b539c66fd325d29d0dc5cc3455/gify_plot-0.0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-29 03:11:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "FrancescoDiCursi",
"github_project": "gify_plot",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "gify-plot"
}