The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 Labtalk: How to Draw Rectangle on Plot Layer

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
jdarland Posted - 01/07/1999 : 6:41:00 PM
Hi,

I have been trying to figure out a way draw a filled rectangle on a contour plot through Labtalk. I have the X,Y coords of the boundary. Ideally, I would like to fill the region in with a specific color.

The closest thing that I could find in the Labtalk manual was the dotool command. It is easy to select the rectangle tool, but I couldn't figure out a way to perform the "click-and-drag" programmatically.

Unfortunately, the size of the rectangle will vary from plot to plot, and as the axes are rescaled, which appears to prevent me from creating a graphic object and just reloading every time I generate a graph.

Any help would be greatly appreciated.

3   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 01/12/1999 : 3:18:00 PM
The Annotation tools (like Text, Arrows, Ellipses, etc.) were not designed with programming in mind, so you can't change object drawing order without the user making a selection and then using the Object Edit Toolbar to move the selected object to the Front or Back.


The Object Reference section of the LabTalkTM Manual contains a list of generic properties for Visual Objects created with the Toolbox Tools. Because the list is generic, some properties don't apply to every object. An Ellipse does not have text so the Text property is ignored. Similarly, the FillColor property is ignored by Text objects. Learn how to name these objects by searching the Help file for Object:naming.

[This message has been edited by Greg (edited 01-12-99).]

jdarland Posted - 01/08/1999 : 5:46:00 PM
Thanks Greg,

This helped quite a bit.

I had two follow up questions.

First, how would I go about (or is it possible to) overlay objects in a particlar order. (The equivalent of send back/bring forward). Objects appear to be added in back of objects that already exist on the window. I can add objects in a specific order to allow for some of the overlay consideration, but how would I change this on the fly programmatically? For example Rect1 overlays Rect2 in some instances, but how would I change this so that Rect2 overlays Rect1.

Second, I was unable to find reference to the method suggested by you for moving/resizing a rectangle in any of the Origin manuals/help files. This is probably because I am not looking in the correct place. Could you refer me to the appropriate location in the manuals for these types of operations.

Thanks again,
jeff

greg Posted - 01/08/1999 : 1:38:00 PM
You can not programmatically create rectangles using LabTalkTM.

You should create a Plot Template with one or more named samples of the kind of rectangle you need stored off the white of the page or set to invisible. You could then manipulate these objects through script. You must design these objects with pre-set Line type and Line Width and check Color, Pattern or Hollow because you will only be able to change the Border Color and the Fill Color.

Suppose I had such a rectangle named RECT1 which I stored as hidden. I could then run a script like:


RECT1.DX=.5;
RECT1.DY=1;
RECT1.X=5.75;
RECT1.Y=2.5;
RECT1.COLOR=4;
RECT1.FILLCOLOR=7;
RECT1.SHOW=1;

which would size and then position the rectangle in units of the X and Y scale, set the border to Blue (fourth in the color list), the fill color to Yellow (assuming the Color radiobutton for RECT1 is checked) and then unhide it.

Note that a rectangle's position is defined in terms of its center and the edges are at X±DX/2 and Y±DY/2.

[This message has been edited by Greg (edited 01-08-99).]


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000