replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Set_plot_mode@(1) with draw_symbolsd@
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Set_plot_mode@(1) with draw_symbolsd@

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
Kenneth_Smith



Joined: 18 May 2012
Posts: 840
Location: Lanarkshire, Scotland.

PostPosted: Wed Sep 03, 2025 1:25 pm    Post subject: Set_plot_mode@(1) with draw_symbolsd@ Reply with quote

Paul,

Does the plot generated by the following code look as you would expect it to ?

I thought that draw_symbolsD@ would clip symbols outside the %pl[frame] with a similar behaviour to draw_polylined@?

Code:
module ex27_mod
use clrwin
implicit none
integer :: width=500, height=500
integer, parameter :: n = 21
real*8 :: x(n), y1(n), y2(n), y3(n)
contains

  integer function start()
  integer iw, i
  character(len=*),parameter :: fmt1='(22(I3,4(2X,F7.2)/))'
    x = [(i, i=-10,10,1)]
    y1 = [(x(i)**2, i = 1,n)] -5.d0
    y2 = y1 + 50.d0
    y3 = y2 + 40.d0
    write(*,fmt1) (i, x(i), y1(i), y2(i), y3(i), i = 1, n)
    iw = winio@('%fn[Arial]%ts%bg&',1.25d0,rgb@(220,220,220))
    call winop@('%pl[native,n_graphs=1,frame,x_array]')
    call winop@('%pl[link=user]')
    call winop@('%pl[margin=100]')
    call winop_flt@('%pl[x_min]',  -4.d0) ! Some points will be outside frame
    call winop_flt@('%pl[x_max]',   4.d0)
    call winop_flt@('%pl[y_min]',   0.d0)
    call winop_flt@('%pl[y_max]', 100.d0)   
    iw = winio@('%^pl',width,height,2,[0.d0,1.d0],[0.d0,1.d0],pl_cb)
    start = 2
  end function start

  integer function pl_cb()
    if (clearwin_string@('CALLBACK_REASON') .eq. 'PLOT_ADJUST') then
      call set_plot_mode@(1)
        call set_line_width@(2)
        call draw_polylined@(x,y1,n,rgb@(255,0,0))
        call draw_symbolsd@(x,y1,n,6,4,rgb@(255,0,0))
        call draw_polylined@(x,y2,n,rgb@(0,0,255))
        call draw_symbolsd@(x,y2,n,6,4,rgb@(0,0,255))
        call draw_polylined@(x,y3,n,rgb@(0,255,0))
        call draw_symbolsd@(x,y3,n,6,4,rgb@(0,255,0))
      call set_plot_mode@(0)       
    end if
    pl_cb = 2
  end function pl_cb
 
end module ex27_mod

program ex27
use ex27_mod
  i = start()
end program ex27
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8257
Location: Salford, UK

PostPosted: Mon Sep 08, 2025 6:33 am    Post subject: Reply with quote

Ken

Thank you for the feedback. I can see that the issue that needs fixing.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8257
Location: Salford, UK

PostPosted: Wed Sep 10, 2025 1:32 pm    Post subject: Reply with quote

Ken

The lack of a clipping rectangle is deliberate so that symbols can be drawn anywhere.

So I have added a mode = 2 to SET_PLOT_MODE@ and this has the desired effect of retaining the clipping rectangle for symbols.
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



Joined: 18 May 2012
Posts: 840
Location: Lanarkshire, Scotland.

PostPosted: Thu Sep 11, 2025 10:40 am    Post subject: Reply with quote

Thanks Paul, I understand your design basis now, and this also explains the absence of draw_symbols@ for integer pixel coordinates (which would also allow symbols to also be drawn anywhere).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group