Plots a signal in decibels in time domain. Parameters (default), (type): ------------------------------ * sigObjs (), (list): a list with SignalObjs. * xLabel ('Time [s]'), (str): x axis label. * yLabel ('Amplitude'), (str):
(sigObjs, xLabel, yLabel, yLim, xLim, title, decimalSep, timeUnit)
| 181 | |
| 182 | |
| 183 | def time_dB(sigObjs, xLabel, yLabel, yLim, xLim, title, decimalSep, timeUnit): |
| 184 | """ |
| 185 | Plots a signal in decibels in time domain. |
| 186 | |
| 187 | Parameters (default), (type): |
| 188 | ------------------------------ |
| 189 | |
| 190 | * sigObjs (), (list): |
| 191 | a list with SignalObjs. |
| 192 | |
| 193 | * xLabel ('Time [s]'), (str): |
| 194 | x axis label. |
| 195 | |
| 196 | * yLabel ('Amplitude'), (str): |
| 197 | y axis label. |
| 198 | |
| 199 | * yLim (), (list): |
| 200 | inferior and superior limits. |
| 201 | |
| 202 | >>> yLim = [-100, 100] |
| 203 | |
| 204 | * xLim (), (list): |
| 205 | left and right limits |
| 206 | |
| 207 | >>> xLim = [0, 15] |
| 208 | |
| 209 | * title (), (str): |
| 210 | plot title |
| 211 | |
| 212 | * decimalSep (','), (str): |
| 213 | may be dot or comma. |
| 214 | |
| 215 | >>> decimalSep = ',' # in Brazil |
| 216 | |
| 217 | * timeUnit ('s'), (str): |
| 218 | 'ms' or 's'. |
| 219 | |
| 220 | |
| 221 | Return: |
| 222 | -------- |
| 223 | |
| 224 | matplotlib.figure.Figure object. |
| 225 | """ |
| 226 | if decimalSep == ',': |
| 227 | locale.setlocale(locale.LC_NUMERIC, 'pt_BR.UTF-8') |
| 228 | plt.rcParams['axes.formatter.use_locale'] = True |
| 229 | elif decimalSep =='.': |
| 230 | locale.setlocale(locale.LC_NUMERIC, 'C') |
| 231 | plt.rcParams['axes.formatter.use_locale'] = False |
| 232 | else: |
| 233 | raise ValueError("'decimalSep' must be the string '.' or ','.") |
| 234 | |
| 235 | if timeUnit in ['s', 'seconds', 'S']: |
| 236 | timeScale = 1 |
| 237 | timeUnit = 's' |
| 238 | elif timeUnit in ['ms', 'milliseconds', 'mseconds', 'MS']: |
| 239 | timeScale = 1000 |
| 240 | timeUnit = 'ms' |
nothing calls this directly
no test coverage detected