From: Ruwan Budha Date: 2010-09-25T13:06:18+09:00 Subject: Re: Gruff graphs (r.*n){2} wrote: > On Sep 23, 6:27�pm, "(r.*n){2}" wrote: >> hy1 = Hash.new >> hy1.has_key?(time_all[i]) >> plotting y1 => (5, 10) >> plotting y2 => (5, 3) >> plotting y1 => (5, 10) >> plotting y2 => (5, 3) >> plotting y2 => (6, 5) >> plotting y2 => (7, 6) >> plotting y2 => (8, 7) >> plotting y2 => (9, 12) > > to make the times unique change: > time_all = [time1, time2].flatten.sort > > to > > time_all = [time1, time2].flatten.sort.uniq Thanks so much for the help.....I did something similar before you posted this answer but your answer did help me to refactor my code. Thank so much for your kind help. -- Posted via http://www.ruby-forum.com/.