Contents Previous Next Subchapters

Copying Maps in a Data Set
Syntax newMap = tpmapcopy(zone,map)
See Also tpopen , tpget , tpput , tpplot , tpaddzone

Creates a new line map by copying an existing line map which is specified by the integer scalar map. The integer scalar zone specifies an existing zone number that is to be used for the new map. The tpmapcopy function returns the number of the map that is created.

Use of the tpmapcopy function with the tpaddzone function is very useful for updating existing data sets. If you enter,
   fName = [OM_INSTALL,"\example\tecplot\rainfall.plt"] 
Tecplot will open the rainfall sample data file from your distribution. If you continue by entering
   rain = tpget("Dallas Rainfall")
   month = tpget("Month")
O-Matrix will transfer the data values for the Tecplot variables "Dallas Rainfall" and "Month" to O-Matrix. At this point the data set has 5 line maps and 5 zones. You can modify the rain variable in O-Matrix and update the plot by entering
   for i = 1 to 4 begin
      newZone = tpaddzone(rowdim(rain), coldim(rain) )
      tpmapcopy(newZone, 2);
      rain = rain + .25
      tpput(rain, "Dallas Rainfall", newZone)
      tpput(month, "Month", newZone)
This will create 4 new maps, where each map is created from the existing map number 2 which is the Dallas Rainfall map, and 4 new zones which contain the updated values for the rain variable in each iteration of the loop. When the file was opened, the Seattle Rainfall map was activated by default. This map can be disabled by entering
   tpmacrostring("$!ACTIVELINEMAPS -= [1]")
At which point you have the following updated plot