Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Dear all,
Does anyone knows if we can set the titel of a plot with a variable.
Till now I change the plot titel in clicking on the plot area and changing the labels by hand.
I would like to have a solution where the label for the plot title is set by a variable without having to click on the plot area
Thank you
Patrice Bujard wrote:
Dear all,
Does anyone knows if we can set the titel of a plot with a variable.
Till now I change the plot titel in clicking on the plot area and changing the labels by hand.
I would like to have a solution where the label for the plot title is set by a variable without having to click on the plot area
There's no direct way, AFAIK (don't know about M15 or Prime), but there are a couple of 'tricks' that you can use. Essentially, you define your title variable (:=), evaluate it (=) and then place the evaluated region on top of the plot. You can play around with using a different Math Style and a white font to make the variable 'invisible' or just put a 'white' region on top of the variable name. Won't work for the y-axis title.
You could also use a 3D plot component (inserted as an object not from the menu/toolbar) and use VBScript to modify the title attributes.
See attached worksheet for examples.
Stuart
In additoin to Stuart's suggestions, there is one other approach. I have posted this worksheet (or an earlier version of it) before, but it didn't make it over from the old Collaboratory. It uses label components as titles.
Richard Jackson wrote:
In additoin to Stuart's suggestions, there is one other approach. I have posted this worksheet (or an earlier version of it) before, but it didn't make it over from the old Collaboratory. It uses label components as titles.
I'd forgotten about that one, Richard. Sorry.
However, as partial compensation, it might be worth pointing out that if somebody likes it enough then they can right click on the component, choose 'Export as Component', save it as an .mcm file, copy it to the MCM folder in their Mathcad installation, then double-click it to register it (although I had to browse for mgmreg.exe after double-clicking - I also did it by double-click mgmreg.exe and then browsing to the component). This will (should) make the component directly available from the Insert Component wizard.
Stuart
I'd forgotten about that one, Richard. Sorry.
What? You can't remember absolutely everything that was posted on the Collab, including stuff that's over five years old? You must try harder!
Richard Jackson wrote:
I'd forgotten about that one, Richard. Sorry.What? You can't remember absolutely everything that was posted on the Collab, including stuff that's over five years old? You must try harder!
You know, some days you just can't win.
I've got you telling me to try harder,
My wife telling me that I'm trying enough as it is
And my little green friend saying "Do, or do not. There is no 'try.'"
Nice example. Will defiantly come in handy.
Mike
Another method. I have embedded an Excel component and passed the text string to it.
The one advantage this has is the format of the title can be edited in Excel and you can pass title to each of the axis.
Mike
Mike Armstrong wrote:
Another method. I have embedded an Excel component and passed the text string to it.
The one advantage this has is the format of the title can be edited in Excel and you can pass title to each of the axis.
Mike
And that's one of the reasons why I've advocated both worksheet-level control of plot component attributes and quote-less formattable strings.
Stuart
eg,
or from thread http://collab.mathsoft.com/read?88340,12 - Aug 06
[edited message to address ambiguity in original - it should refer to strings and not specifically text regions; change higlighted]
Whilst Mathcad's stringtexthandling allows the user to handle a large range of tasks, I find that it suffers from some deficiencies in use.
1. String wrapping: A large string has the same display problem that a large maths expression has - it doesn't wrap at the right margin. This makes it difficult to examine the string and gives extraneous pages when printing a worksheet (unless 'single page width' is selected, of course).
2. Double Quote: The double quote string delimiters can be distracting when displaying a string and detract from a 'document' appearance.
3. Fixed Plain Text Font: The string displays in a fixed plain-text font, which is not always suitable for displaying complex textual information, or mixing greek and latin characters.
I would like to see an enhanced string display and entry capability that would allow the user to enter and display multi-line, mixed font text with attributes, and have the ability to turn off display of the double quotes. Given Mathcad's XML based file structure, an HTML type display might prove a convenient of implementing such a facility.
The display region should have (user-selectable)auto push-down, and drag-size handles.
'formatted' strings (or at least as I view them) would be just ordinary strings that contain the formatting tags. The modifications just provide additional functionality, mainly in the display of strings, ie.
1). Active HTML/XML Display, eg:
formatted: x="underlined greek text in red is bold" (or minus the quotes)
or
2). Passive Display (plain text): x="<u>underlined</u> <FONT FACE="Symbol">greek</FONT> text in <FONT COLOR="#FF0000"<red>/FONT> is
<b>bold</b>" (which is what you get now).
Oh, and did I mention:
Conversion of a Mathcad expression to XML and vice versa?
I dislike the way Mathcad handles strings, the double quote string delimiters look horrible and make it virtually impossible to present a results table through Mathcad alone.
The new format for tables in Prime is nice, but I have just noticed it has a major flaw. Results cannot directly be passed to a results table in Prime and therefore the newly implemented feature in only good for defining variables, useless results tables.
Mike
Another method. I have embedded an Excel component and passed the text string to it.
The one advantage this has is the format of the title can be edited in Excel and you can pass title to each of the axis.
Sorry I have only just noticed that the example didn't attached.
Please see attached.
Mike