Plotting Module
plotting
plot_utils
latex_plt(matplotlib)
This function updates the matplotlib library to use Latex and changes some default plot parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
matplotlib
|
module
|
The matplotlib module (e.g., |
required |
Returns:
Type | Description |
---|---|
module
|
The updated matplotlib module with LaTeX and custom settings applied. |
Source code in allinpy/plotting/plot_utils.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
cm2inch(*tupl)
This function converts cm to inches.
Obtained from: https://stackoverflow.com/questions/14708695/ specify-figure-size-in-centimeter-in-matplotlib/22787457
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tupl
|
float or tuple of float
|
Size of the plot in centimeters. Can be provided as individual float arguments (e.g., width, height) or as a single tuple of floats. |
()
|
Returns:
Type | Description |
---|---|
tuple of float
|
Converted image size in inches. |
Source code in allinpy/plotting/plot_utils.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
label_subplots(f, texts, x_offset=-0.07, y_offset=0.015)
This function labels the subplots.
Obtained from: https://stackoverflow.com/questions/52286497/ matplotlib-label-subplots-of-different-sizes-the-exact-same-distance-from-corner
Parameters:
Name | Type | Description | Default |
---|---|---|---|
f
|
Figure
|
Matplotlib figure handle containing the subplots. |
required |
texts
|
sequence of str
|
List of labels for each subplot (e.g., ["A", "B", "C"]). |
required |
x_offset
|
float or sequence of float
|
Horizontal offset(s) for the subplot labels. If a single float, the same offset is applied to all subplots. Default is -0.07. |
-0.07
|
y_offset
|
float or sequence of float
|
Vertical offset(s) for the subplot labels. If a single float, the same offset is applied to all subplots. Default is 0.015. |
0.015
|
Returns:
Type | Description |
---|---|
None
|
This function does not return any value. |
Source code in allinpy/plotting/plot_utils.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
|