Skip to content

Commit

Permalink
fixed issue with plots with more than 8 tT paths
Browse files Browse the repository at this point in the history
  • Loading branch information
wrguenthner committed Apr 21, 2024
1 parent 1ac3c56 commit 3cfa0b7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pip install pythermo

## Usage

It is recommended the you use this package in [Jupyter Notebooks](https://jupyter.org), which are included in the [Anaconda](https://www.anaconda.com/download) platform. Once you've downloaded or installed the package, and if you're just interested in running some forward models, the quickest way to get started is to modify the Jupyter Notebook file `template.ipynb` that is included in the `examples` folder. The notebook contains markdown and code that explains and demonstrates forward model date-eU comparisons for the apatite and zircon (U-Th)/He system. The forward modeling method is one particular approach and you can (and should!) call lower level methods to suite your needs. The `tT_path` and `crystal` classes contain several methods that you may want to call. A basic example of one way to use lower-level methods is included in `template.ipynb`. Please read the descriptions for each method in the source code for more details.
It is recommended that you use this package in [Jupyter Notebooks](https://jupyter.org), which are included in the [Anaconda](https://www.anaconda.com/download) platform. Once you've downloaded or installed the package, and if you're just interested in running some forward models, the quickest way to get started is to modify the Jupyter Notebook file `template.ipynb` that is included in the `examples` folder. The notebook contains markdown and code that explains and demonstrates forward model date-eU comparisons for the apatite and zircon (U-Th)/He system. The forward modeling method is one particular approach and you can (and should!) call lower level methods to suite your needs. The `tT_path` and `crystal` classes contain several methods that you may want to call. A basic example of one way to use lower-level methods is included in `template.ipynb`. Please read the descriptions for each method in the source code for more details.

## Citation

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=61.0","setuptools-git-versioning"]
requires = ["setuptools>=61.0", "wheel", "setuptools-git-versioning"]
build-backend = "setuptools.build_meta"

[tool.setuptools-git-versioning]
Expand Down
12 changes: 9 additions & 3 deletions src/pythermo/tT_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"""
import matplotlib.pyplot as plt
import matplotlib.cm as mplcm
import matplotlib.colors as colors
from cycler import cycler
from .constants import np
from .crystal import apatite, zircon
Expand Down Expand Up @@ -271,11 +273,15 @@ def date_eU_plot(self, model_data, grain_num, comp_type):
time_max = 0
temp_max = 0

#set up color strings, if greater than 8 date-eU/tT sets, switch to viridis gradational color scheme
if np.size(model_data,1)/3 < 8:
#set up color strings, if greater than 8 date-eU/tT sets, switch to plasma gradational color scheme
if np.size(model_data,1)/3 <= 8:
color_options = ['xkcd:black','xkcd:royal blue','xkcd:red','xkcd:sky','xkcd:lime','xkcd:dark purple','xkcd:rose','xkcd:grey']
else:
color_options = []
num_of_colors = np.size(model_data,1)/3
color_map = plt.get_cmap('plasma')
color_norm = colors.Normalize(vmin=0, vmax=num_of_colors-1)
scalar_map = mplcm.ScalarMappable(norm=color_norm, cmap=color_map)
color_options = [scalar_map.to_rgba(i) for i in range(num_of_colors)]

#line option cycler for model comparisons
line_options = cycler(line_style=['-','--',':','-.'])
Expand Down

0 comments on commit 3cfa0b7

Please sign in to comment.