manageElements¶
-
vcs.manageElements.
check_name_source
(name, source, typ)[source]¶ Make sure it is a unique name for this type or generates a name for user.
- Example
>>> cns=vcs.check_name_source # alias for long function name >>> vcs.show('boxfill') *******************Boxfill Names List********************** ... *******************End Boxfill Names List********************** >>> cns('NEW', 'quick', 'boxfill') # name 'NEW' should be available ('NEW', 'quick') >>> cns(None, 'default', 'boxfill') # generate unique boxfill name ('__boxfill_...', 'default')
- Parameters
name (str or None) – Desired string name for an object of type typ, inheriting from source object source. If name is None, a unique name will be generated.
source (str or VCS Object) – Source from which the new object is meant to inherit. Can be a VCS object or a string name of a VCS object.
typ (str) – String name of a VCS object type. (e.g. ‘boxfill’, ‘isofill’, ‘marker’, etc.)
- Returns
A tuple containing two strings: a unique name and a source name. If name was provided and an object of type typ with that name already exists, an error is raised.
- Return type
-
vcs.manageElements.
copyfontto
(font1, font2)[source]¶ Copy ‘font1’ into ‘font2’.
- Parameters
Attention
This function does not currently work. It will be added in the future.
-
vcs.manageElements.
create1d
(name=None, source='default')[source]¶ Creates a new
vcs.unified1d.G1d
object called name, and inheriting from source.- Example
>>> vcs.show('1d') *******************1d Names List********************** ... *******************End 1d Names List********************** >>> vcs.create1d() # inherits default, name generated <vcs.unified1D.G1d ...> >>> vcs.create1d("one_D") # inherits default, name "one_D" <vcs.unified1D.G1d ...> >>> vcs.create1d(source="one_D") # inherits from "one_D" <vcs.unified1D.G1d ...>
- Parameters
name (str) – A string name for the 1d to be created. If None, a unique name will be created.
source (str or
vcs.unified1D.G1d
) – A 1d object or string name of a 1d object from which the new 1d will inherit.
- Returns
A new 1d object, inheriting from source.
- Return type
-
vcs.manageElements.
create3d_dual_scalar
(name=None, source='default')[source]¶ Create a new dv3d graphics method given the the name and the existing dv3d graphics method to copy attributes from. If no existing dv3d graphics method is given, the default dv3d graphics method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. graphics method names must be unique.
- Example
>>> vcs.listelements('3d_dual_scalar') # list 3d_dual_scalars [...] >>> ex=vcs.create3d_dual_scalar('3d_dual_scalar_ex1') >>> vcs.listelements('3d_dual_scalar') # includes new object [...'3d_dual_scalar_ex1'...]
- Parameters
name (str) – The name of the created object
source (str or
vcs.dv3d.Gf3DDualScalar
) – The object to inherit from. Can be a 3d_dual_scalar, or a string name of a 3d_dual_scalar.
- Returns
A 3d_dual_scalar graphics method object
- Return type
-
vcs.manageElements.
create3d_scalar
(name=None, source='default')[source]¶ Create a new dv3d graphics method given the the name and the existing dv3d graphics method to copy attributes from. If no existing dv3d graphics method is given, the default dv3d graphics method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. graphics method names must be unique.
- Example
>>> vcs.listelements('3d_scalar') # list 3d_scalars [...] >>> ex=vcs.create3d_scalar('3d_scalar_ex1') >>> vcs.listelements('3d_scalar') # includes new object [...'3d_scalar_ex1'...]
- Parameters
name (str) – The name of the created object
source (str or
vcs.dv3d.Gf3Dscalar
) – The object to inherit from. Can be a 3d_scalar, or a string name of a 3d_scalar.
- Returns
A 3d_scalar graphics method object
- Return type
-
vcs.manageElements.
create3d_vector
(name=None, source='default')[source]¶ Create a new dv3d graphics method given the the name and the existing dv3d graphics method to copy attributes from. If no existing dv3d graphics method is given, the default dv3d graphics method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. graphics method names must be unique.
- Example
>>> vcs.listelements('3d_vector') # list 3d_vectors [...] >>> ex=vcs.create3d_vector('3d_vector_ex1') >>> vcs.listelements('3d_vector') # includes new object [...'3d_vector_ex1'...]
- Parameters
name (str) – The name of the created object
source (str or
vcs.dv3d.Gf3Dvector
) – The object to inherit from. Can be a 3d_vector, or a string name of a 3d_vector.
- Returns
A 3d_vector graphics method object
- Return type
-
vcs.manageElements.
createboxfill
(name=None, source='default')[source]¶ Create a new boxfill graphics method given the the name and the existing boxfill graphics method to copy attributes from. If no existing boxfill graphics method is given, the default boxfill graphics method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. graphics method names must be unique.
- Example
>>> vcs.listelements('boxfill') # list boxfills [...] >>> ex=vcs.createboxfill('boxfill_ex1') >>> vcs.listelements('boxfill') # includes new object [...'boxfill_ex1'...] >>> ex2=vcs.createboxfill('boxfill_ex2','polar') >>> vcs.listelements('boxfill') # includes new object [...'boxfill_ex2'...]
- Parameters
name (str) – The name of the created object
source (str or
vcs.boxfill.Gfb
) – The object to inherit from. can be a boxfill, or a string name of a boxfill.
- Returns
A boxfill graphics method object
- Return type
-
vcs.manageElements.
createcolormap
(Cp_name=None, Cp_name_src='default')[source]¶ Create a new colormap secondary method given the the name and the existing colormap secondary method to copy attributes from. If no existing colormap secondary method is given, the default colormap secondary method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. secondary method names must be unique.
- Example
>>> vcs.listelements('colormap') # list colormaps [...] >>> ex=vcs.createcolormap('colormap_ex1') >>> vcs.listelements('colormap') # includes new object [...'colormap_ex1'...] >>> ex2=vcs.createcolormap('colormap_ex2','rainbow') >>> vcs.listelements('colormap') # includes new object [...'colormap_ex2'...]
- Parameters
Cp_name (str) – The name of the created object
Cp_name_src (str or
vcs.colormap.Cp
) – The object to inherit from. Can be a colormap or a string name of a colormap.
- Returns
A VCS colormap object
- Return type
-
vcs.manageElements.
createfillarea
(name=None, source='default', style=None, index=None, color=None, priority=None, viewport=None, worldcoordinate=None, x=None, y=None)[source]¶ Create a new fillarea secondary method given the the name and the existing fillarea secondary method to copy attributes from. If no existing fillarea secondary method is given, the default fillarea secondary method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. secondary method names must be unique.
- Example
>>> vcs.listelements('fillarea') # list fillareas [...] >>> ex=vcs.createfillarea('fillarea_ex1') >>> vcs.listelements('fillarea') # includes new object [...'fillarea_ex1'...]
- Parameters
name (str) – Name of created object
source (str) – a fillarea, or string name of a fillarea
style (str) – One of “hatch”, “solid”, or “pattern”.
index (int) – Specifies which pattern to fill with. Accepts ints from 1-20.
color (str or int) – A color name from the X11 Color Names list, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))
priority (int) – The layer on which the fillarea will be drawn.
viewport (list) – 4 floats between 0 and 1 which specify the area that X/Y values are mapped to inside of the canvas.
worldcoordinate (list) – List of 4 floats (xmin, xmax, ymin, ymax)
x (list) – List of lists of x coordinates. Values must be between worldcoordinate[0] and worldcoordinate[1].
y (list) – List of lists of y coordinates. Values must be between worldcoordinate[2] and worldcoordinate[3].
- Returns
A fillarea object
- Return type
-
vcs.manageElements.
createisofill
(name=None, source='default')[source]¶ Create a new isofill graphics method given the the name and the existing isofill graphics method to copy attributes from. If no existing isofill graphics method is given, the default isofill graphics method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. graphics method names must be unique.
- Example
>>> vcs.listelements('isofill') # list isofills [...] >>> ex=vcs.createisofill('isofill_ex1') >>> vcs.listelements('isofill') # includes new object [...'isofill_ex1'...] >>> ex2=vcs.createisofill('isofill_ex2','polar') >>> vcs.listelements('isofill') # includes new object [...'isofill_ex2'...]
- Parameters
name (str) – The name of the created object
source (str or
vcs.isofill.Gfi
) – The object to inherit from. Can be an isofill object, or string name of an isofill object.
- Returns
An isofill graphics method
- Return type
-
vcs.manageElements.
createisoline
(name=None, source='default')[source]¶ Create a new isoline graphics method given the the name and the existing isoline graphics method to copy attributes from. If no existing isoline graphics method is given, the default isoline graphics method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. graphics method names must be unique.
- Example
>>> vcs.listelements('isoline') # list isolines [...] >>> ex=vcs.createisoline('isoline_ex1') >>> vcs.listelements('isoline') # includes new object [...'isoline_ex1'...] >>> ex2=vcs.createisoline('isoline_ex2','polar') >>> vcs.listelements('isoline') # includes new object [...'isoline_ex2'...]
- Parameters
name (str) – The name of the created object
source (str or
vcs.isoline.Gi
) – The object to inherit from. Can be an isoline object, or string name of an isoline object.
- Returns
An isoline graphics method object
- Return type
-
vcs.manageElements.
createline
(name=None, source='default', ltype=None, width=None, color=None, priority=None, viewport=None, worldcoordinate=None, x=None, y=None, projection=None)[source]¶ Create a new line secondary method given the the name and the existing line secondary method to copy attributes from. If no existing line secondary method is given, the default line secondary method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. secondary method names must be unique.
- Example
>>> vcs.listelements('line') # list lines [...] >>> ex=vcs.createline('line_ex1') >>> vcs.listelements('line') # includes new object [...'line_ex1'...] >>> ex2=vcs.createline('line_ex2','red') >>> vcs.listelements('line') # includes new object [...'line_ex2'...]
- Parameters
name (str) – Name of created object
source (str) – a line, or string name of a line
ltype (str) – One of “dash”, “dash-dot”, “solid”, “dot”, or “long-dash”.
width (int) – Thickness of the line to be created
A color name from the X11 Color Names list, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))
priority (int) – The layer on which the line will be drawn.
viewport (list) – 4 floats between 0 and 1 which specify the area that X/Y values are mapped to inside of the canvas.
worldcoordinate (list) – List of 4 floats (xmin, xmax, ymin, ymax)
x (list) – List of lists of x coordinates. Values must be between worldcoordinate[0] and worldcoordinate[1].
y (list) – List of lists of y coordinates. Values must be between worldcoordinate[2] and worldcoordinate[3].
projection (str or projection object) – Specify a geographic projection used to convert x/y from spherical coordinates to 2D coordinates.
- Returns
A VCS line secondary method object
- Return type
-
vcs.manageElements.
createmarker
(name=None, source='default', mtype=None, size=None, color=None, priority=None, viewport=None, worldcoordinate=None, x=None, y=None, projection=None)[source]¶ Create a new marker secondary method given the the name and the existing marker secondary method to copy attributes from. If no existing marker secondary method is given, the default marker secondary method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. secondary method names must be unique.
- Example
>>> vcs.listelements('marker') # list markers [...] >>> ex=vcs.createmarker('marker_ex1') >>> vcs.listelements('marker') # includes new object [...'marker_ex1'...] >>> ex2=vcs.createmarker('marker_ex2','red') >>> vcs.listelements('marker') # includes new object [...'marker_ex2'...]
- Parameters
name (str) – Name of created object
source (str) – A marker, or string name of a marker
mtype (str) – Specifies the type of marker, i.e. “dot”, “circle”
size (int) –
color (str or int) –
A color name from the X11 Color Names list, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))
priority (int) – The layer on which the marker will be drawn.
viewport (list) – 4 floats between 0 and 1 which specify the area that X/Y values are mapped to inside of the canvas.
worldcoordinate (list) – List of 4 floats (xmin, xmax, ymin, ymax)
x (list) – List of lists of x coordinates. Values must be between worldcoordinate[0] and worldcoordinate[1].
y (list) – List of lists of y coordinates. Values must be between worldcoordinate[2] and worldcoordinate[3].
- Returns
A secondary marker method
- Return type
-
vcs.manageElements.
createmeshfill
(name=None, source='default')[source]¶ Create a new meshfill graphics method given the the name and the existing meshfill graphics method to copy attributes from. If no existing meshfill graphics method is given, the default meshfill graphics method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. graphics method names must be unique.
- Example
>>> vcs.listelements('meshfill') # list meshfills [...] >>> ex=vcs.createmeshfill('meshfill_ex1') >>> vcs.listelements('meshfill') # includes new object [...'meshfill_ex1'...] >>> ex2=vcs.createmeshfill('meshfill_ex2','a_polar_meshfill') >>> vcs.listelements('meshfill') # includes new object [...'meshfill_ex2'...]
- Parameters
name (str) – The name of the created object
source (str or
vcs.meshfill.Gfm
) – The object to inherit from. Can be a meshfill, or a string name of a meshfill.
- Returns
A meshfill graphics method object
- Return type
-
vcs.manageElements.
createprojection
(name=None, source='default')[source]¶ Create a new projection graphics method given the the name and the existing projection graphics method to copy attributes from. If no existing projection graphics method is given, the default projection graphics method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. graphics method names must be unique.
- Example
>>> vcs.listelements('projection') # list projections [...] >>> ex=vcs.createprojection('projection_ex1') >>> vcs.listelements('projection') # includes new object [...'projection_ex1'...] >>> ex2=vcs.createprojection('projection_ex2','orthographic') >>> vcs.listelements('projection') # includes new object [...'projection_ex2'...]
- Parameters
name (str) – The name of the created object
source (str or
vcs.projection.Proj
) – The object to inherit from. Can be a projection, or a string name of a projection.
- Returns
A projection graphics method object
- Return type
-
vcs.manageElements.
createscatter
(name=None, source='default')[source]¶ Create a new scatter graphics method given the the name and the existing scatter graphics method to copy attributes from. If no existing scatter graphics method is given, the default scatter graphics method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. graphics method names must be unique.
- Example
>>> vcs.listelements('scatter') # list scatters [...] >>> ex=vcs.createscatter('scatter_ex1') >>> vcs.listelements('scatter') # includes new object [...'scatter_ex1'...]
- Parameters
name (str) – The name of the created object
source (str or
vcs.unified1D.G1d
) – The object to inherit from. Can be a scatter or, a string name of a scatter.
- Returns
A scatter graphics method
- Return type
-
vcs.manageElements.
createstreamline
(name=None, source='default')[source]¶ Create a new streamline graphics method given the the name and the existing streamline graphics method to copy attributes from. If no existing streamline graphics method is given, the default streamline graphics method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. graphics method names must be unique.
- Example
>>> vcs.listelements('streamline') # list streamlines [...] >>> ex=vcs.createstreamline('streamline_ex1') >>> vcs.listelements('streamline') # includes new object [...'streamline_ex1'...]
- Parameters
name (str) – The name of the created object
source (a streamline or a string name of a streamline) – The object to inherit from
- Returns
A streamline graphics method object
- Return type
-
vcs.manageElements.
createtaylordiagram
(name=None, source='default')[source]¶ Create a new taylordiagram graphics method given the the name and the existing taylordiagram graphics method to copy attributes from. If no existing taylordiagram graphics method is given, the default taylordiagram graphics method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. graphics method names must be unique.
- Example
>>> vcs.listelements('taylordiagram') # list taylordiagrams [...] >>> ex=vcs.createtaylordiagram('taylordiagram_ex1') >>> vcs.listelements('taylordiagram') # includes new object [...'taylordiagram_ex1'...]
- Parameters
name (str) – The name of the created object
source (str or
vcs.taylor.Gtd
) – The object to inherit from. Can be a a taylordiagram, or a string name of a taylordiagram.
- Returns
A taylordiagram graphics method object
- Return type
-
vcs.manageElements.
createtemplate
(name=None, source='default')[source]¶ Create a new template graphics method given the the name and the existing template graphics method to copy attributes from. If no existing template graphics method is given, the default template graphics method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. graphics method names must be unique.
- Example
>>> vcs.listelements('template') # list templates [...] >>> ex=vcs.createtemplate('template_ex1') >>> vcs.listelements('template') # includes new object [...'template_ex1'...] >>> ex2=vcs.createtemplate('template_ex2','polar') >>> vcs.listelements('template') # includes new object [...'template_ex2'...]
- Parameters
name (str) – The name of the created object
source (str or
vcs.template.P
) – The object to inherit from. Can be a template, or a string name of a template
- Returns
A template
- Return type
-
vcs.manageElements.
createtext
(Tt_name=None, Tt_source='default', To_name=None, To_source='default', font=None, spacing=None, expansion=None, color=None, priority=None, viewport=None, worldcoordinate=None, x=None, y=None, height=None, angle=None, path=None, halign=None, valign=None, projection=None)¶ Create a new textcombined secondary method given the the name and the existing textcombined secondary method to copy attributes from. If no existing textcombined secondary method is given, the default textcombined secondary method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. secondary method names must be unique.
- Example
>>> vcs.listelements('textcombined') # list textcombineds [...] >>> try: # try to create a new textcombined, in case none exist ... tc = vcs.createtextcombined('EX_tt', 'qa', 'EX_tto', '7left') ... except: ... pass >>> vcs.listelements('textcombined') # includes new object [...'EX_tt:::EX_tto'...]
- Parameters
Tt_name (str) – Name of created object
Tt_source (str or
vcs.texttable.Tt
) – Texttable object to inherit from. Can be a texttable, or a string name of a texttable.To_name (str) – Name of the textcombined’s text orientation (to be created)
To_source (str or
vcs.textorientation.To
) – Name of the textorientation to inherit. Can be a textorientation, or a string name of a textorientation.color (str or int) –
A color name from the X11 Color Names list, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))
priority (int) – The layer on which the object will be drawn.
viewport (list) – 4 floats between 0 and 1 which specify the area that X/Y values are mapped to inside of the canvas.
worldcoordinate (list) – List of 4 floats (xmin, xmax, ymin, ymax)
x (list) – List of lists of x coordinates. Values must be between worldcoordinate[0] and worldcoordinate[1].
y (list) – List of lists of y coordinates. Values must be between worldcoordinate[2] and worldcoordinate[3].
height (int) – Size of the font
angle (int) – Angle of the text, in degrees
halign (str) – Horizontal alignment of the text. One of [“left”, “center”, “right”].
valign (str) – Vertical alignment of the text. One of [“top”, “center”, “botom”].
projection (str or projection object) – Specify a geographic projection used to convert x/y from spherical coordinates to 2D coordinates.
- Returns
A VCS text object
- Return type
Note
The spacing, path, and expansion parameters are no longer used
-
vcs.manageElements.
createtextcombined
(Tt_name=None, Tt_source='default', To_name=None, To_source='default', font=None, spacing=None, expansion=None, color=None, priority=None, viewport=None, worldcoordinate=None, x=None, y=None, height=None, angle=None, path=None, halign=None, valign=None, projection=None)[source]¶ Create a new textcombined secondary method given the the name and the existing textcombined secondary method to copy attributes from. If no existing textcombined secondary method is given, the default textcombined secondary method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. secondary method names must be unique.
- Example
>>> vcs.listelements('textcombined') # list textcombineds [...] >>> try: # try to create a new textcombined, in case none exist ... tc = vcs.createtextcombined('EX_tt', 'qa', 'EX_tto', '7left') ... except: ... pass >>> vcs.listelements('textcombined') # includes new object [...'EX_tt:::EX_tto'...]
- Parameters
Tt_name (str) – Name of created object
Tt_source (str or
vcs.texttable.Tt
) – Texttable object to inherit from. Can be a texttable, or a string name of a texttable.To_name (str) – Name of the textcombined’s text orientation (to be created)
To_source (str or
vcs.textorientation.To
) – Name of the textorientation to inherit. Can be a textorientation, or a string name of a textorientation.color (str or int) –
A color name from the X11 Color Names list, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))
priority (int) – The layer on which the object will be drawn.
viewport (list) – 4 floats between 0 and 1 which specify the area that X/Y values are mapped to inside of the canvas.
worldcoordinate (list) – List of 4 floats (xmin, xmax, ymin, ymax)
x (list) – List of lists of x coordinates. Values must be between worldcoordinate[0] and worldcoordinate[1].
y (list) – List of lists of y coordinates. Values must be between worldcoordinate[2] and worldcoordinate[3].
height (int) – Size of the font
angle (int) – Angle of the text, in degrees
halign (str) – Horizontal alignment of the text. One of [“left”, “center”, “right”].
valign (str) – Vertical alignment of the text. One of [“top”, “center”, “botom”].
projection (str or projection object) – Specify a geographic projection used to convert x/y from spherical coordinates to 2D coordinates.
- Returns
A VCS text object
- Return type
Note
The spacing, path, and expansion parameters are no longer used
-
vcs.manageElements.
createtextorientation
(name=None, source='default')[source]¶ Create a new textorientation secondary method given the the name and the existing textorientation secondary method to copy attributes from. If no existing textorientation secondary method is given, the default textorientation secondary method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. secondary method names must be unique.
- Example
>>> vcs.listelements('textorientation') # list textorientations [...] >>> ex=vcs.createtextorientation('textorientation_ex1') >>> vcs.listelements('textorientation') # includes new object [...'textorientation_ex1'...] >>> ex2=vcs.createtextorientation('textorientation_ex2','bigger') >>> vcs.listelements('textorientation') # includes new object [...'textorientation_ex2'...]
- Parameters
name (str) – The name of the created object
source (str or
vcs.textorientation.To
) – The object to inherit from. Can be a textorientation, or a string name of a textorientation.
- Returns
A textorientation secondary method
- Return type
-
vcs.manageElements.
createtexttable
(name=None, source='default', font=None, spacing=None, expansion=None, color=None, priority=None, viewport=None, worldcoordinate=None, x=None, y=None)[source]¶ Create a new texttable secondary method given the the name and the existing texttable secondary method to copy attributes from. If no existing texttable secondary method is given, the default texttable secondary method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. secondary method names must be unique.
- Example
>>> vcs.listelements('texttable') # list texttables [...] >>> ex=vcs.createtexttable('texttable_ex1') >>> vcs.listelements('texttable') # includes new object [...'texttable_ex1'...] >>> ex2=vcs.createtexttable('texttable_ex2','bigger') >>> vcs.listelements('texttable') # includes new object [...'texttable_ex2'...]
- Parameters
name (str) – Name of created object
source (str) – a texttable, or string name of a texttable
color (str or int) –
A color name from the X11 Color Names list, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))
priority (int) – The layer on which the texttable will be drawn.
viewport (list) – 4 floats between 0 and 1 which specify the area that X/Y values are mapped to inside of the canvas.
worldcoordinate (list) – List of 4 floats (xmin, xmax, ymin, ymax)
x (list) – List of lists of x coordinates. Values must be between worldcoordinate[0] and worldcoordinate[1].
y (list) – List of lists of y coordinates. Values must be between worldcoordinate[2] and worldcoordinate[3].
- Returns
A texttable graphics method object
- Return type
Note
The expansion parameter is no longer used
-
vcs.manageElements.
createvector
(name=None, source='default')[source]¶ Create a new vector graphics method given the the name and the existing vector graphics method to copy attributes from. If no existing vector graphics method is given, the default vector graphics method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. graphics method names must be unique.
- Example
>>> vcs.listelements('vector') # list vectors [...] >>> ex=vcs.createvector('vector_ex1') >>> vcs.listelements('vector') # includes new object [...'vector_ex1'...]
- Parameters
name (str) – The name of the created object
source (str or
vcs.vector.Gv
) – The object to inherit from. Can be a vector, or a string name of a vector.
- Returns
A vector graphics method object
- Return type
-
vcs.manageElements.
createxvsy
(name=None, source='default')[source]¶ Create a new xvsy graphics method given the the name and the existing xvsy graphics method to copy attributes from. If no existing xvsy graphics method is given, the default xvsy graphics method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. graphics method names must be unique.
- Example
>>> vcs.listelements('xvsy') # list xvsys [...] >>> ex=vcs.createxvsy('xvsy_ex1') >>> vcs.listelements('xvsy') # includes new object [...'xvsy_ex1'...]
- Parameters
name (str) – The name of the created object
source (str or
vcs.unified1D.G1d
) – The object to inherit from. Can be a xvsy, or a string name of a xvsy.
- Returns
A XvsY graphics method object
- Return type
-
vcs.manageElements.
createxyvsy
(name=None, source='default')[source]¶ Create a new xyvsy graphics method given the the name and the existing xyvsy graphics method to copy attributes from. If no existing xyvsy graphics method is given, the default xyvsy graphics method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. graphics method names must be unique.
- Example
>>> vcs.listelements('xyvsy') # list xyvsys [...] >>> ex=vcs.createxyvsy('xyvsy_ex1') >>> vcs.listelements('xyvsy') # includes new object [...'xyvsy_ex1'...]
- Parameters
name (str) – The name of the created object
source (str or
vcs.unified1D.G1d
) – The object to inherit from. Can be a xyvsy, or a string name of a xyvsy.
- Returns
A XYvsY graphics method object
- Return type
-
vcs.manageElements.
createyxvsx
(name=None, source='default')[source]¶ Create a new yxvsx graphics method given the the name and the existing yxvsx graphics method to copy attributes from. If no existing yxvsx graphics method is given, the default yxvsx graphics method will be used as the graphics method from which attributes will be copied.
Note
If the name provided already exists, then an error will be returned. graphics method names must be unique.
- Example
>>> vcs.listelements('yxvsx') # list yxvsxs [...] >>> ex=vcs.createyxvsx('yxvsx_ex1') >>> vcs.listelements('yxvsx') # includes new object [...'yxvsx_ex1'...]
- Parameters
name (str) – The name of the created object
source (str or
vcs.unified1D.G1d
) – The object to inherit from. Can be a yxvsy, or a string name of a yxvsy.
- Returns
A YXvsX graphics method object
- Return type
-
vcs.manageElements.
get1d
(name)[source]¶ Given name, returns a
vcs.unified1d.G1d
from vcs with that name. Unlike other VCS ‘get’ functions, name cannot be None when calling get1d().- Example
>>> vcs.show('1d') *******************1d Names List********************** ... *******************End 1d Names List********************** >>> vcs.get1d('blue_yxvsx') <vcs.unified1D.G1d ...>
- Parameters
name (str) – String name of a 1d in vcs. If there is no 1d with that name, an error will be raised.
- Returns
A 1d from vcs with the given name.
- Return type
vcs.unified1d.G1d
-
vcs.manageElements.
get3d_dual_scalar
(Gfdv3d_name_src='default')[source]¶ VCS contains a list of graphics methods. This function will create a dv3d object from an existing VCS dv3d graphics method. If no dv3d name is given, then default dv3d will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.create3d_dual_scalar()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('3d_dual_scalar') # list all 3d_dual_scalars [...] >>> ex=vcs.get3d_dual_scalar() # 'default' 3d_dual_scalar >>> import cdms2 # Need cdms2 to create a slab >>> f = cdms2.open(vcs.sample_data+'/clt.nc') # get data with cdms2 >>> slab1 = f('u') # take a slab from the data >>> slab2 = f('v') # need 2 slabs, so get another
- Parameters
Gfdv3d_name_src (str) – String name of an existing 3d_dual_scalar VCS object
- Returns
A pre-existing 3d_dual_scalar VCS object
- Return type
-
vcs.manageElements.
get3d_scalar
(Gfdv3d_name_src='default')[source]¶ VCS contains a list of graphics methods. This function will create a dv3d object from an existing VCS dv3d graphics method. If no dv3d name is given, then default dv3d will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.create3d_scalar()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('3d_scalar') # list all 3d_scalars [...] >>> ex=vcs.get3d_scalar() # 'default' 3d_scalar >>> import cdms2 # Need cdms2 to create a slab >>> f = cdms2.open(vcs.sample_data+'/clt.nc') # get data with cdms2 >>> slab1 = f('u') # take a slab from the data
- Parameters
Gfdv3d_name_src (str) – String name of an existing 3d_scalar VCS object.
- Returns
A pre-existing 3d_scalar VCS object
- Return type
-
vcs.manageElements.
get3d_vector
(Gfdv3d_name_src='default')[source]¶ VCS contains a list of graphics methods. This function will create a dv3d object from an existing VCS dv3d graphics method. If no dv3d name is given, then default dv3d will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.create3d_vector()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('3d_vector') # list all 3d_vectors [...] >>> ex=vcs.get3d_vector() # 'default' 3d_vector >>> import cdms2 # Need cdms2 to create a slab >>> f = cdms2.open(vcs.sample_data+'/clt.nc') # get data with cdms2 >>> slab1 = f('u') # take a slab from the data >>> slab2 = f('v') # need 2 slabs, so get another
- Parameters
Gfdv3d_name_src (str) – String name of an existing 3d_vector VCS object
- Returns
A pre-existing 3d_vector VCS object
- Return type
-
vcs.manageElements.
getboxfill
(Gfb_name_src='default')[source]¶ VCS contains a list of graphics methods. This function will create a boxfill object from an existing VCS boxfill graphics method. If no boxfill name is given, then default boxfill will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createboxfill()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('boxfill') # list all boxfills [...] >>> ex=vcs.getboxfill() # 'default' boxfill >>> import cdms2 # Need cdms2 to create a slab >>> f = cdms2.open(vcs.sample_data+'/clt.nc') # get data with cdms2 >>> slab1 = f('u') # take a slab from the data >>> a.boxfill(ex, slab1) # plot boxfill <vcs.displayplot.Dp ...> >>> ex2=vcs.getboxfill('polar') # boxfill #2 >>> a.boxfill(ex2, slab1) # plot boxfill <vcs.displayplot.Dp ...>
- Parameters
Gfb_name_src (str) – String name of an existing boxfill VCS object
- Returns
A pre-existing boxfill graphics method
- Return type
-
vcs.manageElements.
getcolormap
(Cp_name_src='default')[source]¶ VCS contains a list of secondary methods. This function will create a colormap object from an existing VCS colormap secondary method. If no colormap name is given, then default colormap will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createcolormap()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('colormap') # list all colormaps [...] >>> ex=vcs.getcolormap() # 'default' colormap >>> ex2=vcs.getcolormap('rainbow') # colormap #2
- Parameters
Cp_name_src (str) – String name of an existing colormap VCS object
- Returns
A pre-existing VCS colormap object
- Return type
-
vcs.manageElements.
getfillarea
(name='default', style=None, index=None, color=None, priority=None, viewport=None, worldcoordinate=None, x=None, y=None)[source]¶ VCS contains a list of secondary methods. This function will create a fillarea object from an existing VCS fillarea secondary method. If no fillarea name is given, then default fillarea will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createfillarea()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('fillarea') # list all fillareas [...] >>> ex=vcs.getfillarea() # 'default' fillarea >>> a.fillarea(ex) # plot fillarea <vcs.displayplot.Dp ...>
- Parameters
name (str) – String name of an existing fillarea VCS object
style (str) – One of “hatch”, “solid”, or “pattern”.
index (int) –
Specifies which pattern to fill with. Accepts ints from 1-20.
color (str or int) –
A color name from the X11 Color Names list, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))
priority (int) – The layer on which the texttable will be drawn.
viewport (list) – 4 floats between 0 and 1 which specify the area that X/Y values are mapped to inside of the canvas.
worldcoordinate (list) – List of 4 floats (xmin, xmax, ymin, ymax)
x (list) – List of lists of x coordinates. Values must be between worldcoordinate[0] and worldcoordinate[1].
y (list) – List of lists of y coordinates. Values must be between worldcoordinate[2] and worldcoordinate[3].
- Returns
A fillarea secondary object
- Return type
-
vcs.manageElements.
getfont
(font)[source]¶ Get the font name/number associated with a font number/name
- Example
>>> font_names=[] >>> for i in range(1,17): ... font_names.append(str(vcs.getfont(i))) # font_names is now filled with all font names >>> font_names ['default', ...] >>> font_numbers = [] >>> for name in font_names: ... font_numbers.append(vcs.getfont(name)) # font_numbers is now filled with all font numbers >>> font_numbers [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
- Parameters
- Returns
If font parameter was a string, will return the integer associated with that string. If font parameter was an integer, will return the string associated with that integer.
- Return type
int or str
-
vcs.manageElements.
getisofill
(Gfi_name_src='default')[source]¶ VCS contains a list of graphics methods. This function will create a isofill object from an existing VCS isofill graphics method. If no isofill name is given, then default isofill will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createisofill()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('isofill') # list all isofills [...] >>> ex=vcs.getisofill() # 'default' isofill >>> import cdms2 # Need cdms2 to create a slab >>> f = cdms2.open(vcs.sample_data+'/clt.nc') # get data with cdms2 >>> slab1 = f('u') # take a slab from the data >>> a.isofill(ex, slab1) # plot isofill <vcs.displayplot.Dp ...> >>> ex2=vcs.getisofill('polar') # isofill #2 >>> a.isofill(ex2, slab1) # plot isofill <vcs.displayplot.Dp ...>
- Parameters
Gfi_name_src (str) – String name of an existing isofill VCS object
- Returns
The specified isofill VCS object
- Return type
-
vcs.manageElements.
getisoline
(Gi_name_src='default')[source]¶ VCS contains a list of graphics methods. This function will create a isoline object from an existing VCS isoline graphics method. If no isoline name is given, then default isoline will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createisoline()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('isoline') # list all isolines [...] >>> ex=vcs.getisoline() # 'default' isoline >>> import cdms2 # Need cdms2 to create a slab >>> f = cdms2.open(vcs.sample_data+'/clt.nc') # get data with cdms2 >>> slab1 = f('u') # take a slab from the data >>> a.isoline(ex, slab1) # plot isoline <vcs.displayplot.Dp ...> >>> ex2=vcs.getisoline('polar') # isoline #2 >>> a.isoline(ex2, slab1) # plot isoline <vcs.displayplot.Dp ...>
- Parameters
Gi_name_src (str) – String name of an existing isoline VCS object
- Returns
The requested isoline VCS object
- Return type
-
vcs.manageElements.
getline
(name='default', ltype=None, width=None, color=None, priority=None, viewport=None, worldcoordinate=None, x=None, y=None)[source]¶ VCS contains a list of secondary methods. This function will create a line object from an existing VCS line secondary method. If no line name is given, then default line will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createline()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('line') # list all lines [...] >>> ex=vcs.getline() # 'default' line >>> a.line(ex) # plot line <vcs.displayplot.Dp ...> >>> ex2=vcs.getline('red') # line #2 >>> a.line(ex2) # plot line <vcs.displayplot.Dp ...>
- Parameters
name (str) – Name of created object
ltype (str) – One of “dash”, “dash-dot”, “solid”, “dot”, or “long-dash”.
width (int) – Thickness of the line to be created
color (str or int) –
A color name from the X11 Color Names list, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))
priority (int) – The layer on which the marker will be drawn.
viewport (list) – 4 floats between 0 and 1 which specify the area that X/Y values are mapped to inside of the canvas.
worldcoordinate (list) – List of 4 floats (xmin, xmax, ymin, ymax)
x (list) – List of lists of x coordinates. Values must be between worldcoordinate[0] and worldcoordinate[1].
y (list) – List of lists of y coordinates. Values must be between worldcoordinate[2] and worldcoordinate[3].
- Returns
A VCS line object
- Return type
-
vcs.manageElements.
getmarker
(name='default', mtype=None, size=None, color=None, priority=None, viewport=None, worldcoordinate=None, x=None, y=None)[source]¶ VCS contains a list of secondary methods. This function will create a marker object from an existing VCS marker secondary method. If no marker name is given, then default marker will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createmarker()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('marker') # list all markers [...] >>> ex=vcs.getmarker() # 'default' marker >>> a.marker(ex) # plot marker <vcs.displayplot.Dp ...> >>> ex2=vcs.getmarker('red') # marker #2 >>> a.marker(ex2) # plot marker <vcs.displayplot.Dp ...>
- Parameters
name (str) – Name of created object
source (str) – A marker, or string name of a marker
mtype (str) – Specifies the type of marker, i.e. “dot”, “circle”
size (int) – Size of the marker
color (str or int) –
A color name from the X11 Color Names list, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))
priority (int) – The layer on which the marker will be drawn.
viewport (list) – 4 floats between 0 and 1 which specify the area that X/Y values are mapped to inside of the canvas.
worldcoordinate (list) – List of 4 floats (xmin, xmax, ymin, ymax)
x (list) – List of lists of x coordinates. Values must be between worldcoordinate[0] and worldcoordinate[1].
y (list) – List of lists of y coordinates. Values must be between worldcoordinate[2] and worldcoordinate[3].
- Returns
A marker graphics method object
- Return type
-
vcs.manageElements.
getmeshfill
(Gfm_name_src='default')[source]¶ VCS contains a list of graphics methods. This function will create a meshfill object from an existing VCS meshfill graphics method. If no meshfill name is given, then default meshfill will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createmeshfill()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('meshfill') # list all meshfills [...] >>> ex=vcs.getmeshfill() # 'default' meshfill >>> import cdms2 # Need cdms2 to create a slab >>> f = cdms2.open(vcs.sample_data+'/clt.nc') # get data with cdms2 >>> slab1 = f('u') # take a slab from the data >>> a.meshfill(ex, slab1) # plot meshfill <vcs.displayplot.Dp ...> >>> ex2=vcs.getmeshfill('a_polar_meshfill') # meshfill #2 >>> a.meshfill(ex2, slab1) # plot meshfill <vcs.displayplot.Dp ...>
- Parameters
Gfm_name_src (str) – String name of an existing meshfill VCS object
- Returns
A meshfill VCS object
- Return type
-
vcs.manageElements.
getprojection
(Proj_name_src='default')[source]¶ VCS contains a list of graphics methods. This function will create a projection object from an existing VCS projection graphics method. If no projection name is given, then default projection will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createprojection()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('projection') # list all projections [...] >>> ex=vcs.getprojection() # 'default' projection >>> import cdms2 # Need cdms2 to create a slab >>> f = cdms2.open(vcs.sample_data+'/clt.nc') # get data with cdms2 >>> slab1 = f('u') # take a slab from the data >>> ex2=vcs.getprojection('orthographic') # projection #2
- Parameters
Proj_name_src (str) – String name of an existing VCS projection object
- Returns
A VCS projection object
- Return type
-
vcs.manageElements.
getscatter
(GSp_name_src='default')[source]¶ VCS contains a list of graphics methods. This function will create a scatter object from an existing VCS scatter graphics method. If no scatter name is given, then ‘default_scatter_’ scatter will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createscatter()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('scatter') # list all scatters [...] >>> ex=vcs.getscatter('default_scatter_') # ''default_scatter_'' scatter >>> import cdms2 # Need cdms2 to create a slab >>> f = cdms2.open(vcs.sample_data+'/clt.nc') # get data with cdms2 >>> slab1 = f('u') # take a slab from the data >>> slab2 = f('v') # need 2 slabs, so get another >>> a.scatter(ex, slab1, slab2) # plot scatter <vcs.displayplot.Dp ...>
- Parameters
GSp_name_src (str) – String name of an existing scatter VCS object.
- Returns
A scatter graphics method object
- Return type
-
vcs.manageElements.
getstreamline
(Gs_name_src='default')[source]¶ VCS contains a list of graphics methods. This function will create a streamline object from an existing VCS streamline graphics method. If no streamline name is given, then default streamline will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createstreamline()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('streamline') # list all streamlines [...] >>> ex=vcs.getstreamline() # 'default' streamline >>> import cdms2 # Need cdms2 to create a slab >>> f = cdms2.open(vcs.sample_data+'/clt.nc') # get data with cdms2 >>> slab1 = f('u') # take a slab from the data >>> slab2 = f('v') # need 2 slabs, so get another >>> a.streamline(ex, slab1, slab2) # plot streamline <vcs.displayplot.Dp ...>
- Parameters
Gs_name_src (str) – String name of an existing streamline VCS object
- Returns
A streamline graphics method object
- Return type
-
vcs.manageElements.
gettaylordiagram
(Gtd_name_src='default')[source]¶ VCS contains a list of graphics methods. This function will create a taylordiagram object from an existing VCS taylordiagram graphics method. If no taylordiagram name is given, then default taylordiagram will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createtaylordiagram()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('taylordiagram') # list all taylordiagrams [...] >>> ex=vcs.gettaylordiagram() # 'default' taylordiagram >>> slab1 = [[0, 1, 2, 3, 4], [0.1, 0.2, 0.3, 0.4, 0.5]] # data >>> a.taylordiagram(ex, slab1) # plot taylordiagram <vcs.displayplot.Dp ...>
- Parameters
Gtd_name_src (str) – String name of an existing taylordiagram VCS object
- Returns
A taylordiagram VCS object
- Return type
-
vcs.manageElements.
gettemplate
(Pt_name_src='default')[source]¶ VCS contains a list of graphics methods. This function will create a template object from an existing VCS template graphics method. If no template name is given, then default template will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createtemplate()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('template') # list all templates [...] >>> ex=vcs.gettemplate() # 'default' template >>> import cdms2 # Need cdms2 to create a slab >>> f = cdms2.open(vcs.sample_data+'/clt.nc') # get data with cdms2 >>> slab1 = f('u') # take a slab from the data >>> ex2=vcs.gettemplate('polar') # template #2
- Parameters
Pt_name_src (str) – String name of an existing template VCS object
- Returns
A VCS template object
- Return type
-
vcs.manageElements.
gettext
(Tt_name_src='default', To_name_src=None, string=None, font=None, spacing=None, expansion=None, color=None, priority=None, viewport=None, worldcoordinate=None, x=None, y=None, height=None, angle=None, path=None, halign=None, valign=None)¶ VCS contains a list of secondary methods. This function will create a textcombined object from an existing VCS textcombined secondary method. If no textcombined name is given, then EX_tt:::EX_tto textcombined will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createtextcombined()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('textcombined') # list all textcombineds [...] >>> try: # try to create a new textcombined, in case none exist ... tc = vcs.createtextcombined('EX_tt', 'qa', 'EX_tto', '7left') ... except: ... pass >>> ex=vcs.gettextcombined('EX_tt', 'EX_tto') # 'EX_tt:::EX_tto' textcombined >>> a.textcombined(ex) # plot textcombined <vcs.displayplot.Dp ...>
- Parameters
Tt_name_src (str) – Name of parent texttable object
To_name_src (str) – Name of parent textorientation object
string (list) – Text to render
color (str or int) –
A color name from the X11 Color Names list, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))
priority (int) – The layer on which the object will be drawn.
viewport (list) – 4 floats between 0 and 1 which specify the area that X/Y values are mapped to inside of the canvas.
worldcoordinate (list) – List of 4 floats (xmin, xmax, ymin, ymax)
x (list) – List of lists of x coordinates. Values must be between worldcoordinate[0] and worldcoordinate[1].
y (list) – List of lists of y coordinates. Values must be between worldcoordinate[2] and worldcoordinate[3].
height (int) – Size of the font
angle (list) – Angle of the rendered text, in degrees. Must be a list of integers.
halign (str) – Horizontal alignment of the text. One of [“left”, “center”, “right”]
valign (str) – Vertical alignment of the text. One of [“top”, “center”, “bottom”]
- Returns
A textcombined object
- Return type
Note
The spacing, path, and expansion parameters are no longer used
-
vcs.manageElements.
gettextcombined
(Tt_name_src='default', To_name_src=None, string=None, font=None, spacing=None, expansion=None, color=None, priority=None, viewport=None, worldcoordinate=None, x=None, y=None, height=None, angle=None, path=None, halign=None, valign=None)[source]¶ VCS contains a list of secondary methods. This function will create a textcombined object from an existing VCS textcombined secondary method. If no textcombined name is given, then EX_tt:::EX_tto textcombined will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createtextcombined()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('textcombined') # list all textcombineds [...] >>> try: # try to create a new textcombined, in case none exist ... tc = vcs.createtextcombined('EX_tt', 'qa', 'EX_tto', '7left') ... except: ... pass >>> ex=vcs.gettextcombined('EX_tt', 'EX_tto') # 'EX_tt:::EX_tto' textcombined >>> a.textcombined(ex) # plot textcombined <vcs.displayplot.Dp ...>
- Parameters
Tt_name_src (str) – Name of parent texttable object
To_name_src (str) – Name of parent textorientation object
string (list) – Text to render
color (str or int) –
A color name from the X11 Color Names list, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))
priority (int) – The layer on which the object will be drawn.
viewport (list) – 4 floats between 0 and 1 which specify the area that X/Y values are mapped to inside of the canvas.
worldcoordinate (list) – List of 4 floats (xmin, xmax, ymin, ymax)
x (list) – List of lists of x coordinates. Values must be between worldcoordinate[0] and worldcoordinate[1].
y (list) – List of lists of y coordinates. Values must be between worldcoordinate[2] and worldcoordinate[3].
height (int) – Size of the font
angle (list) – Angle of the rendered text, in degrees. Must be a list of integers.
halign (str) – Horizontal alignment of the text. One of [“left”, “center”, “right”]
valign (str) – Vertical alignment of the text. One of [“top”, “center”, “bottom”]
- Returns
A textcombined object
- Return type
Note
The spacing, path, and expansion parameters are no longer used
-
vcs.manageElements.
gettextorientation
(To_name_src='default')[source]¶ VCS contains a list of secondary methods. This function will create a textorientation object from an existing VCS textorientation secondary method. If no textorientation name is given, then default textorientation will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createtextorientation()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('textorientation') # list all textorientations [...] >>> ex=vcs.gettextorientation() # 'default' textorientation >>> ex2=vcs.gettextorientation('bigger') # textorientation #2
- Parameters
To_name_src (str) – String name of an existing textorientation VCS object
- Returns
A textorientation VCS object
- Return type
-
vcs.manageElements.
gettexttable
(name='default', font=None, spacing=None, expansion=None, color=None, priority=None, viewport=None, worldcoordinate=None, x=None, y=None)[source]¶ VCS contains a list of secondary methods. This function will create a texttable object from an existing VCS texttable secondary method. If no texttable name is given, then default texttable will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createtexttable()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('texttable') # list all texttables [...] >>> ex=vcs.gettexttable() # 'default' texttable >>> ex2=vcs.gettexttable('bigger') # texttable #2
- Parameters
name (str) – String name of an existing VCS texttable object
color (str or int) –
A color name from the X11 Color Names list, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))
priority (int) – The layer on which the texttable will be drawn.
viewport (list) – 4 floats between 0 and 1 which specify the area that X/Y values are mapped to inside of the canvas.
worldcoordinate (list) – List of 4 floats (xmin, xmax, ymin, ymax)
x (list) – List of lists of x coordinates. Values must be between worldcoordinate[0] and worldcoordinate[1].
y (list) – List of lists of y coordinates. Values must be between worldcoordinate[2] and worldcoordinate[3].
- Returns
A texttable graphics method object
- Return type
Note
The expansion parameter is no longer used
-
vcs.manageElements.
getvector
(Gv_name_src='default')[source]¶ VCS contains a list of graphics methods. This function will create a vector object from an existing VCS vector graphics method. If no vector name is given, then default vector will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createvector()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('vector') # list all vectors [...] >>> ex=vcs.getvector() # 'default' vector >>> import cdms2 # Need cdms2 to create a slab >>> f = cdms2.open(vcs.sample_data+'/clt.nc') # get data with cdms2 >>> slab1 = f('u') # take a slab from the data >>> slab2 = f('v') # need 2 slabs, so get another >>> a.vector(ex, slab1, slab2) # plot vector <vcs.displayplot.Dp ...>
- Parameters
Gv_name_src (str) – String name of an existing vector VCS object
- Returns
A vector graphics method object
- Return type
-
vcs.manageElements.
getxvsy
(GXY_name_src='default')[source]¶ VCS contains a list of graphics methods. This function will create a xvsy object from an existing VCS xvsy graphics method. If no xvsy name is given, then default_xvsy_ xvsy will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createxvsy()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('xvsy') # list all xvsys [...] >>> ex=vcs.getxvsy() # 'default_xvsy_' xvsy >>> import cdms2 # Need cdms2 to create a slab >>> f = cdms2.open(vcs.sample_data+'/clt.nc') # get data with cdms2 >>> slab1 = f('u') # take a slab from the data >>> slab2 = f('v') # need 2 slabs, so get another >>> a.xvsy(ex, slab1, slab2) # plot xvsy <vcs.displayplot.Dp ...>
- Parameters
GXY_name_src (str) – String name of a 1d graphics method
- Returns
A XvsY graphics method object
- Return type
-
vcs.manageElements.
getxyvsy
(GXy_name_src='default')[source]¶ VCS contains a list of graphics methods. This function will create a xyvsy object from an existing VCS xyvsy graphics method. If no xyvsy name is given, then ‘default_xyvsy_’ xyvsy will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createxyvsy()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('xyvsy') # list all xyvsys [...] >>> ex=vcs.getxyvsy('default_xyvsy_') # ''default_xyvsy_'' xyvsy >>> import cdms2 # Need cdms2 to create a slab >>> f = cdms2.open(vcs.sample_data+'/clt.nc') # get data with cdms2 >>> slab1 = f('u') # take a slab from the data >>> a.xyvsy(ex, slab1) # plot xyvsy <vcs.displayplot.Dp ...>
- Parameters
GXy_name_src (str) – String name of an existing Xyvsy graphics method
- Returns
An XYvsY graphics method object
- Return type
-
vcs.manageElements.
getyxvsx
(GYx_name_src='default')[source]¶ VCS contains a list of graphics methods. This function will create a yxvsx object from an existing VCS yxvsx graphics method. If no yxvsx name is given, then default_yxvsx_ yxvsx will be used.
Note
VCS does not allow the modification of ‘default’ attribute sets. However, a ‘default’ attribute set that has been copied under a different name can be modified. (See the
vcs.manageElements.createyxvsx()
function.)- Example
>>> a=vcs.init() >>> vcs.listelements('yxvsx') # list all yxvsxs [...] >>> ex=vcs.getyxvsx() # 'default_yxvsx_' yxvsx >>> import cdms2 # Need cdms2 to create a slab >>> f = cdms2.open(vcs.sample_data+'/clt.nc') # get data with cdms2 >>> slab1 = f('u') # take a slab from the data >>> a.yxvsx(ex, slab1) # plot yxvsx <vcs.displayplot.Dp ...>
- Parameters
GYx_name_src (str) – String name of an existing Yxvsx graphics method
- Returns
A Yxvsx graphics method object
- Return type
-
vcs.manageElements.
removeobject
(obj)[source]¶ The user has the ability to create primary and secondary class objects. The function allows the user to remove these objects from the appropriate class list.
Note
The user is not allowed to remove a “default” class object.
- Example
>>> a=vcs.init() >>> iso=a.createisoline('dean') # Create an instance of an isoline object >>> a.removeobject(iso) # Remove isoline object from VCS list 'Removed isoline object dean'
- Parameters
obj (VCS object) – Any VCS primary or secondary object
- Returns
String indicating the specified object was removed
- Return type
str
-
vcs.manageElements.
reset
(gtype=None)[source]¶ Remove all user generated objects
# :Example: # # .. doctest:: manageElements_reset # # >>> vcs.reset() # >>> vcs.reset(“boxfill”) # >>> vcs.reset([“isofill”, “template”])
- param gtype
String or list of stringsname of a VCS object type. (e.g. ‘boxfill’, ‘isofill’, ‘marker’, etc.)
- type typ
str
- returns
None
- rtype
None
-
vcs.manageElements.
setLineAttributes
(to, the_line)[source]¶ Set attributes linecolor, linewidth and linetype from line l on object to.
- Example
>>> vcs.show('line') *******************Line Names List********************** ... *******************End Line Names List********************** >>> new_isoline = vcs.createisoline('new_iso') >>> vcs.setLineAttributes(new_isoline, 'continents') >>> new_vector = vcs.createvector('new_vec') >>> vcs.setLineAttributes(new_vector, 'continents') >>> new_1d = vcs.create1d('new_1d', 'blue_yxvsx') >>> vcs.setLineAttributes(new_1d, 'continents')
- Parameters
to (
vcs.vector.Gv
,vcs.unified1d.G1d
) – A vector, 1d, or isoline object to set the properties of.l (
vcs.line.Tl
or str) – l can be a line name defined in vcs.elements or a line object. l will be used to set the properties of to.
-
vcs.manageElements.
setdefaultfont
(font)[source]¶ Sets the passed/def show font as the default font for vcs
Attention
This function does not currently work. It will be implemented in the future.
-
vcs.manageElements.
switchfonts
(font1, font2)[source]¶ Switch the font numbers of two fonts.
- Example
>>> a=vcs.init() >>> maths1 = a.getfontnumber('Maths1') # store font number >>> maths2 = a.getfontnumber('Maths2') # store font number >>> a.switchfonts('Maths1','Maths2') # switch font numbers >>> new_maths1 = a.getfontnumber('Maths1') >>> new_maths2 = a.getfontnumber('Maths2') >>> maths1 == new_maths2 and maths2 == new_maths1 # check True
- Parameters