draw

How to undraw plot with Zelle graphics?

删除回忆录丶 提交于 2020-01-17 12:41:59
问题 This is a code problem for Python 3.5.2 using John Zelle's graphics.py : I have spent a good amount of time looking for the answer here, but just can not figure it out. The function undraw() exists just like getMouse() . But it seems like it do not work for the plot() command, only the draw() command. What am I doing wrong? And how can I keep the window open, but erase the previous the plot before the next one is drawn? pdf documentation for the functions of graphics : http://mcsp.wartburg

How to undraw plot with Zelle graphics?

人盡茶涼 提交于 2020-01-17 12:41:05
问题 This is a code problem for Python 3.5.2 using John Zelle's graphics.py : I have spent a good amount of time looking for the answer here, but just can not figure it out. The function undraw() exists just like getMouse() . But it seems like it do not work for the plot() command, only the draw() command. What am I doing wrong? And how can I keep the window open, but erase the previous the plot before the next one is drawn? pdf documentation for the functions of graphics : http://mcsp.wartburg

Draw an ellipse sqrt-based function

…衆ロ難τιáo~ 提交于 2020-01-17 12:24:09
问题 I'm trying to make a function in Lua or VB based code to draw / plot an ellipse and also a filled ellipse. I don't have much knowledge about this math and I can use some help. I googled everything there is to google about drawing ellipses with code but I can't find a good simple working example that i can code into my Lua / VB code. here are a few websites i visited but couldn't make the code work or couldn't convert the code to Lua or VB properly... https://sites.google.com/site/ruslancray

keep new image when drawing lines by dragging the mouse in matlab

无人久伴 提交于 2020-01-16 17:31:38
问题 I am new in matlab GUI. I want to drawing lines by dragging the mouse. I found this issue but I want save new image with drawn lines. If i run this line, it will show me the same image. imshow(im); How can I get new image with drawn lines and for example show it? 回答1: You can also grab the image data directly in the Command Prompt. Once you draw all of your lines on your figure window, you can use getframe , which takes a snapshot of the current frame in focus. In this case, this should be

ImageDraw.text writes through the image borders

杀马特。学长 韩版系。学妹 提交于 2020-01-16 05:33:08
问题 I am trying to write text to an image. (It is part of a script that will hundreds of files and make hundreds of images) The only problem is that the function I want to use to write text to an image, seems to ignore my string's new lines. I looked at the ImageDraw documentation in the PIL reference, but it does not even touch on this. Others seem to be using this function for small text like signatures and watermarks. Unfortunately I need to be converting text to an image, as part of a larger

How to set the origin to O and remove the zero labels in Maxima draw?

元气小坏坏 提交于 2020-01-15 12:46:06
问题 The draw (2d) function in Maxima has several settings to control the axis, but as far as I can tell, none that hides the zero label of the xy-axis and to replace it with either a 0 or a O. Maybe that's possible to use with the option user_preamble? 回答1: You will need to set the xtics and ytics values explicitly, omitting the origin, and use label to label the origin. load(draw)$ draw2d( user_preamble="set zeroaxis linetype 5; set xtics axis; set ytics axis; set border 0;", xtics={-3, -2, -1,

how to draw circle using Multitouch

故事扮演 提交于 2020-01-15 09:48:17
问题 i had searched about Multitouch & i got lots of example related to pich zoom in & zoom out & getting multiple touch coordinates but i want to use multitouch to draw a circle on a view.. i tried this but when i draw it the coordinates changes the circle didn't draw at the exact place where i touch the screen.. here is the CODE.... public class TestMultiTouchActivity extends Activity { public class MultiTouchView extends View { // In this test, handle maximum of 2 pointer final int MAX_POINT

Python OpenCV: mouse callback for drawing rectangle

淺唱寂寞╮ 提交于 2020-01-14 18:43:50
问题 I want to save an image from the video stream and then draw a rectangle onto the shown image to produce a region of interest. Later, save that ROI in a file. I used opencv python grabcut example to use the setMouseCallback function. But I don't know what I'm doing incorrect as it is not giving the result I expect. I would like to see the green rectangle drawn on the static image shown in mouse input window and the roi being saved to file. Please help debug this code or show a better approach:

Object following custom path

感情迁移 提交于 2020-01-14 04:05:00
问题 I'm working on 2d game dev project. It's some kind of board game. As background I have board game with path, that isn't real circle, but some kind of wavy line. Objects are moving across that path. On touch event...I need to my player's object get at that exact position, but they need to follow that path. How to translate (draw) objects over some custom path? 回答1: You could draw your path (i.e. your wavy line) using an actual Path object onto the Canvas , and then use PathMeasure to calculate

Explicit vertex position in python graph-tool

烂漫一生 提交于 2020-01-13 10:00:11
问题 I am using python graph-tool. To draw graphs, it uses graph_draw function. I want to send vertex positions explicitly to dot engine. It turns out that I can pass a property map named pos . I tried defining it as v_pos = g.new_vertex_property("vector<double>") where g is my graph. I am not sure if it is the right way to do it. There is one code snippet which you might find helpful. pos = gt.random_layout(g, shape=shape, dim=3) >>> pos[g.vertex(0)].a array([ 86.59969709, 1.31435598, 0.64651486]