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 

Native %pl
Goto page Previous  1, 2, 3 ... 16, 17, 18 ... 26, 27, 28  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Thu Nov 16, 2017 8:52 am    Post subject: Reply with quote

Your point about the over-crowded scales on axes is a very good one Dan and has been a recurrent theme since the testing began.

Maybe the 'easy' short-term workaround (at least until correct automated generation is integrated) would be if not just the end points but also the spacing could be user-input ?

Another for Paul to chew over that one.

Even better if major and minor ticks spacing could be input.

... but only after all the other glitches are remediated as priority.

The eventual ideal of course would be either fully automated or fully user-input specification, or indeed a mix, but that would be getting ahead of ourselves a little.

To be honest I'm getting a little lost as to which things have been fixed, which not yet attacked and which are supposed to have been fixed biut still cause problems. And of what exactly to expect fixed in v8.2, and what's on Paul's wish-list relating to native %pl.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Thu Nov 16, 2017 9:02 am    Post subject: Reply with quote

oops ! I just saw that you already suggested the user-input spacing back on 26th April Dan ! goog grief this thread has been keeping us 'amused' for 7 months already ! (not to mention the previous 2 with the same title ! )
Tempus fugit when you're enjoying(?) yourself eh !

That plot you refer posted on p. 16 (and you first posted on p.1) I didn't quite follow, is that now do-able in %pl then ? (apart from the photoshopping of the scales that is)
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Nov 16, 2017 9:04 am    Post subject: Reply with quote

John

I am not sure if this is what you want but there are already options [dx=fval] and [dy=fval] to specify the preferred interval between tick marks.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Thu Nov 16, 2017 11:56 pm    Post subject: Reply with quote

Thanks Paul, indeed, the dx and dy allows the fine tuning of amount of numbering labels. I updated the code above on page 15 to include the dx and dy steps

Code:
CALL winop@("%pl[dx=0.1,dy=0.1]")
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Sat Nov 18, 2017 3:34 am    Post subject: Reply with quote

UPDATE.
After further play with this feature i found that it only worked for this specific sizes around 900x600. When i took much larger plot size for example 3600 x 2000 (initially or after resize using mouse) the program forgets this 0.1 step and starts to behave like before, placing large amount of numbers with smaller then user requested dx and dy steps.

I understand that if labels become too crowded that they start to overlap the code should decrease their amount up to just one label or even zero for very small thumbnail images, but for larger images the dx=fval and dy=fval have to stay as user requested, in our example dx=0.1, dy=0.1

Also is it planned to have something like this to update dynamically ?
Code:
CALL winop@("%pl[dx@]",dx_dval)
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Sat Nov 18, 2017 4:11 am    Post subject: Reply with quote

From the documentation:-

Quote:
dx and dy are only for linear scales and will not always be adopted.


... still some work to do to achieve a certain lvel of robustability then.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Sat Nov 18, 2017 4:44 am    Post subject: Reply with quote

Dan, trying your modified p.15 code and shrinking the window I got this ....



Note ....
1) the axes rescale but there's no re-plotting of the contours
2) the progress bar slips leftwards as the window is re-sized horizontally until it drops off the window ! that's why it isn't there on this plot.
This might be a bug, not sure.
3) the axis labels remain same size and are effectively squeezed partly off the graphic surface when reduced in size.
4) the x-axis end labels are still different format (as I mentioned previously) and the y-axis '0.0' is missing.
Interesting that if you shrink even more in vertical sense, when the scale changes to accomodate (it doesn't immediately so there's a stage where overlapping of the labels occurs) then *p-zam!* the 0.0 appears !
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Sat Nov 18, 2017 7:08 am    Post subject: Reply with quote

John,
1) I have no problems that even if dx, dy are set by the user - on the plot they are flexible. This flexibility is needed because when you shrink the size of plot the numbering eventually will be too crowded (which again requires very good universal label placement which works without dx, dy).
But when the spacings between numbering labels are OK and you increase plot size there is no reason for code to modify spacing the user intentionally set to adjust better numbering
2) Does my code work like that (showing nothing) for all sizes? I ran it and it works OK no matter what size.
3) Added %nr.

Paul,
Looks like get_plot_point@ has a bug. Look at this code which plots line from min left to max right of screen. Code places point at (X,Y) = (1,1). Try to change limits in small range and see all is OK until min values become positive

Code:
module surfplot2mod
   use clrwin
   integer (7) ihandleSP2
   real*8 x(2),y(2), xEllipse, yEllipse
   real*8 xAxisMin, xAxisMax, yAxisMin, yAxisMax

CONTAINS
   INTEGER FUNCTION plotSP()

   x(1)=xAxisMin
   x(2)=xAxisMax
   y(1)=yAxisMin
   y(2)=yAxisMax

   call simpleplot_redraw@

   ixR=7; iYr=7
   call get_plot_point@(1d0, 1d0, xEllipse, yEllipse)
   call draw_filled_ellipse@ (nint(xEllipse), nint(yEllipse),ixR,iYr,rgb@(244,0,0) )
   call UPDATE_WINDOW@(ihandleSP2)

   plotSP= 2
   end function plotSP
!......................................................
   INTEGER FUNCTION clearPL()
     INTEGER errstate
     errstate = change_plot_int@(0,"link",graph1,link_none)
     CALL simpleplot_redraw@()
     clearPL = 2
   END FUNCTION clearPL

end module surfplot2mod

!.......................
Program SurfPlot2
use surfplot2mod

   xAxisMin =-4
   xAxisMax = 5
   yAxisMin =-4
   yAxisMax = 5

   x(1)=xAxisMin
   x(2)=xAxisMax
   y(1)=yAxisMin
   y(2)=yAxisMax

   i = winio@  ('%ww%nr&')                           
   call winop@ ('%pl[native,x_array,N_GRAPHS=1]')
   call winop@ ('%pl[scale=linear]')

   CALL winop@("%pl[tick_len=9]")
   CALL winop@("%pl[dx=1.]") 
   CALL winop@("%pl[dy=1.]") 

   i = winio@  ('%sf%ts%bf&', 2d0)   

   call winop@ ("%pl[framed,axes_pen=3,width=3,x_axis='Length',y_axis='Width']")

   i = winio@  ('%pv%pl&',800,600,2,x,y)!
   i = winio@  ('%sf%ts%ff&', 1d0)

   i = winio@  ('Set Xmin, Xmax%ta%df%9^rf%df%9^rf%ff&', 1d0,xAxisMin,'+', clearPL, plotSP,  1d0, xAxisMax,'+', clearPL, plotSP)
   i = winio@  ('Set Ymin, Ymax%ta%df%9^rf%df%9^rf%ff&', 1d0,yAxisMin,'+', clearPL, plotSP,  1d0, yAxisMax,'+', clearPL, plotSP)

   i = winio@  ('%cn%^bt[PLOT]%^bt[Clear]%ff&', '+', clearPL, plotSP, clearPL)

   i = winio@  ('%ac[Esc]&', 'exit')
   i = winio@  ('%hw%lw', ihandleSP2, lw_SP2)     

   jj = plotSP()

   end

Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sat Nov 18, 2017 9:52 am    Post subject: Reply with quote

I can't see a problem at the moment.
Which "min values" are you referring to?
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



Joined: 18 May 2012
Posts: 697
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Sat Nov 18, 2017 10:29 am    Post subject: Reply with quote

Paul,
Apologies for raising this again, but can I reiterate my suggestion for an option to place the text for the scales external to the frame. It's one limitation of the present %pl which I cannot devise a "work around" before the call to %pl, and it really spoils plots like this one.



In this example I am drawing the circles after the plot is formed (there is an invisible graph plotted first to establish the frames).

A quick fix is to use set_opacity@(128) but that results in the plot looking rather "wishy - washy" as we say in Glasgow.

I do have an idea of how I could fix this - but it involves generating two other plots and copying the graphic areas containing the scales into the final plot in which the scales have been suppressed by making the text the same colour as the back-ground - all a bit messy. Hence my gentle reminder.

I cannot simply set the text colour to white before the call to %pl, and add the scale text via the call back as the user specified dx and dy values are not always used.

Same plot, using set_opacity@ tricks:-



It's OK, but external scales would be better

Thanks
Ken Very Happy


Last edited by Kenneth_Smith on Sat Nov 18, 2017 11:56 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Sat Nov 18, 2017 11:15 am    Post subject: Re: Reply with quote

PaulLaidler wrote:
I can't see a problem at the moment.
Which "min values" are you referring to?


Paul,
I already wrote my suspicion that you guys at SF do not use debugger, but that you also do not use FTN95 I started to suspect after beginning of this thread Smile Smile Smile This is why the one-line code with 6 bugs I published here at least 3 times and twice sent by PM was not fixed for so long time Smile Smile Smile

So suspecting this I added %df and %9^rd specially to simplify the process of choosing numbers - just click and see that the red dot is at X=1 or 2 , 3 or 4 when Xmin is 0, 1, 2 or 3 but it had to be always at X=1 at any Xmin. Same for Ymin (here watch also how axis name Width becomes not centered, and minus sign is too far from the numbers). But for that it is necessary to compile the code and make an EXE file not just look at the source and do the calculation in the head. Smile
In your head this code works fine and has no errors because compilers are different !!! Smile

Was just kidding.
Or may be not?

Ken,
Hope your suggestion will be realized. But there exist another option. I do not know how difficult is to realize it. It requires the letters with the cast like here. Doable easily? Our students with Python doing this, looks perfect.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sat Nov 18, 2017 2:48 pm    Post subject: Reply with quote

Dan

Can you check the code that you have posted. I may be missing something but I don't think it does what you say. Try running it after copying it back to your computer.

Ken

I have noted your request. In the meantime one way to fix the presentation is to draw the axes with an offset.

Code:
      CALL winop@("%pl[y_axis=Amplitude@(-30,0)]")
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Sat Nov 18, 2017 4:57 pm    Post subject: Reply with quote

Dan

I have tried to work out what your program is intended to do but I can't make it out. It plants an "ellipse" at (1,1) and the range for the axes is changed via %rf edits. But the changed values are not implemented in the drawing of the graph.

If, in your version of the program, the "ellipse" is not drawn when the xAxisMax value goes negative then that is what should happen.

Apart from the fact that the program is not functional, the only error I can see is that the parameters graph1 (=1) and link_none (=0) have not been defined or set.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Sat Nov 18, 2017 8:20 pm    Post subject: Reply with quote

Paul,
I checked the code above and all works like i described.
Not sure undefined variable was important and not sure i fixed this undefined error correctly, but there is no undefined errors right now in little bit edited code below.

Now i hope that all users with older then 8.20 versions can reproduce this bug as i commented two lines setting dx= and dy=. This compiler needs more active users, this will help its development.

Do the following: for simplicity do not change anything but Xmin

1) When start the code do you see the red dot at X=1, Y=1 ?
2) Change Xmin to -3. Do you see that the red dot still stays at the same point ? Same with Xmin=-2 or -1 or -10.
3) Now set Xmin=1 . Do you see red dot moved to X=2 while it must stay still at X=1? DONE

You may play further and see that at Xmin=2 the red dot moved to 3.
You may also edit the code and set position of red dot at any place, for example at 3,3
Code:
  call get_plot_point@(3d0, 3d0, xEllipse, yEllipse)
But as soon as Xmin becomes >0.5 the displayed position of red dot will be wrong

Code:
module surfplot2mod
   use clrwin

   integer (7) ihandleSP2
   real*8 x(2),y(2), xEllipse, yEllipse
   real*8 xAxisMin, xAxisMax, yAxisMin, yAxisMax

CONTAINS
   INTEGER FUNCTION plotSP()

   x(1)=xAxisMin
   x(2)=xAxisMax
   y(1)=yAxisMin
   y(2)=yAxisMax

   call simpleplot_redraw@

   ixR=7; iYr=7
   call get_plot_point@(1d0, 1d0, xEllipse, yEllipse)
   call draw_filled_ellipse@ (nint(xEllipse), nint(yEllipse),ixR,iYr,rgb@(244,0,0) )
   call UPDATE_WINDOW@(ihandleSP2)

   plotSP= 2
   end function plotSP
!......................................................
   INTEGER FUNCTION clearPL()
     CALL simpleplot_redraw@()
     clearPL = 2
   END FUNCTION clearPL

end module surfplot2mod

!.......................
Program SurfPlot2
use surfplot2mod

   xAxisMin =-4
   xAxisMax = 5
   yAxisMin =-4
   yAxisMax = 5

   x(1)=xAxisMin
   x(2)=xAxisMax
   y(1)=yAxisMin
   y(2)=yAxisMax

   i = winio@  ('%ww%nr&')                           
   call winop@ ('%pl[native,x_array,N_GRAPHS=1]')
   call winop@ ('%pl[scale=linear]')

   CALL winop@("%pl[tick_len=9]")
!   CALL winop@("%pl[dx=1.]") 
!   CALL winop@("%pl[dy=1.]") 

   i = winio@  ('%sf%ts%bf&', 2d0)   

   call winop@ ("%pl[framed,axes_pen=3,width=3,x_axis='Length',y_axis='Width']")

   i = winio@  ('%pv%pl&',800,600,2,x,y)!
   i = winio@  ('%sf%ts%ff&', 1d0)

   i = winio@  ('Set Xmin, Xmax%ta%df%9^rf%df%9^rf%ff&',1d-1,xAxisMin,'+', clearPL, plotSP,  1d0, xAxisMax,'+', clearPL, plotSP)
   i = winio@  ('Set Ymin, Ymax%ta%df%9^rf%df%9^rf%ff&',1d-1,yAxisMin,'+', clearPL, plotSP,  1d0, yAxisMax,'+', clearPL, plotSP)

   i = winio@  ('%cn%^bt[PLOT]%^bt[Clear]%ff&', '+', clearPL, plotSP, clearPL)

   i = winio@  ('%ac[Esc]&', 'exit')
   i = winio@  ('%hw%lw', ihandleSP2, lw_SP2)     

   jj = plotSP()

   end
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Nov 20, 2017 11:12 am    Post subject: Reply with quote

Dan

I haven't worked out exactly what is wrong with your code. Either it's related to the order that the callbacks are called or maybe a callback is being called from a callback. If the latter then perhaps PERMIT_ANOTHER_CALLBACK@ might fix it. Anyway here is a modified version of your code that does what I assume you want.

Code:
MODULE surfplot2mod
   USE clrwin
   INTEGER(7) ihandleSP2
   REAL*8 x(2),y(2), xEllipse, yEllipse
   REAL*8 xAxisMin, xAxisMax, yAxisMin, yAxisMax
CONTAINS
   INTEGER FUNCTION plCB()
      ixR=7; iYr=7
      CALL get_plot_point@(1d0, 1d0, xEllipse, yEllipse)
      CALL draw_filled_ellipse@(nint(xEllipse), nint(yEllipse),ixR,iYr,rgb@(244,0,0))
      CALL update_window@(ihandleSP2)
      plCB = 2
   END FUNCTION plCB
!......................................................
   INTEGER FUNCTION plotSP()
   x(1)=xAxisMin
   x(2)=xAxisMax
   y(1)=yAxisMin
   y(2)=yAxisMax
   CALL simpleplot_redraw@
   plotSP = plCB()
   plotSP= 2
   END FUNCTION plotSP
END MODULE surfplot2mod
!.......................
PROGRAM SurfPlot2
USE surfplot2mod
   xAxisMin =-4
   xAxisMax = 5
   yAxisMin =-4
   yAxisMax = 5
   x(1)=xAxisMin
   x(2)=xAxisMax
   y(1)=yAxisMin
   y(2)=yAxisMax
   i = winio@  ('%ww%nr&')                           
   CALL winop@ ('%pl[native,x_array,N_GRAPHS=1]')
   CALL winop@ ('%pl[scale=linear]')
   CALL winop@("%pl[tick_len=9]")
   CALL winop@("%pl[dy=1.0]")
   i = winio@  ('%sf%ts%bf&', 2d0)   
   CALL winop@ ("%pl[framed,axes_pen=3,width=3,x_axis='Length',y_axis='Width']")
   i = winio@  ('%pv%^pl&',800,600,2,x,y,plCB)
   i = winio@  ('%sf%ts%ff&', 1d0)
   i = winio@  ('Set Xmin, Xmax%ta%df%9^rf%df%9^rf%ff&',1.d0,xAxisMin,plotSP,1d0,xAxisMax,plotSP)
   i = winio@  ('Set Ymin, Ymax%ta%df%9^rf%df%9^rf%ff&',1.d0,yAxisMin,plotSP,1d0,yAxisMax,plotSP)
   i = winio@  ('%cn%^bt[PLOT]%ff&',plotSP)
   i = winio@  ('%ac[Esc]&', 'exit')
   i = winio@  ('%hw%lw', ihandleSP2, lw_SP2)     
END
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page Previous  1, 2, 3 ... 16, 17, 18 ... 26, 27, 28  Next
Page 17 of 28

 
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