As a first step, the axes drawing and autoscaling are already working :
**** sorry cut & paste doesn't work correctly ****
This works :
- autoscaling to user-units
- automatic adaption of the frame and text-size to the screen-resolution
- draws only the used quadrants of the graph
- coordinate-transformation
The next tasks are - the user-interface to interact with the x-y-graph - formula input - x-range-input - start-calculation and so on .
The target-application for me is a x-y-graph with multiple y-axes , to do some iterative simulations for dc-motor-drives or similar things.
Ok - it's still a long way to version 1.000 , but i promised Lutz that i'll show what i'm working on .
PS : the code doesn't fit exactly in the forum-width , i hope it works anyway - how can i store pictures and text-files into this forum ?
Sorry - the code seem to be to big for the forum . I have to delete it.
If you have a flickr account, you could link to images there. Or use www.shareavenue.com or something similar.
Or how about posting your code on the newLISP wiki?
//http://alh.net/newlisp/wiki/
Many thanks Cormullion , i copied the code to this - i don't know if you meant it this way .
http://alh.net/newlisp/wiki/index.cgi?page=Guiserver_user_contributed_Code_Snippets
The code seems to be complete .
( define ( xrel-to-screen rel ) ( / (* rel ( gs:screen 0 )) 100 ))
( define ( yrel-to-screen rel ) ( / (* rel (gs:screen 1 )) 100 ))
( define ( xrel-to-screen rel ) ( / (• rel ( gs:screen 0 )) 100 ))
( define ( yrel-to-screen rel ) ( / (• rel (gs:screen 1 )) 100 ))
Sorry - the wiki translated two times the * on two places into circles , see code above .
If i change the circles into * the program-snippet works correct.
A first picture :
//http://img4.shareavenue.com/image.php?file=f073869d7f9395067e398b6b87162b74efb504e9
hope i didn't wreck your nerves - thanks cormullion for the shareavenue-tip!
worked OK first time for me! Looks like it will be useful code too.
Somehow the code disappeared out of the wiki - i think someone deleted it.
I give up , i'll programm the next task and hopefully be soon back with the complete application .
Quote from: "didi"
Somehow the code disappeared out of the wiki - i think someone deleted it.
It was there when I looked yesterday - perhaps I deleted it accidentally by looking at it? (Schrödinger's Wiki...?) :-) Hope not - sorry if I did.
somebody deleted it because the page was not password protected. I restored it clicking on the link, then typing 'restore' where it says 'page'. Then I protected it with the usual password, Ryon gave us, see here:
http://alh.net/newlisp/wiki/index.cgi?page=How_To_Use_Advanced_Features
Lutz
ps: when putting code into the wiki, every line should be preceded by a space, so characters and indentation are not changed.
Thanks Lutz .
Now copy & paste from the wiki into the newLISP-edit works, too.