def draw(self): """ private static final int warning = Color.argb(255, 255, 50, 12); """ axes = plt.gca() axes.add_patch(Poly(self.corners, color=self.c1)) if self.status == 'next_gate': axes.add_patch(Poly(self.corners, facecolor=self.c1, edgecolor='green')) axes.add_patch(Poly(self.top, facecolor=self.c2)) axes.add_patch(Poly(self.bottom, facecolor=self.c3))
def Draw(self, gamecolor=True): c1 = [251. / 255, 216. / 255, 114. / 255] c2 = [255. / 255, 50. / 255, 12. / 255] c3 = [255. / 255, 12. / 255, 150. / 255] ce = [0, 0, 0] if not gamecolor: c1 = [0.95, 0.95, 0.95] c2 = [0.75, 0.75, 0.75] c3 = [0.75, 0.75, 0.75] ce = [0.66, 0.66, 0.66] axes = plt.gca() axes.add_patch(Poly(ArrayToTuples(self.corners), color=c1)) axes.add_patch(Poly(ArrayToTuples(self.top), color=c2)) axes.add_patch(Poly(ArrayToTuples(self.bottom), color=c3))
def _draw_needle(self): axes = plt.gca() axes.add_patch( Poly(array_to_tuples(self.corners), color=self.needle_color))
def draw(self): ''' update damage and surface color ''' #self.compute_damage() #self.update_color() # based on the amount of damage axes = plt.gca() axes.add_patch(Poly(array_to_tuples(self.corners), color=self.color))
elo_1 = Ellipse(HORIZONTAL_AXE_REFERENCE, VERTICAL_AXE_REFERENCE) elo_2 = Ellipse(HORIZONTAL_AXE_INTERSECT, VERTICAL_AXE_INTERSECT) find_distance_for_half_intersect(elo_1, elo_2) x, y = elo_1.polygon.exterior.xy i, j = elo_2.polygon.exterior.xy k, l = elo_1.intersection(elo_2).exterior.xy fig, ax = plt.subplots() polygons = [] num_polygons = 2 num_sides = 5 polygon = Poly(zip(x, y), True) polygons.append(polygon) polygon = Poly(zip(i, j), True) polygons.append(polygon) polygon = Poly(zip(k, l), True) polygons.append(polygon) p = PatchCollection(polygons, cmap=matplotlib.cm.jet, alpha=0.4) colors = 100 * np.random.rand(len(polygons)) p.set_array(np.array(colors)) ax.axhline(y=0, color='k') ax.axvline(x=0, color='k') ax.add_collection(p) lim = max(elo_2.b, elo_2.a) plt.ylim((-2 * lim, 2 * lim))
def draw_needle(self): axes = plt.gca() axes.add_patch( Poly(ArrayToTuples(self.corners), color=self.needle_color))
def Draw(self): axes = plt.gca() axes.add_patch(Poly(ArrayToTuples(self.corners), color=self.color))
def _draw_needle(self): axes = plt.gca() axes.add_patch(Poly(self.corners, color=self.needle_color))
def draw(self): ''' update damage and surface color ''' axes = plt.gca() axes.add_patch(Poly(self.corners, color=self.color))