Silverfrost Forums

Welcome to our forums

Birth defect of Clearwin

25 Dec 2024 11:52 #31756

I mean to participate in all AI developments involving Fortran. There are several very active ones. For example this one called Modern Neural Fortran.

https://github.com/modern-fortran/neural-fortran

and some others

That will involve modern programmers into this compiler. Currently FTN95 gathers probably all living descendants of infamous Luddites in the world who do work on a single core and do not care. Sects of orthodox Fortran4 and Fortran77 most probably also are hidden here.

5 Mar 2025 11:15 (Edited: 16 Mar 2025 8:38) #31976
  1. I need both Y numbering and captions be outside the plotting area.

https://i.postimg.cc/sXdgx7V0/Screenshot-from-2025-03-05-14-58-53.png

Can not find how in Designer's Mode to fix this plot. ('Designer's mode' or DM appears when you click on left corner icon which appears on your %PL plot when you add to your source code this line

call winop@('%pl[file=Settings.set]' )

Looks like people do not know what Designer's mode is. But it ultimately simplifies creating plot, and not just dumb plots but professionally looking plots. Nothing in the world is simpler than DM with %PL. You just write two Fortran lines and you created a plot where you are free to change anything without further programming. Just two lines!

I think there exist control to fix this problem regular way (outside the Designers mode) but i forgot it and could not find now.

And i need also that the X caption be centered on axis. There exist description in Clearwin ENH text file how to do that outside the Designers more but to me permanently in hurry it looks confusing. This option has to be default by the way. No one ever needed the current default you can see above ( of course i can move the caption in DM with 1000 clicks but...I do not have to). Am i wrong? Can people here confirm that? And this also needs to be added to DM

  1. In the Designers mode the field for the line number is too small so that it can not show two digit line numbers. Besides you can not change this line number manually, only by clicking. Very annoying when you have many lines to change something. Same, you can not just write the number in Tic Value Position controls, you need clicking and clicking

  2. If you have log_linear plots and need to set minimum and maximum in Designer's Mode there is no way to write your limits like this 1.e-22 or 4.e30. You can do that only by writing it this way 0.00000000000000000001 or 40000000000000000000000000000000

  3. Missing left frame in above plot (or left Y axis) is also obvious despite in DM both the frame, framed and etched radiobuttons are ON.

  4. Other defects are visible on these two examples of two-line codes inside single file.

    use clrwin parameter (N = 222) real*8 X(N), Y(N) Data X/0.01,0.1,1,10, 100,1000,10000,100000/ Data Y/0.011,0.044,0.33,2.2,66,3333,1111,777/

    !... Regular Plot call winop@('%pl[x_axis='X Axis Title',y_axis='Y Axis Title']') i=winio@('%ww%pv%pl[native,x_array,scale=log_log,N_GRAPHS=1]%lw', 800,600, n, X, Y, ilw)

    !... Design Mode Plot i=winio@('%sf%ts%bf%es&', 2d0) call winop@('%pl[x_axis='X Axis Title',y_axis='Y Axis Title',file=zSetts.set]') i=winio@('%ww%pv%pl[native,x_array,scale=log_log,N_GRAPHS=1]', 800,600, n, X, Y)

    end

Two plots will be opened (one on top of the other, so separate them yourselves) , one in 'dumb mode' and another in Designer's Mode. You can edit the second plot by clicking on icon in left top corner. You can change there line width, add frame, its width, change min and max values, move titles reduce and increase fonts etc

And look at birth defects too: look at Minimum and Maximum values in Designer mode. They are still shown as log10 numbers instead of being human readable ones like when the Native PL was born.

By the way you can change the defect of Y axis dumb numbering by setting there Y minimum number to -2 (means 10^-2).

Just two-three lines. No more formatting like this:

call winop@ ('%pl[x_min=7500]') call winop@ ('%pl[x_max=7710]') call winop@ ('%pl[y_min=0]') call winop@ ('%pl[y_max=130]') call winop@ ('%pl[x_axis=X]') call winop@ ('%pl[y_axis=SEQNUM]') call winop@ ('%pl[color=black]') call winop@ ('%pl[link=lines,symbol=0]') i=winio@ ('%`pl&',iwvm,ihvm,numld,xval,yval,ighandle) call winop@ ('%pl[x_min=7500]') call winop@ ('%pl[x_max=7710]') call winop@ ('%pl[y_

6 Mar 2025 7:17 #31981

Dan

I can probably investigate these issues but I am only willing to look at them one issue at a time. When I have reported a fix for one issue then you can send me the next.

Please send me a sample program and details for the first or most important issue.

6 Mar 2025 12:35 #31983

Dan, try this for your y_min problem.

 use clrwin
 parameter (N = 2*2*2)
 real*8 X(N), Y(N)
 Data X/0.01,0.1,1.0,10.0, 100.0,1000.0,10000.0,100000.0/
 Data Y/0.011,0.044,0.33,2.2,66,3333,1111,777/

 ! n_graphs must be first when using these winop functions
 call winop_int@('%pl[n_graphs]', 1)   

 ! set ymin
 call winop_flt@('%pl[y_min]',10.d0**INT(FLOOR(LOG10(minval(y)))))
 
 call winop@('%pl[x_axis='X Axis Title',y_axis='Y Axis Title']')
 i=winio@('%ww%pv%pl[native,x_array,scale=log_log]%lw', 800,600, n, X, Y, ilw)

 end

It will not work correctly in your case for the x_min value as X(1) is initialised to 0.0099999997764826

8 Mar 2025 9:58 #31986

Guys, I think i was not clear. I do not need to fix anything or do any workarounds in my question 1. The problem was already articulated and fixed by including some additions to Clearwin syntax, and i even used that before but i forgot how to make Y axis on the left edge not in the middle (and numbering there too)

And same i think was already done for X caption - with the new syntax it will be placed in the middle of the whole axis, not on the positive its part only like you can see above (these are defaults which both are hell ugly - don't you see that on my plot example above ?)

I was not clear with other questions 2-5 too. My poor Uglish killing me (ones I incorrectly translated word trying to say that we go to some place visiting relative and used word 'moving' which people understood as 'relocating' which caused terrible consequences for the pets we left them to temporally babysit for a week 😭 ). These are obvious suggestions to improve Designer's mode, no more examples from me needed. Question 1 ideally also needs to be included in the Designers mode as an additional radio-button to its options

What Ken showed is classical workaround, all that trickery has to be included into the Designers Mode so users will not do any additional programming besides these 2-3 lines of Fortran code needed to start your plot. Why I refuse to use anything more than 2-3 lines is because all that additions besides these 2-3 lines often are conflicting with the Designers Mode. You will not see how DM scales anything or changes anything right away as you click there, the image just disappears. We need more users of Clearwin and its native PL to clean out such still existing hidden bugs

9 Mar 2025 9:32 #31987

As to my Question 1 I finally realized how the manual confused me

'477 Two new options [xaxis=<caption>] and [yaxis=<caption>] have the added to %pl. These are like [x_axis=<caption>] and [y_axis=<caption>] but the captions are centred on the whole of the axis rather than the positive part.'

Should be written to avoid confusion 'In addition to existing x_axis and y_axis two new options xaxis and yaxis have been added...'

But decently I'd prefer to see x_axis and y_axis centered on the middle of axis as a default and introduce 2 more options: centered to positive part x_axisP, centered on negative part x_axisN.

16 Mar 2025 7:51 #31993

Continuing suggestions to improve native %PL. All are relatively minor fixes and additions. There will be also one which is a major problem with LOG plotting (and recently I found also one with the linear scale too) but for a couple years I experience it I still had no time to make a demo

  1. Would be great to make in Designers Mode additional keys to have the axis numbering more consistent. I forgot the trick i discovered which allows to do that (it worked when you change the orders of winop@ commands). For example current numbering does not really looks good https://i.postimg.cc/0NxcSq5D/Screenshot-from-2025-03-16-00-41-12.png Ideally would be to have numbering either
  1. strictly scientific 10^X
  2. strictly engineering 0.001, 0.01, ... 1, 10,100, 1000 (ideally with settings until what values to use engineering format (1000 or 10000 or may be at 100000)
  3. and may be mixed (like today)
  1. It is necessary to fix these two squares near 10^-5 in numbering 8eight) and the square at x and y axis corner nearby
19 Mar 2025 5:27 #31996
  1. Clearwin can do a lot of things Fortran users may even have no slightest clue that such things could be done in just few letters of Fortran source text.

You can change the style of the front panel for example by adding bitmap backgrounds. You can make different your own backgrounds for the window or the plot areas. All that can be included into Designers mode too. You can even make a games using Clearwin.

And definitely modern generations will not even touch any ugly app made in Command Prompt anymore

One of things which can be also added to Designers more when time allows could be elimination of not only programming controls of Clearwin but even all these allow keys in Designers Mode where you can move axis left-right and up-and-down and do that just by mouse touch.

Here is my example made decades ago. Suppose I open my app and the left margin of it is distorting the texts. https://i.postimg.cc/hPCF2h0b/App1.jpg Of course you can increase the margin by adding Clearwin command and recompile the code. Or if you use Designers Mode, you can fix its position by clicking 20-30 times in the right direction. But in my app you just step on axis with your mouse and drag it to right side. https://i.postimg.cc/fLF5rtbp/App2.png

The same method can be used for moving captions, titles, increasing/decreasing fonts, line widths and basically almost everything in addition to the current Designer's mode dialogs

  1. Where is the error here and why the crash happened not just ignoring or using standard font? https://i.postimg.cc/SN5mKGx3/Screenshot-from-2025-03-19-22-49-41.png

UPDATE. I found the error : the right ] parenthesis for %CA was missing. Still shouldn't this error be reported by the /check_winio at compile time I always use to find Clearwin errors? (By the way probably this switch should be ON by default)

21 Mar 2025 1:55 #31998
  1. The names of linear and logarithmic plot type is confusing. Normally when you call something LogLinear that means Log for X axis and Linear for Y. In the %PL this is opposite to common sense and usual convention. See for example Lawrence Berkeley National Laboratory site

[URL]https://henke.lbl.gov/optical_constants/filter2.html[/URL]

So would be reasonable to introduce two or three additional keywords which will turn naming convention to standard. In two cases (both X and Y Linear and both X and Y Log they coincide with existing one)

LinLin for both X and Y scales being Linear (instead or in addition to existing Linear ) LinLog with Linear X and Log Y (instead or in addition to existing LogLinear ) LogLin with Log X and Linear Y (instead or in addition to existing LinearLog) LogLog for both Log X and Y ( same as existing LogLog )

21 Mar 2025 7:12 #32000

I wonder if Google AI gives different results on this side of the 'pond'...

In a log-linear graph, one axis (usually the y-axis) uses a logarithmic scale.

21 Mar 2025 10:53 (Edited: 21 Mar 2025 10:58) #32001

But fun is that the same Google AI says the same about lin-log XY plotting:

'A lin-log XY plot (also called a semi-log plot) displays data where one axis (typically the y-axis) is scaled logarithmically while the other (x-axis) is scaled linearly' 😃

21 Mar 2025 10:58 #32002

Paul,

There is no ambiguity with the existing scale options:

SCALE=LINEAR SCALE=LOG_LOG

Perhaps what is required is:

SCALE=SEMILOG_Y as an alternative to SCALE=LOG_LINEAR (y axis is logarithmic) SCALE=SEMILOG_X as an alternative to SCALE=LINEAR_LOG (x axis is logarithmic)

Why? SCALE=LINLOG and SCALE=LOGLIN as suggested by Dan would still be ambiguous, depending on which convention you view as correct. Introducing the SEMILOG log alternatives would remove this ambiguity.

21 Mar 2025 11:04 (Edited: 21 Mar 2025 11:26) #32003

Ken, But there is no clear convention as AI says 😃

Semilog or semilog_x, semilog_y is kind of also not clear.

If you do not like my suggestion then OK, here is 100% not ambiguous:

linXlinY linXlogY logXlinY logXlogY

In addition for the total freedom and clarity you can call linXlogY = logYlinX as synonyms and %PL will understand you completely. Of course would be also good to continue calling LinXLinY as just 'linear' and make logXlogY = loglog = log_log as a synonym of just 'log'

21 Mar 2025 11:26 #32004

Dan,

I think you and I will have to agree to disagree on the clarity (or otherwise) of what is meant by a 'semilog' plot.

https://en.wikipedia.org/wiki/Semi-log_plot

The semilog approach would half the volume of work being asked of the folks at Silverfrost.

21 Mar 2025 11:37 #32005

Ken, Well, this link in Wiki is capable to inflict the inferiority complex and will do it every time anyone will decide to use semilog with native %PL. Even Google AI was confused (weren't AI trained on Wiki ? 😃

21 Mar 2025 11:51 #32006

Avoiding SEMILOG, perhaps simply:

SCALE=LINX_LOGY (y axis is logarithmic) SCALE=LOGX_LINY (x axis is logarithmic)

Is all that is really necessary in terms of new alternatives?

Giving:

SCALE=LINEAR SCALE=LOG_LOG SCALE=LINX_LOGY (alternative to SCALE=LOG_LINEAR) SCALE=LOGX_LINY (alternative to SCALE=LINEAR_LOG)

21 Mar 2025 2:33 #32007

Ken

Sounds good to me.

21 Mar 2025 8:22 #32009

Quoted from Kenneth_Smith Avoiding SEMILOG

SCALE=LINEAR SCALE=LOG_LOG SCALE=LINX_LOGY (alternative to SCALE=LOG_LINEAR) SCALE=LOGX_LINY (alternative to SCALE=LINEAR_LOG)

I agree with this subset because it puts X first, Y second like all should be. Indeed, even the dimensions of the plots iX and iY and its X and Y variables

i=WINIO@('%PL[SCALE=LOG_LINEAR]',  iX, iY, X, Y) 

are set in 'X first - Y second' order but why scale in LOG_LINEAR (= LOGY_LINX) is set with Y first and X second?

But my initial thought was to eliminate any thinking/remembering/digging (and ideally any programming adding LOG/LIN into Designers Mode) when you do plotting and here to make choosing SCALE completely logical.

I use %PL for two+ decades, before even current Native %PL, having 100s of plots and believe me every time I start new plot I scratch the head what are the names for all these Lin/Log controls because there are so many possible variants while their chosen names are relied exclusively on your perfect memory. Instead their naming system have to be 100% logical.

If we accept LOG_LOG why not accept also alias LIN_LIN? If we accept LINX_LOGY why not accept also LINX_LINY and LOGX_LOGY?

Adding aliases when you can call SCALE different logical way and %PL still accept it (keeping old way naming also acceptable), will completely eliminate the need to remember anything or dig every time into your previous %PL uses search or the manual.

So in addition to the subset above, these suggestions I hope will form the whole set to do the full needed job:

SCALE=LINEAR [color=darkred:5233e9ce95](plus make %PL to accept also LIN_LIN and LINX_LINY)[/color:5233e9ce95] SCALE=LOG_LOG [color=darkred:5233e9ce95] (plus make %PL to accept also LOGX_LOGY. And may be just LOG ?)[/color:5233e9ce95] SCALE=LINX_LOGY (alternative to SCALE=LOG_LINEAR) SCALE=LOGX_LINY (alternative to SCALE=LINEAR_LOG)

  1. This discussion would not exist probably if choosing LIN/LOG was present in the Designer's Mode where you just click the needed radiobutton
22 Mar 2025 7:19 #32010

I have made a note of this recommendation.

29 Mar 2025 10:52 #32030
  1. Asking Google AI

Q: Is 'Caption' correct word for XY plot axis? (used in Designer's Mode)

A: The term 'caption' is not the correct name for the axis labels in an XY plot. The correct term is 'axis labels' or 'axis titles.' These labels describe the variables being plotted on the axes and include the units of measurement. For example, an axis label might be 'Temperature (K)' or 'Volume (L)'

Please login to reply.