From 1f374d8f8a160be0e361acc965282b63341c53e4 Mon Sep 17 00:00:00 2001 From: Andrew Rosen Date: Thu, 14 Sep 2023 12:17:42 -0700 Subject: [PATCH] Update ptable_plotter to plotter --- README.md | 14 +++++++------- periodic_trends.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 29dc637..78c5107 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,13 @@ This Python script (`periodic_trends.py`) can be used to plot a heat map over an A minimal example is as follows: ```python -from periodic_trends import ptable_plotter -ptable_plotter("ionization_energies.csv") +from periodic_trends import plotter +plotter("ionization_energies.csv") ``` ![plot1](example_images/plot1.png) -The only required argument to `ptable_plotter()` is a single positional argument for the full filepath/name (with extension) of the data file containing your periodic trend data. The data file must be in a comma-separated value (`.csv`) format with the first entry in each row being the atom symbol and the second entry being the value you wish to plot. An example `.csv` file is included in this repository for testing purposes under the name `ionization_energies.csv`. After the `periodic_trends.py` script is run, it will show the plot in your web browser. To save the image, simply click the save icon that appears in the web browser figure. +The only required argument to `plotter()` is a single positional argument for the full filepath/name (with extension) of the data file containing your periodic trend data. The data file must be in a comma-separated value (`.csv`) format with the first entry in each row being the atom symbol and the second entry being the value you wish to plot. An example `.csv` file is included in this repository for testing purposes under the name `ionization_energies.csv`. After the `periodic_trends.py` script is run, it will show the plot in your web browser. To save the image, simply click the save icon that appears in the web browser figure. There are numerous optional arguments, which can be used to modify the appearance of the figure. The full argument list is below: https://github.com/Andrew-S-Rosen/periodic_trends/blob/ba8224d701986ee0215af2eb0f6c37de9ef2e683/ptable_trends.py#L28-L101 @@ -23,15 +23,15 @@ https://github.com/Andrew-S-Rosen/periodic_trends/blob/ba8224d701986ee0215af2eb0 A couple of examples using various optional keyword arguments are as follows: ```python -from periodic_trends import ptable_plotter -ptable_plotter("ionization_energies.csv", log_scale=True) +from periodic_trends import plotter +plotter("ionization_energies.csv", log_scale=True) ``` ![plot2](example_images/plot2.png) ```python -from periodic_trends import ptable_plotter -ptable_plotter("ionization_energies.csv", cmap="viridis", alpha=0.7, extended=False, periods_remove=[1]) +from periodic_trends import plotter +plotter("ionization_energies.csv", cmap="viridis", alpha=0.7, extended=False, periods_remove=[1]) ``` ![plot3](example_images/plot3.png) diff --git a/periodic_trends.py b/periodic_trends.py index 7ac0854..e91ff7f 100644 --- a/periodic_trends.py +++ b/periodic_trends.py @@ -25,7 +25,7 @@ import warnings -def ptable_plotter( +def plotter( filename: str, show: bool = True, output_filename: str = None,