Attachment 'DeepWood_draw.py'

Download

   1 #!/usr/bin/env python3
   2 '''
   3 '''
   4 
   5 import matplotlib.pyplot as plt
   6 from matplotlib.patches import Circle
   7 import sys
   8 
   9 #circle3 = plt.Circle((1, 1), 0.2, color='g', clip_on=False)
  10 Circles = [Circle((x, y), r, color="DarkSeaGreen") for x, y ,r in eval(input())]
  11 X, Y = eval(input())
  12 
  13 fig, ax = plt.subplots()
  14 #ax.add_artist(plt.Circle((x,y), r, color='DarkSeaGreen'))
  15 for c in Circles:
  16     ax.add_patch(c)
  17 x, y, fig = None, None, []
  18 for s in sys.stdin:
  19     if (x,y) == eval(s):
  20         ax.plot([X, x], [Y, y], color="red")
  21     else:
  22         x, y = eval(s)
  23         ax.plot([X, x], [Y, y], color="grey", linewidth=0.3)
  24 plt.plot(X, Y, "bo")
  25         
  26 
  27 plt.show()

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.

You are not allowed to attach a file to this page.