Beispiel #1
0
def test_plot_ic_minutes(im_i):
    fig, ax = plt.subplots()

    # Plotting IC with various Line2D options
    plot_ic(ax, im_i.get_ic_at_index(5), minutes=True)

    return fig
Beispiel #2
0
def test_plot_ic_label(im_i):
    fig, ax = plt.subplots()

    plot_ic(ax, im_i.get_ic_at_index(5), label="IC @ Index 5")
    ax.legend()

    return fig
Beispiel #3
0
def test_plot_ic_title(im_i):
    fig, ax = plt.subplots()

    plot_ic(ax, im_i.get_ic_at_index(5))
    ax.set_title("Test IC Plot")

    return fig
Beispiel #4
0
def test_plot_peaks_with_tic(peak_list, tic):
    fig, ax = plt.subplots()

    plot_ic(ax, tic)
    plot_peaks(ax, peak_list)

    return fig
Beispiel #5
0
def test_plot_tic_title(tic):
    fig, ax = plt.subplots()

    plot_ic(ax, tic)

    ax.set_title("Test TIC Plot")

    return fig
Beispiel #6
0
def test_plot_tic_label(tic):
    fig, ax = plt.subplots()

    plot_ic(ax, tic, label="IC @ Index 5")

    ax.legend()

    return fig
Beispiel #7
0
def test_plot_ic_errors(im_i, data, ms):
    fig, ax = plt.subplots()

    for obj in [
            *test_sequences, test_string, *test_numbers, test_dict, im_i, data,
            ms
    ]:
        with pytest.raises(TypeError, match="'ic' must be an IonChromatogram"):
            plot_ic(ax, obj)
tic = data.tic

# Import matplotlib and the `plot_ic()` function, create a subplot, and plot the TIC:

# In[3]:

# 3rd party
import matplotlib.pyplot as plt

# this package
from pymassspec_plot import plot_ic

fig, ax = plt.subplots(1, 1, figsize=(8, 5))

# Plot the TIC
plot_ic(ax, tic, label="TIC")

# Set the title
ax.set_title("TIC for gc01_0812_066")

# Add the legend
plt.legend()

plt.show()

# In addition to the TIC, other arguments may be passed to `plot_ic()`. These can
# adjust the line colour or the text of the legend entry.
# See https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.lines.Line2D.html for a
# full list of the possible arguments.
#
# An `IonChromatogram` can be plotted in the same manner as the TIC in the example above.
Beispiel #9
0
def test_plot_ic_multiple(im_i):
    fig, ax = plt.subplots()

    plot_ic(ax, im_i.get_ic_at_index(5), label="IC @ Index 5")
    plot_ic(ax, im_i.get_ic_at_index(10), label="IC @ Index 10")
    plot_ic(ax, im_i.get_ic_at_index(20), label="IC @ Index 20")
    plot_ic(ax, im_i.get_ic_at_index(40), label="IC @ Index 40")
    plot_ic(ax, im_i.get_ic_at_index(80), label="IC @ Index 80")
    plot_ic(ax, im_i.get_ic_at_index(160), label="IC @ Index 160")

    ax.legend()

    return fig
Beispiel #10
0
def test_plot_ic_linestyle(im_i):
    fig, ax = plt.subplots()

    plot_ic(ax, im_i.get_ic_at_index(5), linestyle="--")

    return fig
Beispiel #11
0
def test_plot_ic_linewidth(im_i):
    fig, ax = plt.subplots()

    plot_ic(ax, im_i.get_ic_at_index(5), linewidth=2)

    return fig
Beispiel #12
0
def test_plot_ic_alpha(im_i):
    fig, ax = plt.subplots()

    plot_ic(ax, im_i.get_ic_at_index(5), alpha=0.5)

    return fig
Beispiel #13
0
def test_plot_tic_linestyle(tic):
    fig, ax = plt.subplots()

    plot_ic(ax, tic, linestyle="--")

    return fig
Beispiel #14
0
def test_plot_tic_linewidth(tic):
    fig, ax = plt.subplots()

    plot_ic(ax, tic, linewidth=2)

    return fig
Beispiel #15
0
def test_plot_tic_alpha(tic):
    fig, ax = plt.subplots()

    plot_ic(ax, tic, alpha=0.5)

    return fig
Beispiel #16
0
def test_plot_tic(tic):
    fig, ax = plt.subplots()

    plot_ic(ax, tic)

    return fig