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 for Programming
 LabTalk Forum
 Inserting the title of a graph and other things

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
DrMorbid Posted - 08/26/2014 : 1:56:31 PM
Hello,

I cannot find anywhere (incl. the Labtalk manual) any information about how to insert a title just above the curves on the graphs I generate. I would like to simply place a name that follows the graph's long name. If not possible, then maybe insert a textbox somehow?

Also, is there any way of applying a theme for a graph via Labtalk and removing the legend?

Thank you!
4   L A T E S T    R E P L I E S    (Newest First)
DrMorbid Posted - 08/28/2014 : 09:47:41 AM
Thank you very much, this has worked! Much appreciated Greg.
greg Posted - 08/28/2014 : 09:44:37 AM
longname is a property, not an object so it does not support any dot methods.
You can use negative values, but since "-" is an option switch flag, you should protect your negative values with parentheses.

str$ = %(1,@WL);
str.trimright(".xls");
page.longname$ = str$;
label -j 1 -p 50 (-10) -s %(str$);

DrMorbid Posted - 08/27/2014 : 6:13:26 PM
Thank you Greg for replying, this is really helpful!

The "add/modify layer title" tool is exactly what I need to solve my first problem. Following your suggestions, I have found that I can use the label command to place text onto the graph:

page.longname$ = %(1,@WL);
page.longname$.TrimRight(". x l s");
label -j 1 -p 50 0 -s %(page.longname$)

However, I cannot use negative % values, would just need the label to be a bit higher from the centre of the graph. Also, the TrimRight function for some reason does not work for me, I would love to trim the file extension.

Thank you again! The advice with the legend is so simple!
greg Posted - 08/27/2014 : 11:45:53 AM
Text can be added anywhere on your graph using the Text tool or right-click context menu.

The right-click context menu also has an option to "Add/Modify Layer Title" which edits a text object that sits on the top-center of a layer.

I am not sure what you mean by "follows the graph's long name". If you are referring to the graph window, then text like this:
%(page.label$) with substitution level of 1 (See Programming Control) will show the page Long Name or nothing if there is none.

Themes can only add properties, they cannot remove objects.

It's unfortunate, but some of our code generates the legend even if you save a template with no legend. You have to actually modify our code to correct this.

For example:
Create a Symbol : Scatter plot
Delete the Legend
Save the Template as Scatter
Plot again
==> The legend is back

Now, go back to the worksheet, select a Y column, hold down the Shift and Ctrl key and choose Plot : Symbol : Scatter.
That will open our Code Builder to a line in PLOT.OGS:
run.section(,general,201 Scatter 0);
(or similar for other plot types.)
That executes a call to the [General] section whcih can be found several lines above.

You should see some code like:
worksheet -P %1 %2;
Legend;
return 0;
which you can change to:
worksheet -P %1 %2;
// Legend;
return 0;
Press Ctrl+S to save the file.
Now create another Scatter graph and no legend will be generated.

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