Exemple #1
0
def plot_afstelling_pmt():
    """Plot voor afstellen spanning"""

    multiplot = MultiPlot(1, 3, width=r'0.4\linewidth')

    x = pylab.linspace(1e-10, 11, 200)

    signal = pylab.zeros(x.shape)

    for N in range(1, 15):
        scale = 100. / N ** 3
        pdf = 80 * scale * pylab.normpdf(x, N, pylab.sqrt(N) * 0.35)
        signal += pdf

    gammas = 1e2 * x ** -3
    signal += gammas

    p = multiplot.get_subplot_at(0, 0)
    v = x * 35
    p.plot(v, pylab.where(v >= 30, signal, 1), mark=None)
    p.draw_vertical_line(200, linestyle='gray')
    p.set_label(r"$V_\mathrm{PMT}$ te laag")

    p = multiplot.get_subplot_at(0, 1)
    v = x * 200
    p.plot(v, pylab.where(v >= 30, signal, 1), mark=None)
    p.draw_vertical_line(200, linestyle='gray')
    p.set_label(r"$V_\mathrm{PMT}$ correct")

    p = multiplot.get_subplot_at(0, 2)
    v = x * 400
    p.plot(v, pylab.where(v >= 30, signal, 1), mark=None)
    p.draw_vertical_line(200, linestyle='gray')
    p.set_label(r"$V_\mathrm{PMT}$ te hoog")

    multiplot.set_xlabel(r"Pulseheight [\si{\milli\volt}]")
    multiplot.set_ylabel("Counts")
    multiplot.set_xlimits_for_all(min=0, max=1000)
    multiplot.set_ylimits_for_all(min=1)
    multiplot.show_xticklabels_for_all()
    multiplot.set_xticklabels_position(0, 1, 'top')
    multiplot.set_yticks_for_all(ticks=None)
    multiplot.save('afstelling_pmt')
Exemple #2
0
def multiplot():
    # data series
    x = [0, 40, 60, 69, 80, 90, 100]
    y = [0, 0, 0.5, 2.96, 2, 1, .5]

    multiplot = MultiPlot(1, 2)

    # make graph
    graph1 = multiplot.get_subplot_at(0, 0)
    graph2 = multiplot.get_subplot_at(0, 1)

    # make Plot
    graph1.plot(x, y, mark=None, linestyle='smooth,very thick')
    graph2.plot(x, y, mark=None, linestyle='smooth,very thick')

    multiplot.show_xticklabels_for_all()
    multiplot.show_yticklabels(0, 0)
    multiplot.set_xticklabels_position(0, 1, 'top')
    multiplot.set_yticks_for_all(ticks=range(6))

    graph1.set_xlimits(0, 100)
    graph2.set_xlimits(60, 80)
    multiplot.set_ylimits_for_all(min=0, max=5)

    # set scale: 1cm equals 10 or 5 units along the x-axis
    graph1.set_xscale(cm=10)
    graph2.set_xscale(cm=5)
    # set scale: 1cm equals 1 unit along the y-axis
    graph1.set_yscale(cm=1)
    graph2.set_yscale(cm=1)

    # set graph paper
    graph1.use_graph_paper()
    graph2.use_graph_paper()

    # set labels
    multiplot.set_xlabel(r"$f [\si{\mega\hertz}]$")
    multiplot.set_ylabel("signal strength")

    # save graph to file
    multiplot.save('mm_paper_multiplot')
Exemple #3
0
# Plot voor afstellen spanning
multiplot = MultiPlot(1, 3, width=r'.4\linewidth')

p = multiplot.get_subplot_at(0, 1)
V = x * 200
p.plot(V, where(V >= 30, signal, 1), mark=None)
p.draw_vertical_line(200, linestyle='gray')
p.set_label(r"$V_\mathrm{PMT}$ correct")

p = multiplot.get_subplot_at(0, 2)
V = x * 400
p.plot(V, where(V >= 30, signal, 1), mark=None)
p.draw_vertical_line(200, linestyle='gray')
p.set_label(r"$V_\mathrm{PMT}$ te hoog")

p = multiplot.get_subplot_at(0, 0)
V = x * 35
p.plot(V, where(V >= 30, signal, 1), mark=None)
p.draw_vertical_line(200, linestyle='gray')
p.set_label(r"$V_\mathrm{PMT}$ te laag")

multiplot.set_xlabel(r"Pulseheight [\si{\milli\volt}]")
multiplot.set_ylabel("Counts")
multiplot.set_xlimits_for_all(min=0, max=1000)
multiplot.set_ylimits_for_all(min=1)
multiplot.show_xticklabels_for_all()
multiplot.set_xticklabels_position(0, 1, 'top')
multiplot.set_yticks_for_all(ticks=None)
multiplot.save('afstelling_pmt')