Ejemplo n.º 1
0
    def __setup_plot(self):
        gs = GridSpec(1, 2, width_ratios=[9.5, 0.5])
        self.axes = self.figure.add_subplot(gs[0], projection='3d')

        numformatter = ScalarFormatter(useOffset=False)
        timeFormatter = DateFormatter("%H:%M:%S")

        self.axes.set_xlabel("Frequency (MHz)")
        self.axes.set_ylabel('Time')
        self.axes.set_zlabel('Level ($\mathsf{dB/\sqrt{Hz}}$)')
        colour = hex2color(self.settings.background)
        colour += (1,)
        self.axes.w_xaxis.set_pane_color(colour)
        self.axes.w_yaxis.set_pane_color(colour)
        self.axes.w_zaxis.set_pane_color(colour)
        self.axes.xaxis.set_major_formatter(numformatter)
        self.axes.yaxis.set_major_formatter(timeFormatter)
        self.axes.zaxis.set_major_formatter(numformatter)
        self.axes.xaxis.set_minor_locator(AutoMinorLocator(10))
        self.axes.yaxis.set_minor_locator(AutoMinorLocator(10))
        self.axes.zaxis.set_minor_locator(AutoMinorLocator(10))
        self.axes.set_xlim(self.settings.start, self.settings.stop)
        now = time.time()
        self.axes.set_ylim(epoch_to_mpl(now), epoch_to_mpl(now - 10))
        self.axes.set_zlim(-50, 0)

        self.bar = self.figure.add_subplot(gs[1])
        norm = Normalize(vmin=-50, vmax=0)
        self.barBase = ColorbarBase(self.bar, norm=norm,
                                    cmap=cm.get_cmap(self.settings.colourMap))
Ejemplo n.º 2
0
    def setup_plot(self):
        gs = GridSpec(1, 2, width_ratios=[9.5, 0.5])
        self.axes = self.figure.add_subplot(gs[0],
                                            axisbg=self.settings.background)

        self.axes.set_xlabel("Frequency (MHz)")
        self.axes.set_ylabel('Time')
        numFormatter = ScalarFormatter(useOffset=False)
        timeFormatter = DateFormatter("%H:%M:%S")

        self.axes.xaxis.set_major_formatter(numFormatter)
        self.axes.yaxis.set_major_formatter(timeFormatter)
        self.axes.xaxis.set_minor_locator(AutoMinorLocator(10))
        self.axes.yaxis.set_minor_locator(AutoMinorLocator(10))
        self.axes.set_xlim(self.settings.start, self.settings.stop)
        now = time.time()
        self.axes.set_ylim(epoch_to_mpl(now), epoch_to_mpl(now - 10))

        self.bar = self.figure.add_subplot(gs[1])
        norm = Normalize(vmin=-50, vmax=0)
        self.barBase = ColorbarBase(self.bar, norm=norm,
                                    cmap=cm.get_cmap(self.settings.colourMap))
        self.barBase.set_label('Level (dB)')

        self.setup_measure()
Ejemplo n.º 3
0
    def annotate_plot(self):

        self.clear_markers()
        fMax, lMax, tMax = self.extent.get_peak_flt()
        y = epoch_to_mpl(tMax)

        start, stop = self.axes.get_xlim()
        textX = ((stop - start) / 50.0) + fMax
        when = format_time(fMax)

        if(matplotlib.__version__ < '1.3'):
            self.axes.annotate('{0:.6f}MHz\n{1:.2f}dB\n{2}'.format(fMax,
                                                                   lMax,
                                                                   when),
                               xy=(fMax, y), xytext=(textX, y),
                               ha='left', va='bottom', size='small',
                               color='w', gid='peak')
            self.axes.plot(fMax, y, marker='x', markersize=10, color='w',
                           mew=3, gid='peak')
            self.axes.plot(fMax, y, marker='x', markersize=10, color='r',
                           gid='peak')
        else:
            effect = patheffects.withStroke(linewidth=3, foreground="w",
                                            alpha=0.75)
            self.axes.annotate('{0:.6f}MHz\n{1:.2f}dB\n{2}'.format(fMax,
                                                                   lMax,
                                                                   when),
                               xy=(fMax, y), xytext=(textX, y),
                               ha='left', va='bottom', size='small',
                               path_effects=[effect], gid='peak')
            self.axes.plot(fMax, y, marker='x', markersize=10, color='r',
                           path_effects=[effect], gid='peak')
Ejemplo n.º 4
0
    def __annotate_plot(self):
        self.__clear_markers()
        fMax, lMax, tMax = self.extent.get_peak_flt()
        y = epoch_to_mpl(tMax)

        start, stop = self.axes.get_xlim()
        textX = ((stop - start) / 50.0) + fMax
        when = format_time(tMax)

        text = "{0:.6f} MHz\n{1:.2f} $\mathsf{{dB/\sqrt{{Hz}}}}$\n{2}".format(fMax, lMax, when)
        if matplotlib.__version__ < "1.3":
            self.axes.annotate(
                text, xy=(fMax, y), xytext=(textX, y), ha="left", va="bottom", size="x-small", color="w", gid="peak"
            )
            self.axes.plot(fMax, y, marker="x", markersize=10, color="w", mew=3, gid="peak")
            self.axes.plot(fMax, y, marker="x", markersize=10, color="r", gid="peak")
        else:
            effect = patheffects.withStroke(linewidth=2, foreground="w", alpha=0.75)
            self.axes.annotate(
                text,
                xy=(fMax, y),
                xytext=(textX, y),
                ha="left",
                va="bottom",
                size="x-small",
                path_effects=[effect],
                gid="peak",
            )
            self.axes.plot(fMax, y, marker="x", markersize=10, color="r", path_effects=[effect], gid="peak")
Ejemplo n.º 5
0
 def annotate_plot(self):
     f, l, t = self.extent.get_peak_flt()
     when = format_time(t)
     tPos = epoch_to_mpl(t)
     if(matplotlib.__version__ < '1.3'):
         self.axes.text(f, tPos, l,
                        '{0:.6f}MHz\n{1:.2f}dB\n{2}'.format(f, l, when),
                        ha='left', va='bottom', size='small', gid='peak')
         self.axes.plot([f], [tPos], [l], marker='x', markersize=10,
                        mew=3, color='w', gid='peak')
         self.axes.plot([f], [tPos], [l], marker='x', markersize=10,
                        color='r', gid='peak')
     else:
         effect = patheffects.withStroke(linewidth=3, foreground="w",
                                         alpha=0.75)
         self.axes.text(f, tPos, l,
                        '{0:.6f}MHz\n{1:.2f}dB\n{2}'.format(f, l, when),
                        ha='left', va='bottom', size='small', gid='peak',
                        path_effects=[effect])
         self.axes.plot([f], [tPos], [l], marker='x', markersize=10,
                        color='r', gid='peak', path_effects=[effect])