Ngl.new_dash_pattern
Adds new dash patterns to the existing table of dash patterns.
Prototype
dpat = Ngl.new_dash_pattern(wks, dash_pattern)
Arguments
wksThe identifier returned from calling Ngl.open_wks.
dash_patternA string indicating the dash pattern to create.
Return value
dpatAn integer representing a dash pattern index into the current dash pattern table that contains the new dash pattern added.
Description
Given a workstation and a string that represents a dash pattern, this function adds the given dash pattern to the current dash pattern table, and returns a unique index that represents the location of the new dash pattern in the dash pattern table.
You can use these new patterns in any resource that allows you to set a dash pattern index.
The dash patterns strings can be any length, and should be generated using a combination of "$" and "_" characters. The "$" represents a pen-down, and the "_" represents a pen-up.
The current dash pattern table is made up of the following string combinations. Note that the first pattern is a solid line:
dash index | dash pattern |
---|---|
0 | "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" |
1 | "$$$$__$$$$__$$$$__$$$$__$$$$__$$$$__$$$$__$$$$__" |
2 | "$__$__$__$__$__$__$__$__$__$__$__$__$__$__$__$__" |
3 | "$$$$__$__$$$$__$__$$$$__$__$$$$__$__$$$$__$__" |
4 | "$$$$__$_$__$$$$__$_$__$$$$__$_$__$$$$__$_$__" |
5 | "$$_$$_$$_$$_$$_$$_$$_$$_$$_$$_$$_$$_$$_$$_$$_$$_" |
6 | "$$$_$$$_$$$_$$$_$$$_$$$_$$$_$$$_$$$_$$$_$$$_$$$_" |
7 | "$_$$_$_$$_$_$$_$_$$_$_$$_$_$$_$_$$_$_$$_$_$$_$_$$_" |
8 | "$_$$$_$_$$$_$_$$$_$_$$$_$_$$$_$_$$$_$_$$$_$_$$$_" |
9 | "$$_$$$$_$$_$$$$_$$_$$$$_$$_$$$$_$$_$$$$_$$_$$$$_" |
10 | "$$$$_$$_$_$$_$$$$_$$_$_$$_$$$$_$$_$_$$_$$$$_$$_$_$$_" |
11 | "$$__$$__$$__$$__$$__$$__$$__$$__$$__$$__$$__$$__" |
12 | "$$$$$$__$$$$$$__$$$$$$__$$$$$$__$$$$$$__$$$$$$__" |
13 | "$$$_$$$__$$$_$$$__$$$_$$$__$$$_$$$__$$$_$$$__" |
14 | "$$___$$___$$___$$___$$___$$___$$___$$___$$___$$___" |
15 | "$_$___$_$___$_$___$_$___$_$___$_$___$_$___$_$___" |
16 | "$$$$$_____$$$$$_____$$$$$_____$$$$$_____$$$$$_____" |
See Also
Examples
Example 1
See multi_y.py (output).