Un able to print the value on canvas

17 views
Skip to first unread message

Balu Ram Ranwah

unread,
Jun 27, 2025, 5:25:42 AMJun 27
to MathGL
list a 11 12 13 14 | 21 22 23 24 | 31 32 33 34 | 41 42 43 44
xrange 0 3
yrange 0 3
for $x 0 3 1
 for $y 0 3 1
  text $x $y a($x,$y)
 next
next
I want to print a($x,$y) value but, it is not working. How can this value can be converted in text?
Any one can help me.

Alexey Balakin

unread,
Jun 27, 2025, 5:26:21 AMJun 27
to MathGL
Dear Balu Ram Ranwah,

Probably, you mean something like this

list a 11 12 13 14 | 21 22 23 24 | 31 32 33 34 | 41 42 43 44

xrange 0 3

yrange 0 3

for $x 0 3 1

for $y 0 3 1

text $x $y 'a($x,$y)=',a($x,$y)

next

next


or like this

list a 11 12 13 14 | 21 22 23 24 | 31 32 33 34 | 41 42 43 44

xrange 0 3

yrange 0 3

for $x 0 3 1

for $y 0 3 1

text $x $y '',a($x,$y)

next

next



пятница, 27 июня 2025 г. в 12:25:42 UTC+3, Balu Ram Ranwah:

Prfo B.R.Ranwah

unread,
Jun 29, 2025, 11:57:51 AMJun 29
to mat...@googlegroups.com
Thanks, it resolves my problem.

Prof. Balu Ram Ranwah
Ex. ICAR Emeritus Scientist
(Retd. Head, Dept. of PBG and Associate Director, Seed and Farms, MPUAT, Udaipur)
502 Sky Heights Apartment,
Meera Nagar, Bhuwana,
Udaipur - 313001



--
You received this message because you are subscribed to a topic in the Google Groups "MathGL" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mathgl/8j0Jw4CvT8E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mathgl+un...@googlegroups.com.
To view this discussion visit
https://groups.google.com/d/msgid/mathgl/d1e938e4-813d-4793-9db8-f5f462cfd03en%40googlegroups.com
.

Prfo B.R.Ranwah

unread,
Jun 30, 2025, 10:47:37 PMJun 30
to mat...@googlegroups.com
list a 11 12 13 14 | 21 22 23 24 | 31 32 33 34 | 41 42 43 44
xrange 0 3
yrange 0 3
font ['fnt'="size=-2]
for $x 0 3 1
 for $y 0 3 1
  text $x $y a.nx.ny a.ny.nx '@@',(a($x,$y)) 'b' 
 next
next

I am unable to reduce the font size of value either by using '@' or by using the fontsize function. Line 4 is wrong command and @@ reduce the size of first digit of value only. There are 2 queries
1. How to reduce font size of complete value?
2. Can we convert value in text string? 

Prof. Balu Ram Ranwah
Ex. ICAR Emeritus Scientist
(Retd. Head, Dept. of PBG and Associate Director, Seed and Farms, MPUAT, Udaipur)
502 Sky Heights Apartment,
Meera Nagar, Bhuwana,
Udaipur - 313001

On Friday 27 June, 2025 at 02:56:25 pm IST, Alexey Balakin <mathgl....@gmail.com> wrote:


--
You received this message because you are subscribed to a topic in the Google Groups "MathGL" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mathgl/8j0Jw4CvT8E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mathgl+un...@googlegroups.com.
To view this discussion visit

mathgl....@gmail.com

unread,
Jul 1, 2025, 4:43:05 PMJul 1
to mat...@googlegroups.com
Hi,

вт, 1 июл. 2025 г. в 05:47, Prfo B.R.Ranwah <brra...@gmail.com>:
list a 11 12 13 14 | 21 22 23 24 | 31 32 33 34 | 41 42 43 44
xrange 0 3
yrange 0 3
font ['fnt'="size=-2]
for $x 0 3 1
 for $y 0 3 1
  text $x $y a.nx.ny a.ny.nx '@@',(a($x,$y)) 'b' 
 next
next

I am unable to reduce the font size of value either by using '@' or by using the fontsize function. Line 4 is wrong command
Sure, the "[]" denote optional arguments in documentation. If you want to reduce all text size twice just use

font '' -0.5

If you want to return to the original font size after that, then you need

font '' -2
 
and @@ reduce the size of first digit of value only.
Yes, it influences the next block only (default is one character). In yours case just use "{}" around selected text like this

text $x $y a.nx.ny a.ny.nx '@{',a($x,$y),'}' 'b'
 
There are 2 queries
1. How to reduce font size of complete value?

Above I show 2 variants. The third one is use option "size", like following

text $x $y a.nx.ny a.ny.nx '',a($x,$y) 'b';size -0.7
 
2. Can we convert value in text string?

Sorry, but I don't understand the question. 

Do you mean plot it on the graphics? If yes then you do it above (any formula after string and comma will be converted to string). Also you can use the "table" command (see https://mathgl.sourceforge.net/doc_en/1D-plotting.html#table).

Or do you mean to print it in the console? If yes then just use "info '',a($x,$y)" for printing a number, or "echo a" for printing the whole array, or "info a" for printing properties of the array.
 
You received this message because you are subscribed to the Google Groups "MathGL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathgl+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mathgl/1063564914.804701.1751338046105%40mail.yahoo.com.


--
Kind regards,
Alexey Balakin

Prfo B.R.Ranwah

unread,
Jul 10, 2025, 8:03:31 PMJul 10
to mat...@googlegroups.com
Thank you very much for proving the solution. 

Prof. Balu Ram Ranwah
Ex. ICAR Emeritus Scientist
(Retd. Head, Dept. of PBG and Associate Director, Seed and Farms, MPUAT, Udaipur)
502 Sky Heights Apartment,
Meera Nagar, Bhuwana,
Udaipur - 313001

Prfo B.R.Ranwah

unread,
Aug 2, 2025, 8:11:23 PMAug 2
to mat...@googlegroups.com
Sir
I am unable to align the value 'ax' centrally between the points '-1 -1 1 1' . When I print it, it aligns left only. The command 'C' changes the color rather than alignment. 

subplot 1 1 0 '^'
define ax 2.45
text -1 -1 1 1 '',ax 'bC' ;size -.7

Regards

Prof. Balu Ram Ranwah
Ex. ICAR Emeritus Scientist
(Retd. Head, Dept. of PBG and Associate Director, Seed and Farms, MPUAT, Udaipur)
502 Sky Heights Apartment,
Meera Nagar, Bhuwana,
Udaipur - 313001

On Friday 27 June, 2025 at 02:56:25 pm IST, Alexey Balakin <mathgl....@gmail.com> wrote:


--
You received this message because you are subscribed to a topic in the Google Groups "MathGL" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mathgl/8j0Jw4CvT8E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mathgl+un...@googlegroups.com.
To view this discussion visit
Reply all
Reply to author
Forward
0 new messages