Plotting
Plotting of the fit results.
PlotSpectra
¶
Plotting of the fit results.
Source code in spectrafit/plotting.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 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 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|
__call__()
¶
Plot the data and the fit.
Source code in spectrafit/plotting.py
33 34 35 36 37 38 39 |
|
__init__(df, args)
¶
Initialize the PlotSpectra class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df | pd.DataFrame | DataFrame containing the input data ( | required |
args | Dict[str, Any] | The input file arguments as a dictionary with additional information beyond the command line arguments. | required |
Source code in spectrafit/plotting.py
20 21 22 23 24 25 26 27 28 29 30 31 |
|
plot_global_spectra()
¶
Plot spectra for global fitting.
Plotting of the global spectra
The plotting routine for global fitting is similar to the local plotting routine, but the spectra are plotted in a grid spectra plot. The first row of the grid plot contains the residuals of each single fit, the second row the best fit of the model with single peak contributions.
Source code in spectrafit/plotting.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 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 |
|
plot_local_spectra()
¶
Plot spectra for local fitting.
plot_spectra
performs a dual split plot. In the upper part, the residuum is plotted together with a linear regression line. This means, if the linear regression is a flat line, the fit and spectra are identically. In the lower part, the fit is plotted together with the original spectra. Also the single contributions of the fit are drawn.
About Plotting
plot_spectra
is a wrapper around the seaborn.lineplot
and seaborn.regplot
function. Furthermore, the MultiCursor
widget is used to create an interactive plot, for picking the energy and intensity of the spectrum. the MultiCursor
widget is a part of the matplotlib
library and can be used for both, the residual plot and the spectrum plot.
The upper part shows the residuum and the linear regression line. The lower part shows the fit and the single contributions of the fit.
Source code in spectrafit/plotting.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|