Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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]:

    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)
        posi[cur_point] = cur_point
        prev_point = cur_point
nx.draw(G, pos=posi)
share|cite|improve this question
Another possibility is to just rescale the coordinates of the vertices. – utdiscant May 29 '12 at 10:14

Your Answer


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

Browse other questions tagged or ask your own question.