[Jprogramming] Bug/annoyances in plot

Joey K Tuttle jkt at qued.com
Thu Dec 6 17:03:32 UTC 2012


Thank you Brian, using 'type symbol' does avoid the length error, e.g. 
with -

iMi7:~ jkt$ j64
    load 'plot'
    pd 'type symbol'
    pd 2;3
    pd 'show'
    pd 'type line'
    pd i.5
    pd 'show'

but puts a tiny red numeral 2 at (approximately) 2.2,3 on the canvas, 
then shows the line i.5 as expected. But, if in the other order -

iMi7:~ jkt$ j64
    load 'plot'
    pd i.5
    pd 'show'
    NB. line looks as expected
    pd 'type symbol'
    pd 2;3
    pd 'show'

The i.5 line disappears from the canvas (and the symbol 2) is the only 
remaining thing, again at coordinates 2.2,3

If instead of (pd 2;3), I plot two symbols e.g. (pd 2;3 1) then the 
canvas becomes completely blank - this doesn't happen with 'type point', 
but the i.5 plot does change to points... By the way, a slightly simpler 
workaround for the scalar 'type point' is

    pd 2;,3

which avoids the length error in pdf_circle ... BTW, this is with all 
current libraries in place (and results are same in 32 and 64 bit 
versions) -

iMi7:~ jkt$ j64
    load 'pacman'
    'status' jpkg ''
Local JAL information was last updated: 06 Dec 2012 08:49:37
All available packages are installed and up to date.

~~~

When my friend and I stumbled across these things, we were actually 
trying to use the NLLS verbs described in 
http://www.jsoftware.com/jwiki/NYCJUG/2010-11-09/Levenberg-MarquardtAlgorithm?highlight=%28NLLS%29 
which raised several other issues that I want to address in a separate 
thread.

On 2012/12/06 04:44 , Brian Schott wrote:
> Joey,
>
> Below is a copy of the script in j60232 that produces both lines and
> symbols on the same plot. It is taken from the demo named
> Gallery|Curve Fitting. Perhaps type symbol would work more
> predictably?
>
> y=. 3 2 5 7 6 5 7 4
> x=. i.#y
> dat=. x,:y
> m=. cubicspline dat
> x2=. steps 0,(<:#y),50
> y2=. m interspline x2
> y3=. (3 lsfit dat) p. x2
> y4=. (5 lsfit dat) p. x2
> pd 'title Spline vs Cubic vs Quintic'
> pd 'backcolor lightgray'
> pd 'type symbol'
> pd x;y
> pd 'type line'
> pd x2;y2,y3,:y4
>
>
>


More information about the Programming mailing list