Topic: APLOT 2D-plots

Jeff,

Thank you very much for adding a plotting routine to SF.  It's a very nice addition.

I have some comments.

I'm having difficulty displaying the APLOT graph a second time from a plot button in my application; the Myexample.exe in the SF development environment crashes. Also if I drag the APLOT graph larger and then smaller repeatedly, the Myexample.exe crashes when run from within my application.  This may be specific to my application and not necessarily APLOT itself. I'm still looking into the problem, but any suggestions would be helpful.

Suggestions for APLOT:
1. Add a Logarithmic axis option
2. Help menu in APLOT graph should be programmable
3. APLOT graph title bar should be programmable
4. Autoscaling should expand the x-axis slightly wider
5. The data set legend labels should be optional
6. Move the Y-axis label slightly more to the left away from the number labels

Problem -
The following dataset does not scale properly using APLOT autoscaling.
The objective here is to plot a best-fit curve over the data points (not connect the points).

program test
use aplot
implicit none

type(aplot_t)::p

!--- X axis values
real, dimension(20) :: x1 = &
(/ 0.50,  1.20,  1.60,  1.86,  2.12,  2.36,  2.44,  2.36,  2.06,  1.74, &
1.34,  0.90, -0.28, -0.78, -1.36, -1.90, -2.50, -2.88, -3.18, -3.44 /)

!--- Y data points
real, dimension(20) :: y1 = &
(/ -2.00, -2.10, -2.30, -2.50, -2.80, -3.36, -4.00, -4.75, -5.25, -5.64, &
-5.97, -6.25, -6.44, -6.44, -6.41, -6.25, -5.95, -5.65, -5.24, -4.70 /)

!--- Fitted curve to y data points
real, dimension(20) :: y2 = &
(/ -1.96, -2.12, -2.32, -2.52, -2.81, -3.34, -3.97, -4.74, -5.24, -5.64, &
-5.98, -6.28, -6.43, -6.42, -6.40, -6.25, -5.95, -5.65, -5.24, -4.71 /)

p = initialize_plot()
call add_dataset(p, X1, Y1)
call set_title(p, "Example Plot")

CALL set_xautoscale (p)
CALL set_yautoscale (p)
call set_xlabel(p, "X-VALUE")
call set_ylabel(p, "Y-VALUE")

call set_serieslabel(p, 0, "Point Data")
call set_seriestype(p, 0, APLOT_STYLE_DOT)

call add_dataset(p, X1, Y2)
call set_serieslabel(p, 1, "Line Data")
call set_seriestype(p, 1, APLOT_STYLE_LINE)
call display_plot(p)

call destroy_plot(p)

CALL setcurrentwindow (idActiveScrn)

RETURN
end program test

As always, APLOT is a very thoughtful addition to SF.

Frank

Re: APLOT 2D-plots

Aplot on Windows, in your case, is almost certainly crashing because it is being called from an AppGraphics application.  As Aplot itself on Windows is an AppGraphcis program, there is a good chance that some sort of interaction is causing the crash.  I'll see if it can be avoided.  As to your suggestions:

1. Add a Logarithmic axis option

That feature should be possible.  Aplot's underlying engine is not our own.  I believe logarithmic axes are possible, though.

2. Help menu in APLOT graph should be programmable

I'll consider removing it entirely, but there are absolutely no plans to support any programmable changes to the window itself.

3. APLOT graph title bar should be programmable

The title bar should probably be changed to match the plot title.  But I'll see about changing the window title arbitrarily.  It has to be supported across platforms, so I'll have to look into the other platforms too.

4. Autoscaling should expand the x-axis slightly wider

I'll look into it, but no promises...

5. The data set legend labels should be optional

I agree.

6. Move the Y-axis label slightly more to the left away from the number labels

I'll fix this.

Jeff Armstrong
Approximatrix, LLC