Plot rows with similar name on the same graph
<p>That's the data which I would like to plot:</p>

<pre><code>structure(list(`10` = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 
               `34` = c(0, 0, 0, 0, 0, 0, 0, 0, 547725, 0), 
               `59` = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 
               `84` = c(0, 0, 0, 8173070.8, 0, 0, 0, 0, 0, 0), 
               `110` = c(0, 0, 0, 20302893.6, 0, 0, 0, 0, 0, 0), 
               `134` = c(0, 0, 0, 13696077.5, 0, 0, 0, 0, 0, 0), 
               `165` = c(1024325, 0, 0, 10486165.5, 0, 0, 0, 0, 0, 0), 
               `199` = c(1183267.5, 0, 0, 6015700, 0, 0, 0, 0, 0, 0), 
               `234` = c(1771708.3, 0, 0, 3384495.8, 3384495.8, 0, 0, 0, 0, 1144700), 
               `257` = c(2007712.3, 0, 0, 0, 6980230.6, 0, 0, 0, 0, 0), 
               `362` = c(3339118.9, 0, 0, 0, 7280030.6, 1119625, 0, 0, 0, 0), 
               `433` = c(973797.9, 0, 0, 0, 6230170, 1497625, 0, 0, 0, 0), 
               `506` = c(0, 0, 0, 0, 12905925, 0, 0, 0, 0, 0), 
               `581` = c(0, 2140050, 0, 0, 4560645.8, 0, 3170133.3, 0, 0, 0), 
               `652` = c(0, 639437.7, 639437.7, 0, 2349711.3, 0, 902318.3, 902318.3, 0, 0), 
               `733` = c(0, 0, 1397257.5, 0, 2274710, 0, 0, 1414458.3, 0, 0), 
               `818` = c(0, 0, 742731.8, 0, 2953550, 0, 0, 563876.7, 0, 0), 
               `896` = c(0, 0, 714654.7, 0, 1199563.3, 0, 0, 561000, 0, 0), 
               `972` = c(0, 0, 434271.5, 0, 1358225, 0, 0, 0, 0, 0), 
               `1039` = c(0, 0, 227435, 0, 934840, 0, 0, 0, 0, 0)), 
               .Names = c("10", "34", "59", "84", "110", "134", "165", "199", "234", "257", "362", "433", "506", "581", "652", "733", "818", "896", "972", "1039"), 
               row.names = c("Mark121_1", "Mark121_2", "Mark121_3", "Mark143_1", "Mark143_2", "Mark152_1", "Mark152_2", "Mark152_3", "Mark444_1", "Mark444_2"), 
               class = "data.frame")
</code></pre>

<p>I would like to put the lines for the rows which differ only in the number after <code>_</code> (dash) on the same plot. The different colors for the lines are necessary. I was thinking about using <code>matplot</code> but I have no idea how to select the rows with similar strings. </p>

<p>Using simple words I would like to have lines for:</p>

<ol>
<li>Mark121_*</li>
<li>Mark143_*</li>
<li>Mark152_*</li>
<li>Mark444_*</li>
</ol>

<p>on the same graph. It means 4 different graphs containing multiple lines.</p>