soccer jersey forums.silverfrost.com :: View topic - Native %pl
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, ... 26, 27, 28  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: 2877
Location: South Pole, Antarctica

PostPosted: Tue May 02, 2017 12:00 am    Post subject: Reply with quote

Three and we are mostly done Smile

1) The vertical and horizontal error bars i was talking about (they could also look like symbols) are these crosses. They are very often used and show the interval of the possible plotted values

Noticed nice font in this plot? Can anyone reproduce it?

I do not ask for the nice looking captions like in this plot which would be separate journey for the future updates. This could be not easy like 2x2 feature to implement.

2) Easy stuff: please allow larger range for the length of tic marks then 10 pixels. Good journals require very high resolution of the plots so we increase the pictures on 4k monitors almost to the end and 10 pixel long tics look too small. In LOG scale minor tic marks have to be 50-70% of the major tic marks

3) i am running out of further wishes Smile
Back to top
View user's profile Send private message
Kenneth_Smith



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

PostPosted: Tue May 02, 2017 6:09 am    Post subject: Reply with quote

Paul,

It would be very much appreciated if you could make a new dll available.

Thanks Ken
Back to top
View user's profile Send private message Visit poster's website
DanRRight



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

PostPosted: Tue May 02, 2017 10:41 am    Post subject: Reply with quote

As to the fonts, yes, there are 300+ fonts in the computer and none looks nice like this one. Or the one in Sample Linear above, that is totally godlike font (I might be wrong, though I tried most of them).

Tic length change already are done by Paul, but not the minor ones in LOG scale (I might be wrong again) and not longer then 10 pixels (needs to be 20 at least). And impression was that in LOG scale minor tic marks (those between decades, like 2,3,4... between 1 and 10) are not changing together with major ones marking decades (1, 10, 100 etc). That requires really minor changes of existing settings.

Minor tic mark implementation and sizes for linear scale is a different story, here you are right.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue May 02, 2017 2:59 pm    Post subject: Reply with quote

Here is a new set of DLLs. Don't forget to create a backup before installing.

https://www.dropbox.com/s/6vvct0hsnwmgcxl/newDLLs8.zip?dl=0
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



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

PostPosted: Tue May 02, 2017 4:56 pm    Post subject: Reply with quote

Thanks for your efforts Paul.

Regards

Ken
Back to top
View user's profile Send private message Visit poster's website
Kenneth_Smith



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

PostPosted: Tue May 02, 2017 7:12 pm    Post subject: Reply with quote

Passed my test with slightly made up numbers.

Thanks again.

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



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

PostPosted: Thu May 04, 2017 7:41 am    Post subject: Reply with quote

OK, finally good news, as of today the options of new PL allowed it to beat not only Simpleplot but the Matlab and OriginLab in visual quality of image in linear plotting. Excusing couple small grains of salt here is what new %pl shows. Compare and tell which one is better, OriginLab or Silverfrost?



Now we can adjust all border sizes, the line widths and axis widths, positions of the titles and quality of smoothing. The x_min, x_max, y_min, y_max work in linear and LOG scale well. Specifically great is LOG handling of zero and negative numbers with convenient popup menu etc

So we are 99% close to be the best universal plotting routine in Fortran, congrats to Silverfrost

About LOG scale plotting will be next message as well as what is left to update and fix
Back to top
View user's profile Send private message
Kenneth_Smith



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

PostPosted: Thu May 04, 2017 1:42 pm    Post subject: Reply with quote

Paul, I am reticent to post this as you are probably a bit fed up of our collective comments by now.
A useful possible addition would be a flag which forces %pl to place the scales external to the frame, this would avoid the situation where data points obscure the numbers on the scale, and would give a more uniform appearance when groups of plots a combined together. The group of plots shown in the example below would look so much better if this was possible.


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


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

PostPosted: Thu May 04, 2017 2:48 pm    Post subject: Reply with quote

OK. That might be a simple addition. Would it be for the x-axis only and what name would you suggest?
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



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

PostPosted: Thu May 04, 2017 4:18 pm    Post subject: Reply with quote

Paul, I would suggest both x-and y-axis, the magnetic flux density profile plot I posted on Tuesday suffers the same issue.

Maybe something like:-

Code:

y_crosses = automatic     for current method
y_crosses = xmin          to force y axis to be drawn at the position of minimum x value

x_crosses = automatic     for current method
x_crosses = ymin          to force x axis to be drawn at the position of minimum y value


This should work with and without the frame option.

Plotting this type of data in excel has the same issue in its "automatic" mode and the suggested names are somewhat similar to the terminology used within excel.

Another related thought looking at an excel plot, perhaps a flag to force the x and y labels to be centered on the centre lines of the frame? This would avoid setting [x-axis=@] or [y-axis=@] and having to use a call-back to centre the labels. I have noticed that at present these are always placed centred on the positive part of an axis scale and if all the data being plotted is in the 4th quadrant the y-axis label is omitted. x_label_position = "automatic" or "centre" and the same for the y_label_position perhaps?
Back to top
View user's profile Send private message Visit poster's website
Kenneth_Smith



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

PostPosted: Fri May 05, 2017 10:22 am    Post subject: Reply with quote

John, your are correct there is an endless list of possibilities depending on the programmer's personal preferences for what "looks good" as well as the nature of the data itself. As soon as I had typed x_crosses = "automatic" / "xmin", the thought struck me why not include a numerical value - which would complicate the programming further. My own %gr based plotting routine which has evolved over the last 5 years now has 70+ optional arguments, and still there a other options which I would like to add for the odd occasion I might use them.

A typical call to this routine looks like this:-

Code:

              call plot(500, igw=400, igh=350, ghandle=2, etched=0, &
                   title = 'Fourier', x_axis_label = 'Time [s]', &
                   y_axis_label = 'Amplitude [pu]', &
                   x_array = x, y1_array = y1, y2_array = y2, y3_array=y3, y4_array = y4, y5_array = y5, &
                   y6_array = y6, &
                   y1_width = 2, y2_width = 2, y3_width = 2, y4_width = 2, y5_width = 2, y6_width = 2, &
                   y1_colour = rgb_deep_pink, &
                   y1_symbol = 4, y1_symbol_size = 5, y2_symbol = 1, y2_symbol_size = 2, y2_colour = rgb_cornflower, &
                   y3_symbol = 4, y3_symbol_size = 5, y3_colour = rgb_english_red , &
                   y4_symbol = 4, y4_symbol_size = 5, y4_colour = rgb_maroon, &
                   y5_colour = rgb_dark_orange, y6_colour = rgb_forest_green ,&
                   y5_symbol = 4, y5_symbol_size = 5, &
                   y6_symbol = 1, y6_symbol_size = 2, &
                   y1_symbol_step = 5, y2_symbol_step = 5, y3_symbol_step = 5, &
                   y4_symbol_step = 2, y5_symbol_step = 5, y6_symbol_step = 5, &
                   autoscale_x = .true., autoscale_y = .true., y1_name ='1', y2_name='5', y3_name='7',&
                   y4_name = '11', y5_name = '17', y6_name = 'Sum', &
                   vertical_grid_line_style = 1, horizontal_grid_line_style = 1, &
                   vertical_grid_line_width = 1, vertical_grid_line_colour = rgb_cornflower, &
                   horizontal_grid_line_width = 1, horizontal_grid_line_colour = rgb_cornflower, &
                   fmt_x_axis = '(F20.4)', fmt_y_axis = '(F20.2)', bold_title = 1, italic_title = 1, &
                   underline_title = 1)


So I am very pleased with the new %pl !


Paul, I do agree with John that grid lines would be a useful longer term addition - there have been grumblings from the guys who use my code since I started using the new %pl as they are used to seeing these.

If you can easily implement the placement of the axis scales external to the frame, and centring of the axis captions this would pretty much guarantee a uniform appearance when different %pl regions are grouped together and for me that would be a big step forward. (I'm probably harking back to the days when I taught engineering drawing - 30 years ago - pen/paper/drawing board, when consistency in appearance is all important).

Thanks

Ken
Back to top
View user's profile Send private message Visit poster's website
DanRRight



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

PostPosted: Mon May 08, 2017 8:03 am    Post subject: Reply with quote

Paul,

The few grains of salt in ideal %pl i mentioned above are the following. This is what's left to fix in Linear scale, all but may be one are really fast to fix

Let's take this code which plotted almost ideal plot above
Code:
winapp
USE clrwin
integer, parameter :: n_dim = 1153
real*8  X(n_dim), Y(n_dim)
integer(7):: hDib !
integer*4 ilw
character filename*128

      i=winio@('%ww[no_border]&')
      i=winio@('%gr[BLACK]%ff%lw&',660, 550, ilw)

      filename = 'SpectraSampleLinear.bmp'
      hDib = import_bmp@(filename,ires)
      if(ires == 0) ires = dib_paint@(0,0,hDib,0,0)
      call release_screen_block@(hDib)

OPEN (UNIT=275,FILE='A.dat',STATUS='old',err=990)
do i=1,10000
  if(i.gt.n_dim) goto 100
  read(275,*,err=995,end=100) X(i), Y(i)
enddo
100 close(275)
n_points=i-1

      i=winio@('%ww[no_border]%es%ca[Default Plot]%pv&')
      i=winio@('%fn[Tahoma]&')  ! Verdana
      i=winio@('%ts&', 1.9d0)
      i=winio@('%tc&',rgb@(0,0,0))
      i=winio@('%bf&')
      i=winio@('%`bg&',rgb@(250,255,255))
      CALL winop@("%pl[axes_pen=3]")

!     CALL winop@("%pl[SCALE=LOG_LINEAR]")

      call winop@("%pl[framed]")
      CALL winop@("%pl[tick_len=9]")
      CALL winop@("%pl[margin=131]")
      call winop@("%pl[link=curves]") ! link=lines
      CALL winop@("%pl[n_graphs=1]")   
      CALL winop@('%pl[title="Native PL Linear"]')
      CALL winop@("%pl[x_axis='Wavelength (A)']")
      CALL winop@("%pl[y_axis='Intensity (arb.units)@(-5.0)']")
      CALL winop@("%pl[width=2]")
      CALL winop@("%pl[smoothing=4]") ! anti-aliasing
      CALL winop@("%pl[colour=black,style=0,pen_style=0]")   
      CALL winop@("%pl[x_array]")
      CALL winop@("%pl[x_min=12.0]")
      CALL winop@("%pl[y_max=155.0]")
      i=winio@("%pl",770,660,n_points,x,y)

goto 10000

!................. errors ......................
990 Print*, 'Error opening file A.dat for read'
goto 10000
995 Print*, 'Error reading file A.dat'
goto 10000
 
10000 continue
end


If increase image size using mouse you will see the following little problems


1) this problem is obvious
2) Y division is too often, way too many numberings, even though the plot size is very large
3) X division like this must never appear in ideal %PL
Also a bit too many numberings here - 12. May be 12 also would be OK but it have to be integer numbers 12, 13...22
4) This is clearly a much difficult problem: mixture of integer and FP numbers for numbering. I think it is not acceptable
5) Like others also agree the X axis title Wavelength by default has to be centered and moved left and right only at the user request with @(x,y)


Last edited by DanRRight on Mon May 08, 2017 9:08 am; edited 5 times in total
Back to top
View user's profile Send private message
DanRRight



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

PostPosted: Mon May 08, 2017 8:06 am    Post subject: Reply with quote

CONTINUE 1

Respect to 2) and 3) above I played with the code Ken found on the net about scales
https://people.sc.fsu.edu/~jburkardt/f77_src/toms463/toms463.html
and found its first two routines SCALE1 and SCALE2 are useful. Let's look specifically for our case above. If we change data in the SCALE1 case (automatically decides which amount of numbers to place within users decided region) there to
Code:
      data n_test / 7, 12, 9 /
      data xmin_test / 12., 12., 0.0 /
      data xmax_test / 22., 22., 155.0 /

we will get    

  SCALE1 chooses a scale for a plot.
       XMIN       XMAX   N      XMINP      XMAXP       DIST Nactual
       12.0       22.0   7       12.0       22.0        2.0       5
       12.0       22.0  12       12.0       22.0        1.0      10
        0.0      155.0   9        0.0      160.0       20.0       8



where first and last case are for ideal numbering of X and Y scales.
Middle case is for X scale i'd call it more verbose amount of numbers like your code is doing today.

So in automatic regime your code must decide which amount of numbers to place on axis based on font size (ideally 5-10) and then run SCALE1 and it will tell exactly what numbers will be placed and their amount. Easy fix.

You can see the SCALE1 program makes exactly ideal step for X axis equal 2, for Y it is 20

In the manual regime which shown in SCALE2 which listens exactly at users defined step (which John also suggested) there must be special option added where user in addition to the existing xmin and xmax, sets the value which TEST02 calls n_test ( better call it increment or step or else. In ideal case above for X step is equal 2, for Y it is 20). Then the user will be responsible for all the garbage he requested Smile. Also an easy fix !

And the last is that if tic mark is not numbered like some on X axis the tic length has to be reduced, say, by 40-50%

And the ideal linear scale %pl is done!


Last edited by DanRRight on Mon May 08, 2017 2:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
DanRRight



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

PostPosted: Mon May 08, 2017 11:15 am    Post subject: Reply with quote

CONTINUE 2
With LOG all fixable probably even faster

Let's take this code
Code:

   WINAPP
    MODULE modd
    USE clrwin
    INTEGER,PARAMETER::N=65
    REAL*8 X(N),Y(N),Z(N),T(N), U(N)
    !.....................................
    CONTAINS
    !.....................................
    INTEGER FUNCTION callb()
    REAL(2) random
    DO i=1,N
      X(i)=i
      Y(i)=exp(0.35*i) * random()
      T(i)=Y(i)     
      Z(i)=exp(0.7*i) * (random()-0.003)
      U(i)=Z(i)
    ENDDO
    CALL SIMPLEPLOT_REDRAW@
    callb = 2
    END FUNCTION
    END MODULE

    !.....................................
    PROGRAM KKK
    USE modd

    j=callb()
    i=winio@('%ww&')
    CALL winop@("%pl[native]")
!    CALL winop@('%pl[title="Log_linear@(115,299)"]')
    CALL winop@('%pl[title="Title: ideal log_linear@(-15,10)"]')
    CALL winop@("%pl[x_array]")
    CALL winop@("%pl[scale=log_linear]")
    CALL winop@("%pl[y_min=.3]")
    CALL winop@("%pl[y_max=1e7]")
    CALL winop@("%pl[N_GRAPHS=4]")
    call winop@("%pl[framed]")
    CALL winop@("%pl[tick_len=10]")
    CALL winop@("%pl[axes_pen=4]")
    CALL winop@("%pl[x_axis='Wavelength (A)@(-202,2)']")
    CALL winop@("%pl[y_axis='Intensity (arb.units)@(-20,-222)']")

 !  i=winio@('%fn[Tahoma]&')  ! Verdana
    i=winio@('%sf&')
    i=winio@('%ts&', 2.2d0)
    i=winio@('%tc&',rgb@(0,0,0))
    i=winio@('%bf&')

    CALL winop@("%pl[width=3]")
    CALL winop@("%pl[colour=red,link=none,symbol=7]")
    CALL winop@("%pl[colour=blue,link=none,symbol=9]")
    CALL winop@("%pl[symbol_size=8.]")
    CALL winop@("%pl[colour=black]")
    CALL winop@("%pl[colour=green]")
    i=winio@('%pv%pl&', 700,570, N, X,Y,Z,T,U) 
    i=winio@('%ac[Ctrl+Z]&',callb)
    i=winio@('%sf%ts&', 1.d0)
    i=winio@('%ff%cn%^bt[Redraw]%es',callb)
    END

It now looks like this


Obvious small problems


1) obvious out or plotting area at the top and bottom
2) numbering has to be a bit different, not from 0.3 to 3, 30 etc but
from 1 to 10, 100 etc like here which I photoshopped



3) X tics being plotted inside and outside easy to fix. Ideally adding an option tics_in, tics_out, tics_inout like in Origin

4) minor tics do not scale right with major (longer) tics if resize them.
Minor tics have to follow major tics, just always being 40-50% smaller

5) Making parameter N>90 crashes code with message of "argument to EXP out of range". Exp(90) should be perfectly OK with REAL*8 numbers

6) Message offering switch to LINEAR scale from LOG has to react on Esc
(Esc means no switch to linear in this case)

7) Attempt to resize window after launch messing up everything. After Redraw all works fine

VIII) Y caption horizontal position jumps widely when hit Redraw

LOG scale DONE!


Last edited by DanRRight on Mon May 08, 2017 2:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
DanRRight



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

PostPosted: Mon May 08, 2017 12:01 pm    Post subject: Reply with quote

CONTINUE 3

Here is another, may be better, or at least much more common option for numbering of major LOG tic marks. It looks more homogeneous and easier to implement. (The minor tics choice though does not look good, the %pl existing tics are better)



9) Again, X axis name "Wavelength" like in LINEAR case has to be centered by default. Right justified or moved somewhere has to be user's additional business if needed.

10) "Simpleplot_update" name has to be exterminated from the compiler ! This should be changed to Plot_update@(handle) which changes only the plot marked with specific handle or all open plots if handle is not set or negative

All that will make native %pl 99.9% ideal plotter.

The rest 0.1% can be added later. Some of these ~0.1% I implemented in my own graphics routines and I can share the experience and source code, often just few dozen lines of FTN95 Fortran. Mostly they are like 5 minutes to implement for programmers like Paul still they add WOW factor to the plot and leave all other real time graphics programs light years behind.

For example
- changing symbol size and color according to the Y or X value like in the plots few days back (the ones with the color bar)
- saving graphics into the PNG file PlotYYYYMMDD_hhmmss_ss.PNG and also clipboard
- adding mentioned before grid lines, color bar
- adding error bars (in the form of two numbers (a,b) which are for (+%,-%) from given Y point
- adding Settings menu
- adding move of everything with just Ctrl+mouse (i made that for all axis positions, it's very nice - all using this Fortran)
- adding boxes with the names for curves and symbols like in Crossection vs Deuteron Energy plot above posted few days back. Ability to use Greek letters, subscripts and superscripts
- adding graphics background (also easy to do in Fortran, see below)
- adding shadows to the lines, axis and tic marks
- making fill under the plot, like here



All that will still make 99.99% of ideal

AND the rest 0.01% would be adding an option of keeping all plotting proportions when the user scales the plot size by means of %pv


Last edited by DanRRight on Sat Jun 03, 2017 5:16 am; edited 4 times in total
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
Goto page Previous  1, 2, 3, ... 26, 27, 28  Next
Page 2 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