Plotting
plot_cauchy_cdf(x, y, results=None, add_reversed_data=False, add_reversed_simulated=False, show_full_fit=True, show_fit_components=False, input_params=None, **kwargs)
Plots the results of a Cauchy PDF analysis.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
npt.ArrayLike
|
The x data, e.g., magnetic field. |
required |
y |
npt.ArrayLike
|
They y data, e.g., derivative of magnetization with respect to magnetic field. |
required |
results |
CauchyAnalysisResults | None
|
The results of the fit, by default None. |
None
|
add_reversed_data |
bool
|
Option to plot the reversed data (e.g., if the data from a forward sweep of an M vs H measurement is given, this option will additionally plot the data as if it were from a reverse sweep). |
False
|
add_reversed_simulated |
bool
|
Plots the reversed generated data (generated from either/both the input data and the simulated data from the fit), by default False. |
False
|
show_full_fit |
bool
|
Assuming results is not None, whether to show the full fit (i.e., the fit resulting from the sum of separate Cauchy terms), by default True. |
True
|
show_fit_components |
bool
|
Assuming results is not None, whether to show the individual fit components, by default False. |
False
|
input_params |
CauchyFittingArgs | None
|
If given, plots the terms given by the CauchyFittingArgs object, by default None. |
None
|
Returns:
Type | Description |
---|---|
tuple[plt.Figure, plt.Axes]
|
The figure and axes objects. |
Source code in magnetopy\analyses\cauchy\plots.py
plot_cauchy_pdf(x, y, results=None, show_full_fit=True, show_fit_components=False, input_params=None, **kwargs)
Plots the results of a Cauchy PDF analysis.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
npt.ArrayLike
|
The x data, e.g., magnetic field. |
required |
y |
npt.ArrayLike
|
They y data, e.g., derivative of magnetization with respect to magnetic field. |
required |
results |
CauchyAnalysisResults | None
|
The results of the fit, by default None. |
None
|
show_full_fit |
bool
|
Assuming results is not None, whether to show the full fit (i.e., the fit resulting from the sum of separate Cauchy terms), by default True. |
True
|
show_fit_components |
bool
|
Assuming results is not None, whether to show the individual fit components, by default False. |
False
|
input_params |
CauchyFittingArgs | None
|
If given, plots the terms given by the CauchyFittingArgs object, by default None. |
None
|
Returns:
Type | Description |
---|---|
tuple[plt.Figure, plt.Axes]
|
The figure and axes objects. |
Source code in magnetopy\analyses\cauchy\plots.py
plot_cauchy(x, y, form, results=None, add_reversed_data=False, add_reversed_simulated=False, show_full_fit=True, show_fit_components=False, input_params=None, **kwargs)
Plots the results of a Cauchy analysis.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
npt.ArrayLike
|
The x data, e.g., magnetic field. |
required |
y |
npt.ArrayLike
|
They y data, e.g., derivative of magnetization with respect to magnetic field. |
required |
form |
Literal['pdf', 'cdf']
|
Whether the data is a probability density function or a cumulative distribution |
required |
results |
CauchyAnalysisResults | None
|
The results of the fit, by default None. |
None
|
add_reversed_data |
bool
|
For CDF plots, option to plot the reversed data (e.g., if the data from a forward sweep of an M vs H measurement is given, this option will additionally plot the data as if it were from a reverse sweep). |
False
|
add_reversed_simulated |
bool
|
Plots the reversed generated data (generated from either/both the input data and the simulated data from the fit), by default False. |
False
|
show_full_fit |
bool
|
Assuming results is not None, whether to show the full fit (i.e., the fit resulting from the sum of separate Cauchy terms), by default True. |
True
|
show_fit_components |
bool
|
Assuming results is not None, whether to show the individual fit components, by default False. |
False
|
input_params |
CauchyFittingArgs | None
|
If given, plots the terms given by the CauchyFittingArgs object, by default None. |
None
|
Returns:
Type | Description |
---|---|
tuple[plt.Figure, plt.Axes]
|
The figure and axes objects. |
Source code in magnetopy\analyses\cauchy\plots.py
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 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
|