rstoolbox.plot.plot_CD

rstoolbox.plot.plot_CD(df, ax, color=None, wavelengths=None, sample=None)

Plot Circular Dichroism data.

The provied DataFrame must contain, at least, the following columns:

Column Name Data Content
Wavelength Wavelength (nm).
MRE Value at each wavelength (10 deg^2 cm^2 dmol^-1).

If the input data is of the class CDFrame, it will assume that data has been loaded with the read_CD() function and that multiple temperatures are present and plot it accordingly.

Parameters:
  • df (DataFrame) – Data container.
  • ax (Axes) – Axis in which to plot the data.
  • color (Union[int, str]) – DataFrame: Color for the data. If a number, it takes from the current seaborn palette. CDFrame: Provide the palette ID to use.
  • wavelengths (list() of float) – List with min and max wavelengths to plot.
  • sample (int) – CDFrame: Limit the number of temperatures shown. According to the number of temperatures available, it will get them as separate as possible. If sample is bigger than the available temperatures, all are shown. Sampling selection is based on Bresenham’s line algorithm
Raise:
ValueError:If a wrong palette name is provided.
ValueError:If 0 samples are requested.

Example - Single Tabulated Data File

In [1]: from rstoolbox.plot import plot_CD
   ...: import numpy as np
   ...: import pandas as pd
   ...: import matplotlib.pyplot as plt
   ...: df = pd.read_csv("../rstoolbox/tests/data/cd.csv")
   ...: fig = plt.figure(figsize=(10, 6.7))
   ...: ax = plt.subplot2grid((1, 1), (0, 0))
   ...: plot_CD(df, ax)
   ...: 

In [2]: plt.show()
../_images/plot_cd_docs.png

Example - Multiple Machine-Generated Data Files

In [3]: from rstoolbox.plot import plot_CD
   ...: import numpy as np
   ...: import pandas as pd
   ...: import matplotlib.pyplot as plt
   ...: df = pd.read_csv("../rstoolbox/tests/data/cd.csv")
   ...: fig = plt.figure(figsize=(10, 6.7))
   ...: ax = plt.subplot2grid((1, 1), (0, 0))
   ...: plot_CD(df, ax)
   ...: 

In [4]: plt.show()

In [5]: plt.close('all')
../_images/plot_cd2_docs.png