Print the attributes of the built-in styles of DAG plots.
Parameters:
| Name |
Type |
Description |
Default |
which
|
str or None
|
If None, returns the names of the built-in styles.
If str, it can be:
- The name of the built-in style: returns a dictionary with the
parameters of the respective style
- ‘current’: returns the dictionary with the current global style
set in options
|
None
|
Returns:
| Type |
Description |
dict or None
|
|
Source code in causalinf/gcm.py
| def get_styles(which=None):
"""
Print the attributes of the built-in styles of DAG plots.
Parameters
----------
which : str or None
If ``None``, returns the names of the built-in styles.
If ``str``, it can be:
* The name of the built-in style: returns a dictionary with the
parameters of the respective style
* 'current': returns the dictionary with the current global style
set in options
Returns
-------
dict or None
"""
if not which:
print(f"To see the style dictionary, use the 'which' argument with the name of a built-in style.")
print(f"Built-in styles available: \n- {' \n- '.join(GRAPH_STYLES.keys())}")
print(f"Use which='current' to get the current global style.")
res = None
else:
if which=='current':
res = get_options('graph_style')
else:
res = copy_style(which)
return res
|