cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

23-Emerald III

## Toolbox: Text plotting

Attached is a Prime 4 file that allows you to plot text in a graph, like:

Of course it runs in Prime Express...

Enjoy!

Luc

1 ACCEPTED SOLUTION

Accepted Solutions
23-Emerald III
(To:LucMeekes)

Corrected errors that prevented it from working with ORIGIN values other than 0.

Success!

Luc

36 REPLIES 36
24-Ruby II
(To:LucMeekes)

Thanks!

23-Emerald II
(To:LucMeekes)

Very neat, Luc.  Concise, too.

Stuart

15-Moonstone
(To:LucMeekes)

Thank you
Can I plot in 3D?

23-Emerald III
(To:SPRstructur)

I don't know. Prerequisite is that you have access to the full functionality of Prime. I'm limited to Express...

The text plotting functions create matrices of many rows and two columns. I think that for 3D plotting you'd need 3 columns. Now it's easy to augment the matrix with another row. Suppose T is the output of a text plotting function then you could add the third column with:

T:= augment(T,update1(0,last(T),0)+z)

to position your text on the x-y plane at elevation z.

The other thing is that the T will contain NaN values. I don't know if the 3D plots will accept them.

Success!

Luc

P.S. The better way to create the z-coordinates may be:

Which will preserve the NaN values.

24-Ruby V
(To:LucMeekes)

The other thing is that the T will contain NaN values. I don't know if the 3D plots will accept them.

While the 3D plot in Prime in no way can live up to that in real Mathcad, it has at least the advantage of accepting NaN's like the 2D plot in Mathcad does.

23-Emerald II
(To:Werner_E)

@Werner_E wrote:

The other thing is that the T will contain NaN values. I don't know if the 3D plots will accept them.

While the 3D plot in Prime in no way can live up to that in real Mathcad, it has at least the advantage of accepting NaN's like the 2D plot in Mathcad does.

I do have a problem when joining multiple meshes, though.  I can't work out why there's a dark banding where the NaNs live.

The MP7 variables hold 3D meshes. vector p holds the first 4 numbers in Tetsuro's 3D Plot argument list.

Stuart

(I was playing around with Tetsuro's worksheet to allow a vector of meshes as an argument to the 3D Plot component. The function meshmerge takes such a vector and places NaNs between each mesh to create a single mesh.  It works on vectors of both 3-column xyz coordinate lists and of xyz planes)

24-Ruby V
(To:StuartBruff)

Thats what I see in P6 (exchanging the NaN's for the imaginary unit 1j did not help and yields the same plot)

23-Emerald II
(To:Werner_E)

@Werner_E wrote:

Thats what I see in P6 (exchanging the NaN's for the imaginary unit 1j did not help and yields the same plot)

Interesting.  It would seem they project to some point on the backplane (they certainly don't project along the surface normals).   I wonder why they're black and grade into the yellow surface? Neither the surface fill nor the line colour is black.

That's a nuisance and somewhat restricts the technique's usefulness.  I wonder if they can put a patch in before Prime 8 gets released? And add colormaps?  (I love rhetorical questions ... 😈)

Sadly, either because I'm going blind or it's not there, I can't see any mention of Plot component improvements on the Roadmap.

Stuart

23-Emerald III
(To:StuartBruff)

I suppose some kind of improvement is already there, going from Werner's Prime 6, apparently showing that NaN is out there somewhere and the plot reaches out to it, to your Prime 7, where NaN's are some kind of black hole, the position of which is indeterminate...

What would you want Prime 8 to do further with it?

Luc

23-Emerald II
(To:LucMeekes)

@LucMeekes wrote:

I suppose some kind of improvement is already there, going from Werner's Prime 6, apparently showing that NaN is out there somewhere and the plot reaches out to it, to your Prime 7, where NaN's are some kind of black hole, the position of which is indeterminate...

What would you want Prime 8 to do further with it?

Luc

Yes, that's definitely an improvement.

However, was it intentional or just a side-effect of some other change?  If the former, why wasn't the colour gradation dealt with?

What would you want Prime 8 to do further with it?

Treat NaNs as a complete break in the surface, which is what they do for a non-filled mesh.  So, a filled surface would not have "NaN edge gradation".  Either that or revert to using & plotting nested 3D-meshes to handle objects with multiple surfaces.

It goes without saying that I want colormaps.  I'd also like to be able to set independent depth ranges for each plot entry (to address such cases as @-MFra- 's contour-mapped sliding surface ... or to have depth-positionable contour maps).

I had a list somewhere or other...

Stuart

... allow component to return complete parameter set (eg, as one nested array or by specific functions)
... allow user to programmatically set parameters (eg, pass back complete parameter set or by specific function)
... add capability to return plot image
... add capability to return plot data (eg, surface co-ordinates)
... see threads: (no longer exist as they weren't transferred over from the old Collaboratory)

The list is quite old and a few of the features are obsolete or irrelevant, but most are still valid, I think.

24-Ruby V
(To:StuartBruff)

Interesting.  It would seem they project to some point on the backplane (they certainly don't project along the surface normals).

That "center of projection" changes when I change the axis limits. It seems to be the center of the surrounding box.

Looks like they improved the shading algorithm a little bit when they went from P6 to P7.

I wonder if they can put a patch in before Prime 8 gets released? And add colormaps?  (I love rhetorical questions ... 😈)

Just be careful with your wishes! We wished they would improve 2D plotting an we got ... a badly integrated third party tool which does not support units and has a lot of other drawbacks.

23-Emerald II
(To:Werner_E)

@Werner_E wrote:

Interesting.  It would seem they project to some point on the backplane (they certainly don't project along the surface normals).

That "center of projection" changes when I change the axis limits. It seems to be the center of the surrounding box.

Looks like they improved the shading algorithm a little bit when they went from P6 to P7.

Thanks.  I thought that might be the case, but it's difficult to be certain from an image.

I wonder if they can put a patch in before Prime 8 gets released? And add colormaps?  (I love rhetorical questions ... 😈)

Just be careful with your wishes! We wished they would improve 2D plotting an we got ... a badly integrated third party tool which does not support units and has a lot of other drawbacks.

@RichardJ wrote:
 Stuart Bruff I'm not normally paranoid, but I'm beginning to think they do these things just to annoy me.

You are not paranoid. They do

20-Turquoise
(To:StuartBruff)

24-Ruby V
(To:StuartBruff)

Here is something strange (sligthtly off-topic) which I found while (unsuccessfully) playing around.

Is it a new unknown "unit"? At least its labelled  as such. 😉

In real Mathcad the result is simply NaN, as it should be IMHO.

OK, coming back to the topic (not the topic of the thread but that of the last discussions) I created this test sheet with a function returning NaN's in a specific region. The effect unfortunately is the same:

I noticed that while a move the region around with pressed left mouse button, the projection lines disappear:

The black shades which you see in P7 still are there and as soon as the left mouse button isn't pressed anymore, the projection lines magically reappear:

It looks like I was wrong and too hasty when I said that Prime would have the advantage over Mathcad to accept NaN's in the 3D plot 😞

23-Emerald III
(To:Werner_E)

The unit NaNi is not only unknown, it's also undefined:

Together with the double negation in the exponent of 10, this is a sign of serious trouble that should be reported to the officials!

Luc

24-Ruby V
(To:LucMeekes)

@LucMeekes wrote:

The unit NaNi is not only unknown, it's also undefined:

Together with the double negation in the exponent of 10, this is a sign of serious trouble that should be reported to the officials!

Of course I tried evaluating NaNi, too, and also found that its not defined 😉

Well, maybe this bug should be reported, but if PTC would be seriously interested in reported bugs, there would be an easy way to report them, regardless of whether you were paying for a licensed version, or are just using the evaluation version or the free express edition. There possibly would also be a sub-forum here in the forum, where bugs could be reported in an uncomplicated manner.
All that is not the case. But lately the Mathcad forum seems to have been taken notice of occasionally by PTC staff - maybe bugs reported here are being taken care of, who knows.

15-Moonstone
(To:LucMeekes)

@LucMeekes  If you could share another 3D Plot Function Sheet , it's the best.

that can apply in construction Text in 3D Modeling as picture  below or in general

20-Turquoise
(To:SPRstructur)

Using image data to plot the numbers by dots.

15-Moonstone
(To:ttokoro)

@ttokoro  when I change ORIGIN=1 not working well and number more than 9 it not appear that number

15-Moonstone
(To:ttokoro)

20-Turquoise
(To:SPRstructur)

now, n=0 to 99 you can 3D plot. If you want to change the ORIGIN to 1, you should change the program.

20-Turquoise
(To:ttokoro)

E** with both direction.

15-Moonstone
(To:ttokoro)

@ttokoro  I try to change ORIGIN=1 in program but error

20-Turquoise
(To:SPRstructur)

The one of ORIGIN free.

23-Emerald II
(To:ttokoro)

Nice.

15-Moonstone
(To:ttokoro)

@ttokoro that great , could you do for general for input Letter or Number no limit (not only 1 to 99)?
Best regard SPRStructure

20-Turquoise
(To:SPRstructur)

Using Luc's function, all letters and numbers you can plot as shown in  my post at 01-04-2022 11:14 AM.

20-Turquoise
(To:SPRstructur)

15-Moonstone
(To:ttokoro)

Thank u

@ttokoro wrote:

in my sheet I set Origin =1 so I can't use her. Could you convert for me for Origin=1?
Thank u

Announcements
Top Tags