|
Python: module vcs.yxvsx
# Yxvsx (GYx) module
Classes |
| |
- __builtin__.object
-
- GYx
class GYx(__builtin__.object) |
|
Class: GYx # Yxvsx
Description of GYx Class:
The Yxvsx graphics method displays a line plot from a 1D data array (i.e. a
plot of Y(x), where y represents the 1D coordinate values). The example below
shows how to change line and marker attributes for the Yxvsx graphics method.
This class is used to define an Yxvsx table entry used in VCS, or it can be
used to change some or all of the Yxvsx attributes in an existing Yxvsx table
entry.
Other Useful Functions:
a=vcs.init() # Constructor
a.show('yxvsx') # Show predefined Yxvsx graphics methonds
a.show('line') # Show predefined VCS line objects
a.show('marker') # Show predefined VCS marker objects
a.setcolormap("AMIP") # Change the VCS color map
a.yxvsx(s, x, 'default') # Plot data 's' with Yxvsx 'x'
and 'default' template
a.update() # Updates the VCS Canvas at user's request
a.mode=1, or 0 If 1, then automatic update, else if
0, then use update function to
Example of Use:
a=vcs.init()
To Create a new instance of Yxvsx use:
yxx=a.createxyvsy('new','quick') # Copies content of 'quick' to 'new'
yxx=a.createxyvsy('new') # Copies content of 'default' to 'new'
To Modify an existing Yxvsx use:
yxx=a.getxyvsy('AMIP_psl')
yxx.list() # Will list all the Yxvsx attribute values
yxx.projection='linear' # Can only be 'linear'
lon30={-180:'180W',-150:'150W',0:'Eq'}
yxx.xticlabels1=lon30
yxx.xticlabels2=lon30
yxx.xticlabels(lon30, lon30) # Will set them both
yxx.xmtics1=''
yxx.xmtics2=''
yxx.xmtics(lon30, lon30) # Will set them both
yxx.yticlabels1=lat10
yxx.yticlabels2=lat10
yxx.yticlabels(lat10, lat10) # Will set them both
yxx.ymtics1=''
yxx.ymtics2=''
yxx.ymtics(lat10, lat10) # Will set them both
yxx.datawc_y1=-90.0
yxx.datawc_y2=90.0
yxx.datawc_x1=-180.0
yxx.datawc_x2=180.0
yxx.datawc(-90, 90, -180, 180) # Will set them all
yxx.xaxisconvert='linear'
Specify the Yxvsx line type:
yxx.line=0 # same as yxx.line = 'solid'
yxx.line=1 # same as yxx.line = 'dash'
yxx.line=2 # same as yxx.line = 'dot'
yxx.line=3 # same as yxx.line = 'dash-dot'
yxx.line=4 # same as yxx.line = 'long-dash
Specify the Yxvsx line color:
yxx.linecolor=16 # color range: 16 to 230, default color is black
yxx.linewidth=1 # width range: 1 to 100, default color is 1
Specify the Yxvsx marker type:
yxx.marker=1 # Same as yxx.marker='dot'
yxx.marker=2 # Same as yxx.marker='plus'
yxx.marker=3 # Same as yxx.marker='star'
yxx.marker=4 # Same as yxx.marker='circle'
yxx.marker=5 # Same as yxx.marker='cross'
yxx.marker=6 # Same as yxx.marker='diamond'
yxx.marker=7 # Same as yxx.marker='triangle_up'
yxx.marker=8 # Same as yxx.marker='triangle_down'
yxx.marker=9 # Same as yxx.marker='triangle_left'
yxx.marker=10 # Same as yxx.marker='triangle_right'
yxx.marker=11 # Same as yxx.marker='square'
yxx.marker=12 # Same as yxx.marker='diamond_fill'
yxx.marker=13 # Same as yxx.marker='triangle_up_fill'
yxx.marker=14 # Same as yxx.marker='triangle_down_fill'
yxx.marker=15 # Same as yxx.marker='triangle_left_fill'
yxx.marker=16 # Same as yxx.marker='triangle_right_fill'
yxx.marker=17 # Same as yxx.marker='square_fill'
yxx.marker=None # Draw no markers
There are four possibilities for setting the marker color index (Ex):
yxx.markercolors=22 # Same as below
yxx.markercolors=(22) # Same as below
yxx.markercolors=([22]) # Will set the markers to a specific
color index
yxx.markercolors=None # Color index defaults to Black
To set the Yxvsx Marker sizie:
yxx.markersize=5
yxx.markersize=55
yxx.markersize=100
yxx.markersize=300
yxx.markersize=None |
|
Methods defined here:
- __init__(self, parent, GYx_name=None, GYx_name_src='default', createGYx=0)
- datawc(self, dsp1=1e+20, dsp2=1e+20, dsp3=1e+20, dsp4=1e+20)
- list(self)
- rename = renameGYx(self, old_name, new_name)
- ###############################################################################
# #
# Function: renameGYx #
# #
# Description of Function: #
# Private function that renames the name of an existing Yxvsx #
# graphics method. #
# #
# #
# Example of Use: #
# renameGYx(old_name, new_name) #
# where: old_name is the current name of Yxvsx graphics method #
# new_name is the new name for the Yxvsx graphics method #
# #
###############################################################################
- script(self, script_filename=None, mode=None)
- Function: script # Calls _vcs.scriptGYx
Description of Function:
Saves out a boxfill graphics method in Python or VCS script form to a
designated file.
Example of Use:
script(scriptfile_name, mode)
where: scriptfile_name is the output name of the script file.
mode is either "w" for replace or "a" for append.
Note: If the the filename has a ".py" at the end, it will produce a
Python script. If the filename has a ".scr" at the end, it will
produce a VCS script. If neither extensions are give, then by
default a Python script will be produced.
a=vcs.init()
Yx=a.createboxfill('temp')
Yx.script('filename.py') # Append to a Python file "filename.py"
Yx.script('filename.scr') # Append to a VCS file "filename.scr"
Yx.script('filename','w')
- xmtics(self, xmt1='', xmt2='')
- xticlabels(self, xtl1='', xtl2='')
- ymtics(self, ymt1='', ymt2='')
- yticlabels(self, ytl1='', ytl2='')
Properties defined here:
- datawc_calendar
- get = _getcalendar(self)
- set = _setcalendar(self, value)
- datawc_timeunits
- get = _gettimeunits(self)
- set = _settimeunits(self, value)
- datawc_x1
- get = _getdatawc_x1(self)
- set = _setdatawc_x1(self, value)
- datawc_x2
- get = _getdatawc_x2(self)
- set = _setdatawc_x2(self, value)
- datawc_y1
- get = _getdatawc_y1(self)
- set = _setdatawc_y1(self, value)
- datawc_y2
- get = _getdatawc_y2(self)
- set = _setdatawc_y2(self, value)
- line
- get = _getline(self)
- set = _setline(self, value)
- linecolor
- get = _getlinecolor(self)
- set = _setlinecolor(self, value)
- linewidth
- get = _getlinewidth(self)
- set = _setlinewidth(self, value)
- marker
- get = _getmarker(self)
- set = _setmarker(self, value)
- markercolor
- get = _getmarkercolor(self)
- set = _setmarkercolor(self, value)
- markersize
- get = _getmarkersize(self)
- set = _setmarkersize(self, value)
- name
- get = _getname(self)
- set = _setname(self, value)
- projection
- get = _getprojection(self)
- set = _setprojection(self, value)
- xaxisconvert
- get = _getxaxisconvert(self)
- set = _setxaxisconvert(self, value)
- xmtics1
- get = _getxmtics1(self)
- set = _setxmtics1(self, value)
- xmtics2
- get = _getxmtics2(self)
- set = _setxmtics2(self, value)
- xticlabels1
- get = _getxticlabels1(self)
- set = _setxticlabels1(self, value)
- xticlabels2
- get = _getxticlabels2(self)
- set = _setxticlabels2(self, value)
- ymtics1
- get = _getymtics1(self)
- set = _setymtics1(self, value)
- ymtics2
- get = _getymtics2(self)
- set = _setymtics2(self, value)
- yticlabels1
- get = _getyticlabels1(self)
- set = _setyticlabels1(self, value)
- yticlabels2
- get = _getyticlabels2(self)
- set = _setyticlabels2(self, value)
Data and other attributes defined here:
- __slots__ = ['setmember', 'parent', 'name', 'g_name', 'xaxisconvert', 'linecolor', 'line', 'linewidth', 'marker', 'markersize', 'markercolor', 'projection', 'xticlabels1', 'xticlabels2', 'yticlabels1', 'yticlabels2', 'xmtics1', 'xmtics2', 'ymtics1', 'ymtics2', ...]
- g_name = <member 'g_name' of 'GYx' objects>
- parent = <member 'parent' of 'GYx' objects>
- setmember = <member 'setmember' of 'GYx' objects>
| |
Functions |
| |
- getGYxmember(self, member)
- ###############################################################################
# #
# Function: getGYxmember #
# #
# Description of Function: #
# Private function that retrieves the Yxvsx members from the C #
# structure and passes it back to Python. #
# #
# #
# Example of Use: #
# return_value = #
# getGYxmember(self,name) #
# where: self is the class (e.g., GYx) #
# name is the name of the member that is being found #
# #
###############################################################################
- getmember = getGYxmember(self, member)
- ###############################################################################
# #
# Function: getGYxmember #
# #
# Description of Function: #
# Private function that retrieves the Yxvsx members from the C #
# structure and passes it back to Python. #
# #
# #
# Example of Use: #
# return_value = #
# getGYxmember(self,name) #
# where: self is the class (e.g., GYx) #
# name is the name of the member that is being found #
# #
###############################################################################
- renameGYx(self, old_name, new_name)
- ###############################################################################
# #
# Function: renameGYx #
# #
# Description of Function: #
# Private function that renames the name of an existing Yxvsx #
# graphics method. #
# #
# #
# Example of Use: #
# renameGYx(old_name, new_name) #
# where: old_name is the current name of Yxvsx graphics method #
# new_name is the new name for the Yxvsx graphics method #
# #
###############################################################################
- setGYxmember(self, member, value)
- ###############################################################################
# #
# Function: setGYxmember #
# #
# Description of Function: #
# Private function to update the VCS canvas plot. If the canvas mode is #
# set to 0, then this function does nothing. #
# #
# #
# Example of Use: #
# setGYxmember(self,name,value) #
# where: self is the class (e.g., GYx) #
# name is the name of the member that is being changed #
# value is the new value of the member (or attribute) #
# #
###############################################################################
- setmember = setGYxmember(self, member, value)
- ###############################################################################
# #
# Function: setGYxmember #
# #
# Description of Function: #
# Private function to update the VCS canvas plot. If the canvas mode is #
# set to 0, then this function does nothing. #
# #
# #
# Example of Use: #
# setGYxmember(self,name,value) #
# where: self is the class (e.g., GYx) #
# name is the name of the member that is being changed #
# value is the new value of the member (or attribute) #
# #
###############################################################################
|
Data |
| |
StringTypes = (<type 'str'>, <type 'unicode'>) |
|