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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Toolbox: Text plotting

LucMeekes
23-Emerald III

Toolbox: Text plotting

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

LucMeekes_0-1640470911541.png

Of course it runs in Prime Express...

 

Enjoy!

Luc

45 REPLIES 45
ttokoro
20-Turquoise
(To:SPRstructur)

image.png

SPRstructur
15-Moonstone
(To:ttokoro)

Thank u


@ttokoro wrote:

image.png




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

LucMeekes
23-Emerald III
(To:ttokoro)

Nice, but I would write your 3D functions as:

LucMeekes_0-1641478776846.png

There's no need to add an additional NaN bar at the top, because there is already one.

It's also fully ORIGIN aware.

Besides this function also works in Prime Express (The 3D plot unfortunately not 😞 ).

 

Success!

Luc

ttokoro
20-Turquoise
(To:LucMeekes)

Thanks Luc. I try to change ORIGIN=1 then Prime 7 shows error. May be your function below corresponds. T.Tokoro.

 

image.png

LucMeekes
23-Emerald III
(To:ttokoro)

You're right. There's an error in one of my functions. I'll try to find a solution today.

 

Thanks!

Luc

LucMeekes
23-Emerald III
(To:LucMeekes)

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

 

Success!

Luc

Great @LucMeekes  both 2D &3D.big thank
maybe this last question hahaha. how to convert from Number to Text in Prime for Plot Number?
Best regards SPRSTRUCTURE

SPRstructur_0-1641552516537.png

 

LucMeekes
23-Emerald III
(To:SPRstructur)

Use the num2str() function:

LucMeekes_0-1641553163171.png

LucMeekes_1-1641553174204.png

LucMeekes_2-1641553221097.png

LucMeekes_3-1641553271689.png

 

Success!
Luc

 

ttokoro
20-Turquoise
(To:LucMeekes)

With angle q+Ctrl G. 

 

image.png

image.png

image.png

image.png

image.png

Werner_E
25-Diamond I
(To:LucMeekes)

@LucMeekes 

I just noticed some annoying extra points (which don't show when no Symbol is selected as they are separated by NaN's.

Especially the one at the lower left is a problem when trying to determine the width and height of a text in an attempt to center it because its independent from the text's starting point. It also may interfere with Primes autoscaling of plots.

I stumbled upon this when using text at starting positions very large and wondered why my attempt to determine the width of the text failed and returns much too large values (centering then throws the text way off the left margin of course).

I guess that the first two pair of values (scaling and starting position) are necessary when the data structure it used as an input to modifiers like Bold or Italic.
Probably the only solution is to cut off the first four or five rows and maybe also the last two after all modifiers are applied.

Werner_E_0-1730655829661.png

 

LucMeekes
23-Emerald III
(To:Werner_E)

Hi Werner,

 

Thanks for pointing that out. I think it's corrected now.

 

Luc

Werner_E
25-Diamond I
(To:LucMeekes)

That's sure better, but Primes plot auto-scaling would still consider the values in the first column even though the corresponding y-values are NaNs.
But I doubt that dealing with this minor problem would justify the big effort to change the data structure completely, e.g. to a 3 column matrix.

Nonetheless functions VCenter and HCenter (or maybe even HJustify with argument for left, center, right) would be welcome 😉

My way for horizontally center text which I used in the thread  Drawing a vertical line in plot  was using filterNaN which is not available in Express and I also did not keep the scaling value stored in the text data structure at the top.

StuartBruff
23-Emerald III
(To:LucMeekes)

Following on from using your excellent plotting toolbox in another thread, and revisiting your worksheet, I was wondering if I had missed a version that contains Greek (and Cyrillic) upper & lower case letters?

 

Stuart

 

Over on the other thread, not realizing that Tetsuro had done some work on the 3D rotation, but thinking Express, the subject of a general 2D rotation came up.  Has this already been addressed?

 

 

If not, ...

 

2024 11 03 H.png

 

2024 11 03 I.png

 

2024 11 03 J.png

 

The attached Mathcad Prime 10 worksheet uses programming, but only, AFAICT, for the examples and only because I didn't have my Express repcol and Concat to hand.

LucMeekes
23-Emerald III
(To:StuartBruff)

" I was wondering if I had missed a version that contains Greek (and Cyrillic) upper & lower case letters"

 

The version with Greeks and Cyrillics doesn't exist yet. I've been occupied with other (more?) interesting tasks...

 

Luc

StuartBruff
23-Emerald III
(To:LucMeekes)


@LucMeekes wrote:

" I was wondering if I had missed a version that contains Greek (and Cyrillic) upper & lower case letters"

 

The version with Greeks and Cyrillics doesn't exist yet. I've been occupied with other (more?) interesting tasks...

 

Luc


 

😄

 

Isn't that always the case?

 

Stuart

StuartBruff
23-Emerald III
(To:LucMeekes)


@LucMeekes wrote:

" I was wondering if I had missed a version that contains Greek (and Cyrillic) upper & lower case letters"

 

The version with Greeks and Cyrillics doesn't exist yet. I've been occupied with other (more?) interesting tasks...


 

I don't know if you've heard of Hershey Fonts, Luc, but ...

 

https://paulbourke.net/dataformats/hershey/

 

I had a quick play, but no brain cells were hurt during or, indeed, involved in the playing of said game.

 

Clearly, I (or someone else) needs to calculate an appropriate set of offset and scaling factors to convert the Hershey fonts to your scale ... or rewrite your string plotting functions accordingly.   I had to modify the method of indexing a character, as a simple subtraction of 32 from a character's code doesn't suffice for a minimal set of character vectors

 

Image from my import worksheet ...

 

2024 11 07 C.png

 

Rest are from your worksheet with character vectors copy-pasted from the import worksheet.

 

2024 11 07 D.png

 

2024 11 07 E.png

 

2024 11 07 F.png

 

Not Mathcad Express friendly at the moment, I'm afraid.   Nor reader friendly, either!

 

Stuart 

Announcements

Top Tags