# print("\n-----------printing some colormap values------------\n") print("color index 5 (NavyBlue) = ", cmap[5, :]) print("color index 10 (Purple) = ", cmap[10, :]) print("color index 15 (Gold) = ", cmap[15, :]) # # Retrieve some resource values of various types. # # Note that in order to retrieve some XY resources, like line colors, # dash patterns, markers, etc, you need to use the "xydspec" # attribute. This represents the DataSpec object which is created # internally whenever an XY plot is created. # cmap_len = Ngl.get_integer(wks, "wkColorMapLen") markers = Ngl.get_integer_array(xy.xydspec, "xyMarkers") thicknesses = Ngl.get_float_array(xy.xydspec, "xyLineThicknesses") line_mode = Ngl.get_string(xy.xydspec, "xyMarkLineMode") style = Ngl.get_integer(xy, "xyYStyle") print("\n-----------printing some resource values------------\n") print("color map len = ", cmap_len, " (should be 23)") print("markers = ", markers, " (should be [11 12 15 16])") print("thicknesses = ", thicknesses, " should be ([3. 4. 5. 6.])") print("mark/line mode = ", line_mode, " (should be 'MarkLines')") print("style = ", style, " (should be 1)") # # Here's another way to retrieve the color map. # del cmap
# print "\n-----------printing some colormap values------------\n" print "color index 5 (NavyBlue) = ",cmap[5,:] print "color index 10 (Purple) = ",cmap[10,:] print "color index 15 (Gold) = ",cmap[15,:] # # Retrieve some resource values of various types. # # Note that in order to retrieve some XY resources, like line colors, # dash patterns, markers, etc, you need to use the "xydspec" # attribute. This represents the DataSpec object which is created # internally whenever an XY plot is created. # cmap_len = Ngl.get_integer(wks,"wkColorMapLen") markers = Ngl.get_integer_array(xy.xydspec,"xyMarkers") thicknesses = Ngl.get_float_array(xy.xydspec,"xyLineThicknesses") line_mode = Ngl.get_string(xy.xydspec,"xyMarkLineMode") style = Ngl.get_integer(xy,"xyYStyle") print "\n-----------printing some resource values------------\n" print "color map len = ",cmap_len," (should be 23)" print "markers = ",markers," (should be [11 12 15 16])" print "thicknesses = ",thicknesses," should be ([3. 4. 5. 6.])" print "mark/line mode = ",line_mode," (should be 'MarkLines')" print "style = ",style," (should be 1)" # # Here's another way to retrieve the color map. # del cmap
# Arkansas : 02, group 8 # Arkansas : 03, group 7 # Arkansas : 04, group 6 # Arkansas : 05, group 5 # Arkansas : 06, group 6 # Arkansas : 07, group 4 # Arkansas : 08, group 7 # Arkansas : 09, group 4 # # From this, if you chose to use the default group numbers to color each # climate area, then climate areas (01,03,08) would be the same color, # (07,09) would be the same, and (04,06) would be the same, and # 02 and 05 would each be their own color. # anames = Ngl.get_string_array(map,"mpAreaNames") groups = Ngl.get_integer_array(map,"mpDynamicAreaGroups") # Areas 659 through 1116 are the states with their climates. # print(anames[659:1116] + ", group " + groups[659:1116]) states = ["Alabama", "Arizona", "Arkansas", "California", "Colorado",\ "Connecticut", "Delaware", "Florida", "Georgia", "Idaho",\ "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky",\ "Louisiana", "Maine", "Maryland", "Massasachusetts", "Michigan",\ "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", \ "Nevada", "New Hampshire", "New Jersey", "New Mexico", \ "New York", "North Carolina", "North Dakota", "Ohio", \ "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", \ "South Carolina", "South Dakota", "Tennessee", "Texas", \ "Utah", "Vermont", "Virginia", "Washington", "West Virginia",\ "Wisconsin", "Wyoming"]
# Arkansas : 02, group 8 # Arkansas : 03, group 7 # Arkansas : 04, group 6 # Arkansas : 05, group 5 # Arkansas : 06, group 6 # Arkansas : 07, group 4 # Arkansas : 08, group 7 # Arkansas : 09, group 4 # # From this, if you chose to use the default group numbers to color each # climate area, then climate areas (01,03,08) would be the same color, # (07,09) would be the same, and (04,06) would be the same, and # 02 and 05 would each be their own color. # anames = Ngl.get_string_array(map, "mpAreaNames") groups = Ngl.get_integer_array(map, "mpDynamicAreaGroups") # Areas 659 through 1116 are the states with their climates. # print(anames[659:1116] + ", group " + groups[659:1116]) states = ["Alabama", "Arizona", "Arkansas", "California", "Colorado",\ "Connecticut", "Delaware", "Florida", "Georgia", "Idaho",\ "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky",\ "Louisiana", "Maine", "Maryland", "Massasachusetts", "Michigan",\ "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", \ "Nevada", "New Hampshire", "New Jersey", "New Mexico", \ "New York", "North Carolina", "North Dakota", "Ohio", \ "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", \ "South Carolina", "South Dakota", "Tennessee", "Texas", \ "Utah", "Vermont", "Virginia", "Washington", "West Virginia",\ "Wisconsin", "Wyoming"]