def addCategory(self,name,nmin=0,n=0,nmax=100):
        """
        Adds a category with the given name.
        
        If the category already exists, a :py:exc:`KeyError` will be thrown. Use
        :py:meth:`updateCategory()` instead if you want to update a category.
        """
        assert isinstance(name,basestring) # py2 compat is done at the top
        if name in self.categories:
            raise KeyError("Category with name '%s' already exists"%name)
        self.categories[name]=[nmin,n,nmax]
        self.redraw()
Adds a category with the given name.
        
        If the category already exists, a :py:exc:`KeyError` will be thrown. Use
        :py:meth:`updateCategory()` instead if you want to update a category.