Plotting functions with TeXmacs graphics

I have written a small set of Scheme files to plot functions using the graphics of TeXmacs. I put it at, 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 ( 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.


Thanks a lot it is a great improvement
I work in windows 10
I have downloaded, drop all the files at the suggested folder C:\Program Files x86\Texmacs\progr\graphics and the function does not work.

1st The name of the folder is graphics, not Graphics as you suggest. I do not know it it is so relevant
2nd How does one exactly load the package
3rd At the folder C:/users/…/AppData/Roaming/TeXmacs/progrs/graphics is it necessary to drop some files?


thanks for trying :slight_smile:
I have tested it on Linux so far. Let me check how it works on Windows and I will get back to you.

Of course the program will be usable for documents once some important details are added (axes labels, possibility of plotting more than one function, choose colors for lines, more precise placement of tick labels, option for exponential notation and of course there are more).


As a TeXmacs developer, I failed to make your code work in 10 minutes.

There is an example plugin, you may reorganize your code:

@sadhen on which operating system did you try the code? I tested it on Linux only, as on Windows I have not yet figured out where is the TeXmacs user directory.

@sadhen (and @Pdiazs) On Windows there is something fishy going on, I am suspecting a bug.

I have put things temporarily in TeXmacs own directories (not in the user directories, as I do not know where they are). I have made a subdirectory of packages\example which I called _personal and I put the packages there. I happen to have there several packages, among them there is a package called SIUnits (it is as well in my GitHub account). If I load plotFun alone, the plotFun macro does not work. If I load plotFun and SIUnits, plotFun works (!), except for the first instance of use; this although the two packages are unrelated. I can investigate this a bit better this evening, and it would be very nice if someone would tell me where to put things in Windows. I will also reorganize my code copying the organization of Karl Hegbloom.

I’m using GNU/Linux. (Debian)

Ok, there it should work (I use Xubuntu). I will reorganize the code this evening and maybe you can try again.

@sadhen done, will reorganize again following the suggestion of JvdH on the mailing list, but maybe what I did is already enough to make it possible for you to get the package to work on your computer.

It works fine now.

Note: I have taken extra steps:

Click Edit->Preferences..., switch to the Other tab and then use Accept all scripts for Security.