Skip to content

Commit

Permalink
Update ptable_plotter to plotter
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-S-Rosen committed Sep 14, 2023
1 parent 616a2ac commit 1f374d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ 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

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)
Expand Down
2 changes: 1 addition & 1 deletion periodic_trends.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import warnings


def ptable_plotter(
def plotter(
filename: str,
show: bool = True,
output_filename: str = None,
Expand Down

0 comments on commit 1f374d8

Please sign in to comment.