I have written a small set of Scheme files to plot functions using the graphics of TeXmacs. I put it at https://github.com/pireddag/plotFun, with short instructions on how to use it.
The code can be improved a lot and it is not well-documented (I am starting already to forget what I wrote in there); for example the plot parameters (at the moment they are the function and the range) could be supplied with a file rather than as parameters of the macro; and of course writing the function to be plotted in standard notation would also be nice, but I do not have time for this immediately.
I would appreciate, though, if someone tries it and tells me whether it works on their computer. In the github project there is a test file and its pdf output (test_plotting_Scheme.tm and test_plotting_Scheme.pdf).
A thing that I would like to improve is the placement of the tick labels: I think that to place them right I should know how long each typeset string is, but I do not know how to get this information and to pass it onto the Scheme code. I would appreciate suggestions on this too.