Fitting a plot on GUI draw widget

23 views
Skip to first unread message

Berk

unread,
Nov 27, 2022, 3:02:12 PM11/27/22
to dislin-users
Hi,
Here is the problem I have. I can't fit GRAF into my GUI draw widget. I hope you can help me. I shared the code below. Thanks in advance.
Ekran görüntüsü 2022-11-27 225546.png

Here is the code:
call swgwin(1000,20,400,400)
call wgdraw(ip,ip_Ts)
call setxid(ip_Ts,'WIDGET')
call metafl('XWIN')! Or 'CONS' same result 
call disini()
call axslen(1900,1900)
call center()
call winjus('CENTER')
call sclmod('FULL')
call graf(0.0,2000.0,0.0,400.0,0.0,700.0,0.0,50.0)
call pagera()
call endgrf()
call disfin    
call wgfin

Helmut Michels

unread,
Nov 28, 2022, 12:10:35 PM11/28/22
to dislin-users
Hi,

to fit the plot into the draw widget, the size of the draw widget and the size of the plot
should have the same ratio. For example, if your draw widget has the size 400 x 400
pixels, your plot can have the size 3000 * 3000 points.

         ....
         call page (3000, 3000)
         call sclmod ('full')
         call metafl ('xwin')
         call disini ()
         ....

Or, you can just adjust  the size of the draw widget to the size of the Dislin default page,
which 2970 x 2100 points.

For example, 

       call swgwin (1000, 20, 565, 400),

where the value 565 is calculated by (2970. / 2100.) * 400 and cut to an integer value.

With best regards,

Helmut

Berk

unread,
Nov 28, 2022, 2:05:16 PM11/28/22
to dislin-users
Thank you, Helmut. The first one worked fine.

Best regards,

M. Berk AZDURAL

28 Kasım 2022 Pazartesi tarihinde saat 20:10:35 UTC+3 itibarıyla mic...@dislin.de şunları yazdı:
Reply all
Reply to author
Forward
0 new messages