def plot(pinName, marker = nil)
      prepare_plot if field.nil?
      if plottable && pinName.is_a?(String) && /ground/ =~ pinName.downcase
        add_grounds('G')
      elsif plottable && pinName.is_a?(String) && /power/ =~ pinName.downcase
        add_power('P')
      elsif plottable && pinName.is_a?(String)
        found_pins = []
        owner.pins.map { |pin| found_pins << pin[1] if /#{pinName}/ =~ pin[1].name.to_s || /#{pinName}/ =~ pin[1].group.to_s }
        if found_pins.size == 1 && marker.nil?
          marker = initial(pinName.to_s)
          while @groups.index { |grpName| grpName =~ /#{marker} -/ }
            marker.next!
            marker = '0' unless marker.size < 2
          end
          coordinates = coordinate(found_pins[0].location)
          @field[coordinates[0]][coordinates[1]] = [marker.white_on_blue + ' ']
          @groups.delete_if { |group| /#{pinName.to_s}/ =~ group }
          @groups << "#{marker} - #{found_pins[0].name} - #{found_pins[0].location}"
        elsif found_pins.size == 1
          coordinates = coordinate(found_pins[0].location)
          @field[coordinates[0]][coordinates[1]] = [marker.white_on_blue + ' ']
          @groups.delete_if { |group| /#{pinName.to_s}/ =~ group }
          @groups << "#{marker} - #{found_pins[0].name} - #{found_pins[0].location}"
        else
          if marker.nil?
            marker = initial(pinName.to_s)
            while @groups.index { |grpName| grpName =~ /#{marker} -/ }
              marker.next!
              marker = '0' unless marker.size < 2
            end
          end
          reg_state = quote_regex(pinName)
          found_pins.each do |item|
            begin
              coordinates = coordinate(item.location)
              @field[coordinates[0]][coordinates[1]] = [marker + ' ']
              @groups.delete_if { |group| "#{marker} - \"#{reg_state}\"" == group }
              @groups << "#{marker} - \"#{pinName}\""
            rescue
              raise "\n#{item} doesn't appear to have a physical location in this configuration."
            end
          end
        end
        generate_field
      else
        puts 'Unsupported argument type.'
      end
    end
def plot(pinName, marker = nil)
      prepare_plot if field.nil?
      if plottable && pinName.is_a?(String) && /ground/ =~ pinName.downcase
        add_grounds('G')
      elsif plottable && pinName.is_a?(String) && /power/ =~ pinName.downcase
        add_power('P')
      elsif plottable && pinName.is_a?(String)
        found_pins = []
        owner.pins.map { |pin| found_pins << pin[1] if /#{pinName}/ =~ pin[1].name.to_s || /#{pinName}/ =~ pin[1].group.to_s }
        if found_pins.size == 1 && marker.nil?
          marker = initial(pinName.to_s)
          while @groups.index { |grpName| grpName =~ /#{marker} -/ }
            marker.next!
            marker = '0' unless marker.size < 2
          end
          coordinates = coordinate(found_pins[0].location)
          @field[coordinates[0]][coordinates[1]] = [marker.white_on_blue + ' ']
          @groups.delete_if { |group| /#{pinName.to_s}/ =~ group }
          @groups << "#{marker} - #{found_pins[0].name} - #{found_pins[0].location}"
        elsif found_pins.size == 1
          coordinates = coordinate(found_pins[0].location)
          @field[coordinates[0]][coordinates[1]] = [marker.white_on_blue + ' ']
          @groups.delete_if { |group| /#{pinName.to_s}/ =~ group }
          @groups << "#{marker} - #{found_pins[0].name} - #{found_pins[0].location}"
        else
          if marker.nil?
            marker = initial(pinName.to_s)
            while @groups.index { |grpName| grpName =~ /#{marker} -/ }
              marker.next!
              marker = '0' unless marker.size < 2
            end
          end
          reg_state = quote_regex(pinName)
          found_pins.each do |item|
            begin
              coordinates = coordinate(item.location)
              @field[coordinates[0]][coordinates[1]] = [marker + ' ']
              @groups.delete_if { |group| "#{marker} - \"#{reg_state}\"" == group }
              @groups << "#{marker} - \"#{pinName}\""
            rescue
              raise "\n#{item} doesn't appear to have a physical location in this configuration."
            end
          end
        end
        generate_field
      else
        puts 'Unsupported argument type.'
      end
    end
.plot can be called explicitly and accepts string arguments with
  or without regex styling. For example:

    $dut.package = :t4240
    $dut.package.plot("ddr_interface") # plots all "ddr interface" groups
    $dut.package.plot("grounds") # adds ground pins to the previously instantiated plot
    $dut.package.plot("d1_mdq37","$") # plots controller 1 mdq 37, and uses $ as a legend marker
    $dut.package.plot("d2_mdq[3-6]0) # plots d2_mdq30, d2_mdq40, d2_md520, and d2_md620