|
Python: module vcs.xyvsy
# Xyvsy (GXy) module
Classes |
| |
- __builtin__.object
-
- GXy
class GXy(__builtin__.object) |
|
Class: GXy # Xyvsy
Description of GXy Class:
The Xyvsy graphics method displays a line plot from a 1D data array (i.e. a
plot of X(y), where y represents the 1D coordinate values). The example below
shows how to change line and marker attributes for the Xyvsy graphics method.
This class is used to define an Xyvsy table entry used in VCS, or it can be
used to change some or all of the Xyvsy attributes in an existing Xyvsy table
entry.
Other Useful Functions:
a=vcs.init() # Constructor
a.show('xyvsy') # Show predefined Xyvsy 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.xyvsy(s, x, 'default') # Plot data 's' with Xyvsy '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 Xyvsy use:
xyy=a.createxyvsy('new','quick') # Copies content of 'quick' to 'new'
xyy=a.createxyvsy('new') # Copies content of 'default' to 'new'
To Modify an existing Xyvsy use:
xyy=a.getxyvsy('AMIP_psl')
xyy.list() # Will list all the Xyvsy attribute values
xyy.projection='linear' # Can only be 'linear'
lon30={-180:'180W',-150:'150W',0:'Eq'}
xyy.xticlabels1=lon30
xyy.xticlabels2=lon30
xyy.xticlabels(lon30, lon30) # Will set them both
xyy.xmtics1=''
xyy.xmtics2=''
xyy.xmtics(lon30, lon30) # Will set them both
xyy.yticlabels1=lat10
xyy.yticlabels2=lat10
xyy.yticlabels(lat10, lat10) # Will set them both
xyy.ymtics1=''
xyy.ymtics2=''
xyy.ymtics(lat10, lat10) # Will set them both
xyy.datawc_y1=-90.0
xyy.datawc_y2=90.0
xyy.datawc_x1=-180.0
xyy.datawc_x2=180.0
xyy.datawc(-90, 90, -180, 180) # Will set them all
xyy.yaxisconvert='linear'
Specify the Xyvsy line type:
xyy.line=0 # same as xyy.line = 'solid'
xyy.line=1 # same as xyy.line = 'dash'
xyy.line=2 # same as xyy.line = 'dot'
xyy.line=3 # same as xyy.line = 'dash-dot'
xyy.line=4 # same as xyy.line = 'long-dash
Specify the Xyvsy line color:
xyy.linecolor=16 # color range: 16 to 230, default color is black
xyy.linewidth=16 # width range: 1 to 100, default color is black
Specify the Xyvsy marker type:
xyy.marker=1 # Same as xyy.marker='dot'
xyy.marker=2 # Same as xyy.marker='plus'
xyy.marker=3 # Same as xyy.marker='star'
xyy.marker=4 # Same as xyy.marker='circle'
xyy.marker=5 # Same as xyy.marker='cross'
xyy.marker=6 # Same as xyy.marker='diamond'
xyy.marker=7 # Same as xyy.marker='triangle_up'
xyy.marker=8 # Same as xyy.marker='triangle_down'
xyy.marker=9 # Same as xyy.marker='triangle_left'
xyy.marker=10 # Same as xyy.marker='triangle_right'
xyy.marker=11 # Same as xyy.marker='square'
xyy.marker=12 # Same as xyy.marker='diamond_fill'
xyy.marker=13 # Same as xyy.marker='triangle_up_fill'
xyy.marker=14 # Same as xyy.marker='triangle_down_fill'
xyy.marker=15 # Same as xyy.marker='triangle_left_fill'
xyy.marker=16 # Same as xyy.marker='triangle_right_fill'
xyy.marker=17 # Same as xyy.marker='square_fill'
xyy.marker=None # Draw no markers
There are four possibilities for setting the marker color index (Ex):
xyy.markercolors=22 # Same as below
xyy.markercolors=(22) # Same as below
xyy.markercolors=([22]) # Will set the markers to a specific
# color index
xyy.markercolors=None # Color index defaults to Black
To set the Xyvsy Marker sizie:
xyy.markersize=5
xyy.markersize=55
xyy.markersize=100
xyy.markersize=300
xyy.markersize=None |
|
Methods defined here:
- __init__(self, parent, GXy_name=None, GXy_name_src='default', createGXy=0)
- datawc(self, dsp1=1e+20, dsp2=1e+20, dsp3=1e+20, dsp4=1e+20)
- list(self)
- rename = renameGXy(self, old_name, new_name)
- #################################################################################
# #
# Function: renameGXy #
# #
# Description of Function: #
# Private function that renames the name of an existing Xyvsy #
# graphics method. #
# #
# #
# Example of Use: #
# renameGXy(old_name, new_name) #
# where: old_name is the current name of Xyvsy graphics method #
# new_name is the new name for the Xyvsy graphics method #
# #
#################################################################################
- script(self, script_filename=None, mode=None)
- Function: script # Calls _vcs.scriptGXy
Description of Function:
Saves out a Xyvsy 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()
Xy=a.createboxfill('temp')
Xy.script('filename.py') # Append to a Python file "filename.py"
Xy.script('filename.scr') # Append to a VCS file "filename.scr"
Xy.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)
- 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)
- yaxisconvert
- get = _getyaxisconvert(self)
- set = _setyaxisconvert(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', 'yaxisconvert', 'linecolor', 'line', 'linewidth', 'marker', 'markersize', 'markercolor', 'projection', 'xticlabels1', 'xticlabels2', 'yticlabels1', 'yticlabels2', 'xmtics1', 'xmtics2', 'ymtics1', 'ymtics2', ...]
- g_name = <member 'g_name' of 'GXy' objects>
- parent = <member 'parent' of 'GXy' objects>
- setmember = <member 'setmember' of 'GXy' objects>
| |
Functions |
| |
- getGXymember(self, member)
- #################################################################################
# #
# Function: getGXymember #
# #
# Description of Function: #
# Private function that retrieves the Xyvsy members from the C #
# structure and passes it back to Python. #
# #
# #
# Example of Use: #
# return_value = #
# getGXymember(self,name) #
# where: self is the class (e.g., GXy) #
# name is the name of the member that is being found #
# #
#################################################################################
- getmember = getGXymember(self, member)
- #################################################################################
# #
# Function: getGXymember #
# #
# Description of Function: #
# Private function that retrieves the Xyvsy members from the C #
# structure and passes it back to Python. #
# #
# #
# Example of Use: #
# return_value = #
# getGXymember(self,name) #
# where: self is the class (e.g., GXy) #
# name is the name of the member that is being found #
# #
#################################################################################
- renameGXy(self, old_name, new_name)
- #################################################################################
# #
# Function: renameGXy #
# #
# Description of Function: #
# Private function that renames the name of an existing Xyvsy #
# graphics method. #
# #
# #
# Example of Use: #
# renameGXy(old_name, new_name) #
# where: old_name is the current name of Xyvsy graphics method #
# new_name is the new name for the Xyvsy graphics method #
# #
#################################################################################
- setGXymember(self, member, value)
- #################################################################################
# #
# Function: setGXymember #
# #
# 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: #
# setGXymember(self,name,value) #
# where: self is the class (e.g., GXy) #
# name is the name of the member that is being changed #
# value is the new value of the member (or attribute) #
# #
#################################################################################
- setmember = setGXymember(self, member, value)
- #################################################################################
# #
# Function: setGXymember #
# #
# 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: #
# setGXymember(self,name,value) #
# where: self is the class (e.g., GXy) #
# 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'>) |
|