title: Text and lines in pycairo
body: <p>I'm having a little bit of trouble with pycairo. I want to draw a <a href="https://en.wikipedia.org/wiki/Chord_chart" rel="nofollow noreferrer">chord chart</a>, but for some reason I don't quite understand it only displays the text, not the lines it should be drawing.</p>
  
  <p>I use pygtk (3.0) and pycairo. <a href="https://i.stack.imgur.com/Ng5bD.png" rel="nofollow noreferrer">Here's the result of what this code draws</a></p>
  
  <p><a href="https://i.stack.imgur.com/Ng5bD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ng5bD.png" alt="enter image description here"></a></p>
  
  <p>Here's the code:</p>
  
  <pre><code>    def gen_chart(self, wid, cr):
  
              x = 10
              y = 60
  
              cr.set_source_rgb(0, 0, 0)
              cr.set_line_width(1)
              cr.select_font_face("Open Sans", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL)
              cr.set_font_size(40)
  
              cr.move_to(x, y)
              cr.line_to(x, y)
  
              counter = 1
              for measure in chord_list: # The list is declared earlier in the source                    
                      x += 10
                      for chord in measure:
                              cr.move_to(x, y)
                              cr.show_text(chord)
                              x += 100
                      if counter % 4 == 0 or counter == 4:
                              x = 10
                              y += 60
                              cr.move_to(x, y)
                              cr.line_to(x, y)
                              counter += 1
                      counter += 1
  
              cr.move_to(x, y + 10)
              cr.move_to(x, y + 10)
              cr.stroke()
  </code></pre>
  
  <p>Thanks in advance to anyone who can help me.</p>