Well, this is about Simpleplot's %pl function again. This function is very handy but not many users seems use it and not all bugs are hunted down there.

If you make declaration in %pl[Y_MIN=1.d-7] or Y_MAX=1.d-3 expect to lose a day hunting the unexplainable behavior or the graph scales. This is because you naturally expect it to accept only double precision values but things here are exactly opposite, counterintuitive to general design of CWP.

Suggestion is for compiler to warn user that form of double precision is not accepted here or make it acceptable.

Another suggestion is to warn user when %pl can not use LOG scale user required due to zeros so the %pl switches to linear scale explaining why.

%pl is only usefull when you have to do some very simple plots. I used Simpleplot a lot from the very beginning (when BUSS was still alive in the 90') and I would advise to program specific subroutines for making graphics using the proper subroutines of Simpleplot. Manuals are in the Silverfrost web site, and yes, that requires more work but in the end you will find that you have better control of your graphs (and lots of other facilities). It is a pitty that the development of Simpleplot has been frozen but one get graph facilities for free....and that's good....at least for me...

This still existing bug and the lack of update or upgrade of some features of Simpleplot is a natural consequence of the dissapearance of BUSS software company.....I guess the last version of Simpleplot is now 12 years old....maybe too old for the today software standars, but it still works "almost" fine and free....but of course, if you need a better and bug-free solution, you then have to look at Gino, for example....as I use fortran for personal use, I can accept Simpleplot as it is...

Sorry for the delay but I was out for a couple of days and with no access to my computer.

First point: I said it is free because it comes with the fortran compiler, so you do not need to buy it apart like Gino or other graphic packages, although I do not know what happens if you want to use the routines in programs for commercial use.

Second point: there is no Simpleplot LIB (although there was one when BUSS was developing and selling the software, first for FTN77 and then for FTN90 and FTN95, among other compilers). Today you have just a DLL that comes with the distribution of FTN95. Manuals and help files (i.e. FSimpleplot.chm) are available in the Silverfrost web site.

Third point: here is an example of fortran code using the proper Simpleplot subroutines instead of %pl. You have to compile this code with Simpleplot.dll in order to run properly. I guess the Module SPwin is explained in the manuals.

! Useful definition of data structure to hold BitmapDC to pass to SIMPLEPLOT

Contains

SUBROUTINE SP_SupplyBitmap ! Pass Bitmap to SIMPLEPLOT
! Set up a Static (SAVEd) array of OpCodes. Each OpCode consists of an
! OpCode ID followed by an optional address of a data structure.
! The parameter block address is passed to SIMPLEPLOT by SUBROUTINE DDDATA.
!
! In this example:
! SIMPLE_WINDOWS_SET_HDC_DIM specifies that the next integer is the address
! of a data structure consisting of a Bitmap DC followed by its dimensions
! SIMPLE_WINDOWS_END_LIST is the mandatory end of list item which does not
! require the address of a structure
TYPE(SIMPLE_WINDOWS_DATA_STRUCT_T), DIMENSION(2) :: OpCodes
SAVE OpCodes
OpCodes(1)%iOpc = SIMPLE_WINDOWS_SET_HDC_DIM ! hDC + dimensions
OpCodes(1)%iPtr = LOC(HDC_DIM) ! See definition of SPWIN above
OpCodes(2)%iOpc = SIMPLE_WINDOWS_END_LIST! End of list
CALL DDDATA(LOC(OpCodes))! Notify SIMPLEPLOT
CALL DEVNAM('WINDOW') ! Select Window
CALL OWNNEW(.TRUE.) ! Inhibit 'Continue' button
END subroutine SP_SupplyBitmap

!this subroutine is needed if the content of the graph window changes during the program run
SUBROUTINE UpdateWin
CALL OUTBUF ! Flush buffers
CALL WINDOW_UPDATE@(HDC_DIM%iBitmapDC) ! Copy Bitmap to window
END subroutine UpdateWin
END MODULE SPWIN

As far as I tested simpleplot.dll, it contains the whole set of graphic subroutines, even those related to maps, 3D visualisation, etc. So, for taking full advantage of what Simpleplot can do, one needs to read carefully the help file (well, the sections corresponding to the type of graph one wants to program).

There is apparently a "minimal" version of Simpleplot in FTN95: it's the one that use %pl......but if you use directly Simpleplot trough a %dw window, you have quite a lot of possibilities. Simpleplot offers linear regressions, iso surfaces, drawing an iso surface in slices, contour maps, etc.

Agustin

P.D. by the way, the minimal example could be even more minimalistic (appart from the simpleplot module):

So it's a %dw window, is it. My first encounters with Clearwin were trying to use a %dw window to replace the old DBOS graphics. I didn't make much headway for some years. The trick to make better progress is to use a %gr window. Perhaps it is worth revisiting %dw!

The confusion about what simpleplot.dll is likely comes from what the Ftn95 Help says: "ClearWin+ provides access to SIMPLEPLOT via a dynamic link library (simple.dll) that is distributed with Salford compilers. Access to this library is available by using the winio@ function together with the %pl format code. %pl is designed to be similar to %gr."

In fact, one can directly use Simpleplot.dll. The difference is that one uses %dw (with its limitations) instead of %gr (i.e. %pl). %pl was set to provide fortran users the possibility to make rather simple plots with minimal efforts. But Simpleplot is far more than that. It is far from perfect (rather old, the problem with ticks in the y-axes, fonts are far from the best ones, etc.)...but it works....

When Ftn90 (not FTN95!) was still in the very beginning, David Butland from BUSS sent me the first directives for creating a module that allowed one to use SIMPLEPLOT with Clearwin+ through a %dw window. Then, they added it in the printed manuals that used to come with the installation disks. Today you can find these instructions in the document "Using SimplePlot with FTN95" in this address: http://www.silverfrost.com/23/ftn95/support/documentation.aspx.

With this module you can use the whole library (v. 2-16), even those related to maps. The only problem is that the manual for maps is not available in the Silverfrost site. I know that you can use maps because I checked it some time ago with some old examples, but I have no manuals at all because when I bought Simpleplot in the 90' the map library was a set that was sold apart at a different price.

Agustin

Update!!!: maps examples are available in the help file FSimpleplot.chm, also available at Silverfrost....interesting is that no information about the module for using Simpleplot with FNT90/95 is available there...