skultrafast.plot_helpers

Created on Tue May 27 15:35:22 2014

@author: tillsten

Module Contents

Classes

MidPointNorm

A class which, when called, linearly normalizes data into the

Functions

ir_mode()

vis_mode()

plot_singular_values(dat)

make_dual_axis([ax, axis, unit, minor_ticks])

plot_svd_components(tup[, n, from_t])

make_angle_plot(wl, t, para, senk, t_range)

make_angle_plot2(wl, t, para, senk, t_range)

lbl_spec([ax])

lbl_trans([ax, use_symlog])

lbl_map([ax, use_symlog])

plot_trans(tup, wls[, symlog, norm, marker, ax])

mean_tup(tup, time)

plot_ints(tup, wls[, factors, symlog, norm, ...])

plot_diff(tup, t0, t_list, **kwargs)

time_formatter(time[, unit])

plot_spec(tup, t_list[, ax, norm])

mean_spec(wl, t, p, t_range[, ax, pos, markers])

nice_map(wl, t, d[, lvls, linthresh, linscale, norm, ...])

nice_lft_map(tup, taus, coefs[, show_sums])

plot_freqs(tup, wl, from_t, to_t[, taus])

plot_fft(x, y[, min_amp, order, padding, power, ax])

plot_coef_spec(taus, wl, coefs, div)

fit_semiconductor(t, data[, sav_n, sav_deg, mode, tr])

stack_ax([num_rows, num_cols, height_rations])

nsf(num[, n])

n-Significant Figures

error_string(→ str)

Returns a string with the value and error with correct siginificant figures

error_string_lmfit(→ str)

Returns a string with the value and error with correct siginificant figures

fig_fixed_axes(axes_shape, axes_size[, padding, ...])

Helper funtion to generate a figure form axes sizes given in inches

symticks(ax[, linthresh, linstep, axis])

lbl_axes([axs, pos, fmt, labels])

Labels the axes in figure

ci_plot(ci_dict, trace)

Plots the given CI intervals. Needs the trace output from coinfidence

get_fonts(→ List[str])

enable_style()

scale_y(lines, scale, x_range)

Muliplies the y-data of the given lines by the given scale in the given range.

Attributes

skultrafast.plot_helpers.ma[source]
skultrafast.plot_helpers.linewidth = 2[source]
skultrafast.plot_helpers.ir_mode()[source]
skultrafast.plot_helpers.vis_mode()[source]
skultrafast.plot_helpers.time_label = 'Delay time [ps]'[source]
skultrafast.plot_helpers.time_unit = 'ps'[source]
skultrafast.plot_helpers.sig_label = 'Absorbance change [mOD]'[source]
skultrafast.plot_helpers.vib_label = 'Wavenumber  [cm$^{-1}$]'[source]
skultrafast.plot_helpers.freq_label = 'Wavelength [nm]'[source]
skultrafast.plot_helpers.inv_freq = False[source]
skultrafast.plot_helpers.freq_unit = 'nm'[source]
skultrafast.plot_helpers.line_width = 1[source]
skultrafast.plot_helpers.plot_singular_values(dat)[source]
skultrafast.plot_helpers.make_dual_axis(ax: matplotlib.pyplot.Axes = None, axis='x', unit='nm', minor_ticks=True)[source]
skultrafast.plot_helpers.plot_svd_components(tup, n=4, from_t=None)[source]
skultrafast.plot_helpers.make_angle_plot(wl, t, para, senk, t_range)[source]
skultrafast.plot_helpers.make_angle_plot2(wl, t, para, senk, t_range)[source]
skultrafast.plot_helpers.lbl_spec(ax=None)[source]
skultrafast.plot_helpers.lbl_trans(ax=None, use_symlog=True)[source]
skultrafast.plot_helpers.lbl_map(ax=None, use_symlog=True)[source]
skultrafast.plot_helpers.plot_trans(tup, wls, symlog=True, norm=False, marker=None, ax=None, **kwargs)[source]
skultrafast.plot_helpers.mean_tup(tup, time)[source]
skultrafast.plot_helpers.plot_ints(tup, wls, factors=None, symlog=True, norm=False, is_wavelength=True, ax=None, **kwargs)[source]
skultrafast.plot_helpers.plot_diff(tup, t0, t_list, **kwargs)[source]
skultrafast.plot_helpers.time_formatter(time, unit='ps')[source]
skultrafast.plot_helpers.plot_spec(tup, t_list, ax=None, norm=False, **kwargs)[source]
skultrafast.plot_helpers.mean_spec(wl, t, p, t_range, ax=None, pos=(0.1, 0.1), markers=['o', '^'])[source]
skultrafast.plot_helpers.nice_map(wl, t, d, lvls=20, linthresh=10, linscale=1, norm=None, linscaley=1, cmap='coolwarm', **kwargs)[source]
skultrafast.plot_helpers.nice_lft_map(tup, taus, coefs, show_sums=False, **kwargs)[source]
skultrafast.plot_helpers.plot_freqs(tup, wl, from_t, to_t, taus=[1])[source]
skultrafast.plot_helpers.plot_fft(x, y, min_amp=0.2, order=1, padding=2, power=1, ax=None)[source]
skultrafast.plot_helpers.plot_coef_spec(taus, wl, coefs, div)[source]
class skultrafast.plot_helpers.MidPointNorm(midpoint=0, vmin=None, vmax=None, clip=False)[source]

Bases: matplotlib.colors.Normalize

A class which, when called, linearly normalizes data into the [0.0, 1.0] interval.

__call__(value, clip=None)[source]

Normalize value data in the [vmin, vmax] interval into the [0.0, 1.0] interval and return it.

Parameters:
  • value – Data to normalize.

  • clip (bool, optional) –

    See the description of the parameter clip in .Normalize.

    If None, defaults to self.clip (which defaults to False).

Notes

If not already initialized, self.vmin and self.vmax are initialized using self.autoscale_None(value).

inverse(value)[source]
skultrafast.plot_helpers.fit_semiconductor(t, data, sav_n=11, sav_deg=4, mode='sav', tr=0.4)[source]
skultrafast.plot_helpers.stack_ax(num_rows=2, num_cols=1, height_rations=[2, 1])[source]
skultrafast.plot_helpers.nsf(num, n=1)[source]

n-Significant Figures

skultrafast.plot_helpers.error_string(val: float, err: float, valname: str | None = None, unit: str | None = None) str[source]

Returns a string with the value and error with correct siginificant figures

skultrafast.plot_helpers.error_string_lmfit(param: lmfit.Parameter, valname: str | None = None, unit: str | None = None) str[source]

Returns a string with the value and error with correct siginificant figures

skultrafast.plot_helpers.fig_fixed_axes(axes_shape: Tuple[int, int], axes_size: Tuple[float, float], padding: float = 0.3, left_margin: float = 0.45, bot_margin: float = 0.42, hspace: float = 0.1, vspace: float = 0.1, xlabel: str | None = None, ylabel: str | None = None, **kwargs)[source]

Helper funtion to generate a figure form axes sizes given in inches

skultrafast.plot_helpers.symticks(ax, linthresh=1, linstep=0.2, axis='x')[source]
skultrafast.plot_helpers.lbl_axes(axs=None, pos=(-0.2, -0.2), fmt='(%s)', labels=None, **kwargs)[source]

Labels the axes in figure

Parameters:
  • axs (List[plt.Axes], optional) – The axes to label, by default None

  • pos (tuple, optional) – x, y position of the label in axis coordinates , by default (-.2, -.2)

  • fmt (str, optional) – Format string, by default “(%s)”

  • labels ([type], optional) – The label, by default None, resulting in a, b, c, …

  • kwargs – will be passed to ax.text.

skultrafast.plot_helpers.ci_plot(ci_dict, trace)[source]

Plots the given CI intervals. Needs the trace output from coinfidence intervals. Currently assumes the CI are calculated for 1,2 and 3 sigmas.

Parameters:
  • ci_dict (dict) – Out

  • trace (dict) – Trace dict

skultrafast.plot_helpers.get_fonts() List[str][source]
skultrafast.plot_helpers.enable_style()[source]
skultrafast.plot_helpers.scale_y(lines: List[matplotlib.pyplot.Line2D], scale: float, x_range: Tuple[float, float])[source]

Muliplies the y-data of the given lines by the given scale in the given range. Also inserts a Nan at the beginning and end of the range to prevent the line from being connected to the rest of the data.

Parameters:
  • lines (List[plt.Line2D]) – The lines to scale

  • scale (float) – The scale factor

  • range (Tuple[float, float]) – The range in which to scale