コード例 #1
0
def box2(viewport=((0, 0), (1, 1)),
         world=None,
         title='',
         bottomlabel=None,
         leftlabel=None,
         rightlabel=None,
         toplabel=None,
         xinterval=None,
         xinteger=False,
         xstart=None,
         xsubticks=4,
         xlogarithmic=False,
         yinterval=None,
         yinteger=False,
         ystart=None,
         ysubticks=4,
         ylogarithmic=False,
         ticklength='3mm',
         labeloffset='1mm',
         page=None,
         **kwargs):
    """Creates a box, which is a container, with axes around it
	
	Arguments:
	 * viewport -- the viewport for this container, in normalized page coordinates
	 * world -- the world tuple, specifying range and domain
	 * title -- title (a string) with will be displayed at the top of the container
	 * xxx-label -- a string/label that will be placed as indicated by 'xxx'
	
	For the rest of the arguments, see 'axes'
	
	"""
    if page is None:
        _checkPage()
        page = current.page
    current.container = kaplot.objects.Box2(page,
                                            viewport=viewport,
                                            world=world,
                                            title=title,
                                            bottomlabel=bottomlabel,
                                            leftlabel=leftlabel,
                                            rightlabel=rightlabel,
                                            toplabel=toplabel,
                                            xinterval=xinterval,
                                            xinteger=xinteger,
                                            xstart=xstart,
                                            xsubticks=xsubticks,
                                            xlogarithmic=xlogarithmic,
                                            yinterval=yinterval,
                                            yinteger=yinteger,
                                            ystart=ystart,
                                            ysubticks=ysubticks,
                                            ylogarithmic=ylogarithmic,
                                            ticklength=ticklength,
                                            labeloffset=labeloffset,
                                            **kwargs)
    return current.container
コード例 #2
0
def container(viewport=((0, 0), (1, 1)), world=None, page=None, **kwargs):
    """Container holds objects which can be drawn on the page.
	
	It can also have decorators (they 'decorate' the container). Which will
	normally be drawn on the borders of the container, like 'labels' and 'axis' do.
	They shrink the viewport, resulting in an shrunk inner viewport so that your labels
	are always visible. 

	Arguments:
	 * viewport -- the viewport for this container, in normalized page coordinates
	 * world -- the world tuple, specifying range and domain
	"""
    if page is None:
        _checkPage()
        page = current.page
    current.container = kaplot.objects.Container(page,
                                                 viewport=viewport,
                                                 world=world,
                                                 **kwargs)
    return current.container