marker

class vcs.marker.Tm(Tm_name, Tm_name_src='default')[source]

The Marker object allows the manipulation of marker type, size, and color index.

This class is used to define an marker table entry used in VCS, or it can be used to change some or all of the marker attributes in an existing marker table entry.

Markers are intended to be sized consistently across all plots and legends, indepenent of plot size or world coordinate range. The size attribute sets the screen size (in “deci-pixels”, see below) of the marker.

Useful Functions:
# VCS Canvas Constructor
a=vcs.init()
# Show predefined marker objects
a.show('marker')
# Updates the VCS Canvas at user's request
a.update()
a=vcs.init()
Create a new instance of marker:
# Copies content of 'red' to 'new'
mk=a.createmarker('new','red')
# Copies content of 'default' to 'new'
mk=a.createmarker('new')
Modify an existing marker:
mk=a.getmarker('red')
Overview of marker attributes:
  • List all the marker attribute values:

    mk.list()
    # Range from 1 to 256
    mk.color=100
    # Range from 1 to 300 (screen size, in "deci-pixels", i.e. marker size * 10 = size in pixels)
    mk.size=100
    
  • Specify the marker type:

    # Same as mk.type=1
    mk.type='dot'
    # Same as mk.type=2
    mk.type='plus'
    # Same as mk.type=3
    mk.type='star'
    # Same as mk.type=4
    mk.type='circle'
    # Same as mk.type=5
    mk.type='cross'
    # Same as mk.type=6
    mk.type='diamond'
    # Same as mk.type=7
    mk.type='triangle_up'
    # Same as mk.type=8
    mk.type='triangle_down'
    # Same as mk.type=9
    mk.type='triangle_left'
    # Same as mk.type=10
    mk.type='triangle_right'
    # Same as mk.type=11
    mk.type='square'
    # Same as mk.type=12
    mk.type='diamond_fill'
    # Same as mk.type=13
    mk.type='triangle_up_fill'
    # Same as mk.type=14
    mk.type='triangle_down_fill'
    # Same as mk.type=15
    mk.type='triangle_left_fill'
    # Same as mk.type=16
    mk.type='triangle_right_fill'
    # Same as mk.type=17
    mk.type='square_fill'
    
  • Set the graphics priority on the canvas

    mk.priority=1
    # FloatType [0,1]x[0,1]
    mk.viewport=[0, 1.0, 0,1.0]
    # FloatType [#,#]x[#,#]
    mk.worldcoordinate=[0,1.0,0,1.0]
    
  • Example x and y coordinates:

    # List of FloatTypes
    mk.x=[[0,.1,.2], [.3,.4,.5]]
    # List of FloatTypes
    mk.y=[[.5,.4,.3], [.2,.1,0]]
    
list()[source]

Lists the current values of object attributes

Example
>>> a=vcs.init()
>>> obj=a.getmarker() # default
>>> obj.list() # print marker attributes
---------- ... ----------
...
script(script_filename=None, mode=None)[source]

Saves out a copy of the marker secondary method, in JSON or Python format to a designated file.

Note

If the the filename has a ‘.py’ at the end, it will produce a Python script. If no extension is given, then by default a .json file containing a JSON serialization of the object’s data will be produced.

Warning

VCS Scripts Deprecated. SCR script files are no longer generated by this function.

Example
>>> a=vcs.init()
>>> ex=a.getmarker()
>>> ex.script('filename.py') # append to 'filename.py'
>>> ex.script('filename','w') # make/overwrite 'filename.json'
Parameters
  • script_filename (str) – Output name of the script file. If no extension is specified, a .json object is created.

  • mode (str) – Either ‘w’ for replace, or ‘a’ for append. Defaults to ‘a’, if not specified.