Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block sixtenbe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
sixtenbe /
Created Sep 4, 2011
plotting in wxPython
import wx
import matplotlib
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wx import NavigationToolbar2Wx
from matplotlib.figure import Figure
from matplotlib.ticker import ScalarFormatter, LogFormatter
from os import path, remove
from numpy import linspace
from math import pi, sqrt, sin
#Heavyside step function
H = lambda t: 1 if t > 0 else 0
# pure sine
ACV_A1 = lambda T, Hz = 50: 1000 * sqrt(2) * np.sin(2*pi*Hz * T)
ACV_A2 = lambda T, Hz = 50: 1000 * sqrt(2) * np.sin(2*pi*Hz * T) + 500
sixtenbe /
Created Sep 1, 2011
WXpython excepthook
import wx
import sys
import traceback
class Mainframe(wx.Frame):
def __init__(self, parent, id = wx.ID_DEFAULT, title = "The title", **kwargs):
sys.excepthook = self.excepthook
super(Mainframe, self).__init__(parent, id, title, *args, **kwargs)
#wx graphics code here
sixtenbe /
Last active Jan 22, 2020 — forked from endolith/peakdet.m
Peak detection in Python
# Copyright (C) 2016 Sixten Bergman
# License WTFPL
# This program is free software. It comes without any warranty, to the extent
# permitted by applicable law.
# You can redistribute it and/or modify it under the terms of the Do What The
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See
You can’t perform that action at this time.