From: Evan C. <eva...@gm...> - 2017-02-13 20:51:36
|
For a variety of reasons, I need to be able to plot a vertical line, wrt to the horizontal axis, in a plot. For the life of me, I'm not sure how to do this using wxdraw2d (or if its even possible). Suppose I want a simply x-y plot, with a horizontal line at y=200 over all x, and a vertical line at x=100 over all y. First, I call a few things, and set some defaults: load("draw")$ set_draw_defaults( grid=true, xaxis = true, yaxis = true, xaxis_type = solid, yaxis_type = solid, proportional_axes=xy)$ wxplot_size: [250, 250] $ wxdraw2d(x_voxel = 100, y_voxel = 100, line_width=2,color="black", explicit(200,x,0,250), /* horizontal line */ explicit(100,y,0,250)); /* vertical */; But, this doesn't work. It seems that explicit within wxdraw2d must be a function in x.If thats the case, then how the heck would you ever draw something like...x=100 over all y? In other words, a vertical reference line? The only way I could 'get something to work' seems like a kludge -- using polygon: wxdraw2d( line_width=2,color="black", explicit(200,x,0,250), /* horizontal line */ polygon([100,100],[0,250])); /* vertical */; Does the trick but...is there a better way that I'm missing? Thanks! |