How to use the texttable.Tt function in texttable

To help you get started, we’ve selected a few texttable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CDAT / vcs / build / lib / vcs / manageElements.py View on Github external
vcs.show('texttable')
tt=vcs.createtexttable('example1',)
vcs.show('texttable')
tt=vcs.createtexttable('example2','black')
vcs.show('texttable')
tt=vcs.createtexttable(name='new',name_src='red',font=1,spacing=1,expansion=1,
              color=242, priority=1, viewport=[0, 2.0, 0, 2.0],
              worldcoordinate=[0,100, 0,50]
              x=[0,20,40,60,80,100],
              y=[0,10,20,30,40,50] )      # Create instance of texttable object 'new'
vcs.texttable(tt)                      # Plot using specified texttable object
"""

    name,source = check_name_source(name,source,'texttable')

    tt = texttable.Tt(name, source)
    try:
       if (font is not None):
          tt.font = font
       if (spacing is not None):
          tt.spacing = spacing
       if (expansion is not None):
          tt.expansion = expansion
       if (color is not None):
          tt.color = color
       if (priority is not None):
          tt.priority = priority
       if (viewport is not None):
             tt.viewport = viewport
       if (worldcoordinate is not None):
             tt.worldcoordinate = worldcoordinate
       if (x is not None):
github CDAT / vcs / vcs / manageElements.py View on Github external
:param worldcoordinate: List of 4 floats (xmin, xmax, ymin, ymax)
    :type worldcoordinate: list of floats

    :param x: List of lists of x coordinates. Values must be between worldcoordinate[0] and worldcoordinate[1].
    :type x: list of floats

    :param y: List of lists of y coordinates. Values must be between worldcoordinate[2] and worldcoordinate[3].
    :type y: list of floats

    :returns: A texttable graphics method object
    :rtype: vcs.texttable.Tt
    """

    name, source = check_name_source(name, source, 'texttable')

    tt = texttable.Tt(name, source)
    try:
        if (font is not None):
            tt.font = font
        if (spacing is not None):
            tt.spacing = spacing
        if (expansion is not None):
            tt.expansion = expansion
        if (color is not None):
            tt.color = color
        if (priority is not None):
            tt.priority = priority
        if (viewport is not None):
            tt.viewport = viewport
        if (worldcoordinate is not None):
            tt.worldcoordinate = worldcoordinate
        if (x is not None):
github CDAT / vcs / vcs / queries.py View on Github external
def istexttable(obj):
    if (isinstance(obj, texttable.Tt)):
        return 1
    else:
        return 0
istexttable.__doc__ = xmldocs.is_docs['texttable']
github CDAT / vcs / vcs / queries.py View on Github external
>>> vcs.issecondaryobject(ex)
            1

    :param obj: A VCS object
    :type obj: VCS Object

    :returns: An integer indicating whether the object is a projection graphics object (1), or not (0).
    :rtype: int
    """
    if (isinstance(sobj, line.Tl)):
        return 1
    elif (isinstance(sobj, marker.Tm)):
        return 1
    elif (isinstance(sobj, fillarea.Tf)):
        return 1
    elif (isinstance(sobj, texttable.Tt)):
        return 1
    elif (isinstance(sobj, textorientation.To)):
        return 1
    elif (isinstance(sobj, textcombined.Tc)):
        return 1
    elif (isinstance(sobj, marker.Tm)):
        return 1
    elif (isinstance(sobj, projection.Proj)):
        return 1
    elif (isinstance(sobj, vcs.colormap.Cp)):
        return 1
    else:
        return 0