Yahoo France Recherche Web

Résultats de recherche

  1. 9 févr. 2012 · surprisingly I didn't find a straight-forward description on how to draw a circle with matplotlib.pyplot (please no pylab) taking as input center (x,y) and radius r. I tried some variants of this:

  2. See Draw a transparent rectangles and polygons in pygame. Hence you need to do a workaround: Create a pygame.Surface object with a per-pixel alpha format large enough to cover the shape. Draw the shape on the _Surface. Blend the Surface with the target Surface. blit () by default blends 2 Surfaces.

  3. 27 avr. 2012 · I'm looking for method that allow me to draw single pixel on display screen. For example when I click mouse, I want the position of clicked pixel to change color. I know how to read mouse pos, but I could not find simple pixel draw ( there is screen.fill method but it's not working as I want).

  4. 7 avr. 2016 · This will draw a line that passes through the points (-1, 1) and (12, 4), and another one that passes through the points (1, 3) et (10, 2) x1 are the x coordinates of the points for the first line, y1 are the y coordinates for the same -- the elements in x1 and y1 must be in sequence. x2 and y2 are the same for the other line.

  5. 1 juil. 2023 · A Surface can be created from an image with pygame.image.load: my_image_surface = pygame.image.load('my_image.jpg') However, the Pygame documentation notes that: The returned Surface will contain the same color format, colorkey and alpha transparency as the file it came from. You will often want to call convert() with no arguments, to create a ...

  6. 22 nov. 2013 · g.add_edge(5,4) nx.draw(g,with_labels=True) plt.draw() plt.show() This is just simple how to draw directed graph using python 3.x using networkx. just simple representation and can be modified and colored etc. See the generated graph here. Note: It's just a simple representation.

  7. 3 mars 2010 · 48. Here's the most straightforward way to create a drawing application with canvas: Attach a mousedown, mousemove, and mouseup event listener to the canvas DOM. on mousedown, get the mouse coordinates, and use the moveTo() method to position your drawing cursor and the beginPath() method to begin a new drawing path.

  8. I need to draw a horizontal line after some block, and I have three ways to do it: 1) Define a class h_line and add css features to it, like #css .hline { width:100%; height:1px; background: #fff...

  9. If you want fewer grid lines than tick labels (perhaps to mark landmark points such as first day of each month in a time-series etc.), one way is to draw gridlines using major tick positions but only show minor ticks. The following is an example that shows a grid line on the x-axis for every 3rd tick position.

  10. 30 déc. 2013 · my_font = pygame.font.SysFont('Comic Sans MS', 30) This creates a new object on which you can call the render method. text_surface = my_font.render('Some Text', False, (0, 0, 0)) This creates a new surface with text already drawn onto it. At the end you can just blit the text surface onto your main screen.

  1. Recherches associées