Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have tried to make a graph out of x,y co-ordinates from an area and display it using matplotlib but all the nodes sort of got overlapped as there is little difference between the when compared to the co-ordinates so I need a way to define a bounding box and the scale with which it is supposed to draw the graph [1]: http://imgur.com/6Hwc1

    for i in a:
        print i
        cur_point = tuple([float(x) for x in i.split(' ')])
        print cur_point
        assert len(cur_point) == 2
        if prev_point is not None:
            b = cur_point[1] - prev_point[1]
            c = cur_point[0] - prev_point[0]
            a = math.sqrt(b ** 2 + c ** 2)
            G.add_edge(cur_point, prev_point, weight=a)
        G.add_node(cur_point)
        posi[cur_point] = cur_point
        prev_point = cur_point
nx.draw(G, pos=posi)
plt.savefig('roads.png')
share|improve this question
    
Another possibility is to just rescale the coordinates of the vertices. –  utdiscant May 29 '12 at 10:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.