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 

Dimension of %PL
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
DanRRight



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

PostPosted: Sat Jun 12, 2021 11:41 pm    Post subject: Dimension of %PL Reply with quote

How to find x and y pixel size of %pl plot? When i resize the plot i need to save its parameters for next use. But if i add to callback this function

call get_graphical_resolution@(iXsize, iYsize)

to find the pixel dimensions then this gives me the entire graphics window sizes, not the sizes iXsize, iYsize which seems are used in the Native %PL

i=winio('%pv%pl', iXsize, iYsize, iDim, X, Y)

Looks like the plot area border sizes need to be included then both will be equal. But how to get border sizes?


Last edited by DanRRight on Sun Jun 13, 2021 5:56 pm; edited 1 time in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sun Jun 13, 2021 7:39 am    Post subject: Reply with quote

Try clearwin_info@("GRAPHICS_WIDTH") and clearwin_info@("GRAPHICS_DEPTH").
Back to top
View user's profile Send private message AIM Address
DanRRight



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

PostPosted: Sun Jun 13, 2021 5:51 pm    Post subject: Reply with quote

Thanks, Paul, that works removing the need for border size knowledge.

Interesting is new experience with the new Designer %PL after i added just one single line to my previous %PL for this new %PL to handle my settings. That's all what is needed to turn old %PL to new %PL

Code:
CALL winop@('%pl[file=zPLsurfplot.set]')


Now we can adjust almost everything and do not worry about settings next time you start the program, the new Designer %PL will look at the file and adjust everything. It is that ultimate simplicity and convenience we were talking here for years: a half a line of text and professional quality plot is done, just adjust all you need without any programming

But one convenient thing is missing here.

We have still to keep part of our own %PL plot settings because a lot more can be added by the user to the plot. Like additional plot captions, labels using different fonts, comments at specific places etc. But saving settings on resize now interferes with user older settings: the new Designer mode only saves changes when you edit the plot manually, while previously my own settings were saved automatically on each change in the plot. And user's settings saved after each resize are now ignored because Designer %PL takes plot sizes from its own settings.

Is it is doable to add an option to new Designer %PL which will allow automatically save its own settings on resize (when user adds %pv)? Introducing separate function callable by the user which will force %PL to save Designer's settings will also solve this problem

Another minor problem or feature request with Designer %PL is that if you set the limits on X or Y in Edit mode you can not unset them back to Auto. You need to go into the file (containing all these commas ,,,,,342,,,,,,4,,, Smile ), find among commas your entries and delete them manually. Adding Auto options for all 4 limits will solve this problem

And totally miniscule request is to add ESC to exit from Designer's Edit mode
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Jun 14, 2021 4:41 pm    Post subject: Reply with quote

Dan

I understand your request for the ESC action but let me take the other two requests separately.

If the design parameters are saved to a file using %pl[file=...] and if a user changes the size of the graph via the pivot but does not otherwise change the design then at the moment the new size is not saved.

I guess that you would like the new size to be automatically saved. Is that right? If it is, how would this be affected by the locked state %pl[locked]? and would there be a prompt to save?

Perhaps the best option would be to prompt to save but only when not locked.
Back to top
View user's profile Send private message AIM Address
DanRRight



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

PostPosted: Mon Jun 14, 2021 6:52 pm    Post subject: Reply with quote

Paul,
I have no opinion on [locked], did not use it before.

As to not locked case - i agree with your suggestion. I just may be add that would be great to give user the choose to confirm saving settings after plot resize or just quietly save the changes. All browsers for example quietly remember if you resize them. But giving user choice to confirm or not will satisfy all picky people Smile
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Jun 14, 2021 8:56 pm    Post subject: Reply with quote

Dan

I have added this feature for the next release of ClearWin+.

It happened to be the easiest of the three. "Adding Auto options" would require a big change for a small gain but maybe I will think of an easy way to do it.

Stange as it may seem, the "miniscule" request happens to be the one that I don't know how implement in this context.
Back to top
View user's profile Send private message AIM Address
DanRRight



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

PostPosted: Tue Jun 15, 2021 7:36 am    Post subject: Reply with quote

Thanks for quick upgrade, Paul
Back to top
View user's profile Send private message
DanRRight



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

PostPosted: Sat Jun 19, 2021 6:21 am    Post subject: Reply with quote

I checked how plot size is now updated with latest DLLs - all works good.

But in one case there is some problem.

This happens when i use callback with %^pl[full_mouse_input] to "sniff" pixel color at cursor. In this case if after changing plot size i also go into editor and then exit it (the ESC works OK, by the way, thanks for workaround) and then exit plot i will be asked to close the plot many times in multiple windows which are generated by mouse cursor being in the surface area and due to that calling callback. Every time new window will be generated like this


Looks like tricky case
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sat Jun 19, 2021 7:47 am    Post subject: Reply with quote

Dan

ESC will work when the listbox in the dialog has the focus.

If you can send me some sample code to illustate the multiple prompting then that would help.
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 Jun 19, 2021 10:50 pm    Post subject: Reply with quote

Yes, here is demo i took from our older posts in 2019 adding sniffRGB callback and full_mouse_input.

1) No, ESC of plot editor works perfectly, thanks for adding it, as it was not easy you have mentioned before. This is minor feature but you really miss it when it is absent. Imagine to hit from first attempt hundreds times per day that tiny red cross in the corner of Editor window on 65" 8k monitor to close the editor window. This drops your self-esteem below the floor Smile Smile Smile . And a loss of time ? Looks like tiny loss of 5-10 seconds but you are shooting this red cross totally whopping a half an hour a day ! So one bad day rebuilding some plot which peer reviewer did not like and trying to make plot perfect to satisfy him for sure i really exploded Smile

2) To see the problem start the plot, resize it, go to plot editor, exit from plot editor with ESC, exit plot (ESC) and at that moment you will see the effect

3) Please also look at the slider below the plot, there exist other small problem which needs fixing which is easy to see moving the slider

4) Also i intentionally removed from that demo 2019 settings of line width, and frame width axes_pen=2, frame_pen=2, width=2 which to my opinion have to be default first time the %PL is opening ANY plots. This was to emphasie how bad looking plot with default settings. Current default axes_pen=1,frame_pen=1,width=1 makes very ugly plots. First impression is important. First time users may not touch the %PL second time.

5) You may try changing simpleplot_redraw@ to plot_redraw@. This does not redraw the plot. Why?

Code:
module mod1
use clrwin
integer, parameter:: N=30
Real*8 X(N),Y(N), Slider
contains
integer function cbSlider()
do i=1,N
  X(i) = i
  Y(i) = Slider*X(i)**3 * exp(-X(i)/3)
enddo
 call simpleplot_redraw@
!call       plot_redraw@
cbSlider=2
end function

integer function sniffRGB()
sniffRGB=2
end function


end module
!.........................................................
winapp
use mod1

call winop@('%pl[file=zPlotSettings.set]')
i=winio@('%pv%^pl[x_axis="Angle",y_axis="Intensity",framed,full_mouse_input,&
&n_graphs=1, x_array,scale=log_linear, Y_min=1.e-1]%ff&',740,540,N,X,Y, sniffRGB)

i=winio@('%cn%50^sl&', Slider, 1d0, 100d0, cbSlider)

i=winio@('%lw%es',ilw)

i=cbSlider()
!call simpleplot_redraw@

end



6) There exist couple more small problems with %PL not related to previous ones. One of them is here. Aside from defect, notice how good this plot looks from first attempt with widths =2 compared to plot above with all widths=1. Earth and sky difference.

Code:
   module mod1
   use clrwin
   parameter (N=5)
   real*8 X(N), Y(N)
   Data X/1e1, 1e2, 1e3,  1e4, 4e5/
   Data Y/2.2, 66, 8333, 1111, 777/
   save
   contains

   INTEGER FUNCTION redraw ()
!    CALL simpleplot_redraw@()
    CALL        plot_redraw@()
    redraw = 2
    end function redraw
   end module
!................................
   Program bug333
   use mod1

   i=winio@('%fn[Tahoma]%bf%ts&',2.d0)
   CALL winop@("%pl[gridlines]")
   call winop@("%pl[axes_pen=2,frame_pen=2,width=2,x_axis='X Axis Title',y_axis='Y Axis Title']")
   i=winio@('%ww%pv%pl[native,framed,x_array,scale=log_log,N_GRAPHS=1]%ff&', 925,700, n, X, Y)
   i=winio@('%sf%cn%^bt[Redraw]&', Redraw)
   i=winio@('%es')
   end

Back to top
View user's profile Send private message
DanRRight



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

PostPosted: Tue Jun 22, 2021 6:45 pm    Post subject: Reply with quote

I know Ken is using %PL. But interesting, JohnCampbell, Mecej4, Wahorder, JohnSilver, others, have you guys started actively using new %PL in your codes? Or you wait till all minor bugs will be fixed? Or may be you do not like something else?
Back to top
View user's profile Send private message
Kenneth_Smith



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

PostPosted: Tue Jun 22, 2021 7:25 pm    Post subject: Reply with quote

Dan,

I have modified your last example slightly. Clicking on the redraw button will now produce the required result. Note I am using CALL simpleplot_redraw@()

Code:
   module mod1
   use clrwin
   parameter (N=5)
   real*8 X(N), Y(N)
   Data X/1e1, 1e2, 1e3,  1e4, 4e5/
   Data Y/2.2, 66, 8333, 1111, 777/
   save
   contains

   INTEGER FUNCTION redraw ()
    i= CHANGE_PLOT_DBL@(0, "x_max", 0, 1.0d6)
    CALL simpleplot_redraw@()
!    CALL plot_redraw@()
    redraw = 2
    end function redraw
   end module
!................................
   Program bug333
   use mod1

   i=winio@('%fn[Tahoma]%bf%ts&',2.d0)
   CALL winop@("%pl[gridlines]")
   call winop@("%pl[axes_pen=2,frame_pen=2,width=2,x_axis='X Axis Title',y_axis='Y Axis Title']")
   i=winio@('%ww%pv%pl[native,framed,x_array,scale=log_log,N_GRAPHS=1]%ff&', 925,700, n, X, Y)
   i=winio@('%sf%cn%^bt[Redraw]&', Redraw)
   i=winio@('%es')
   end
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: Tue Jun 22, 2021 9:48 pm    Post subject: Reply with quote

Ken, Nice. May be this will give Paul more clues what wrong is there.
I forgot to mention one more case, which was commented in my last example. Click this button several times. This behavior resembles the one of all politicians in the world: changing shoes in the air Smile

Code:
   module mod1
   use clrwin
   parameter (N=5)
   real*8 X(N), Y(N)
   Data X/1e1, 1e2, 1e3,  1e4, 4e5/
   Data Y/2.2, 66, 8333, 1111, 777/
   save
   contains

   INTEGER FUNCTION redraw ()
    CALL simpleplot_redraw@()
!    CALL        plot_redraw@()
    redraw = 2
    end function redraw
   end module
!................................
   Program bug333
   use mod1

   i=winio@('%fn[Tahoma]%bf%ts&',2.d0)
   CALL winop@("%pl[gridlines]")
   call winop@("%pl[axes_pen=2,frame_pen=2,width=2,x_axis='X Axis Title',y_axis='Y Axis Title']")
   i=winio@('%ww%pv%pl[native,framed,x_array,scale=log_log,N_GRAPHS=1]%ff&', 925,700, n, X, Y)
   i=winio@('%sf%cn%^bt[Redraw]&', Redraw)
   i=winio@('%es')
   end
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Jun 23, 2021 7:11 am    Post subject: Reply with quote

I will take a look at these samples soon.
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Thu Jun 24, 2021 2:15 am    Post subject: Reply with quote

I don't use %pl. I find it interesting, as I do use plotting software for existing datasets, but it is not something I need in my existing code.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page 1, 2, 3  Next
Page 1 of 3

 
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