[Maxima] graphical interface to commands?
sen1 at math.msu.edu
Fri Mar 19 08:09:36 CDT 2010
On 03/19/2010 07:12 AM, Mario Rodriguez wrote:
>> > I would like to be able to do the following.
>> > Assume that f(x) is defined.
>> > 1. Generate an empty plot window.
>> > 2. Pick the points in the window with the mouse and generate a line
>> > segment on the plot.
>> > 3. Perhaps with the use of another key pressed, generate the image of
>> > the line segment and plot it (just as the commands above do).
>> > Thus, I want a graphic interface to the selection of the line segment
>> > and the plotting of its image.
>> > Any ideas will be appreciated.
>> > -sen
> I don't know if it is possible to send information generated by Gnuplot
> back to Maxima through the pipe. That would be very nice. But it is
> possible to write some information into a file from Gnuplot and then let
> Maxima read it and make something with it.
> The script below is an example. First, you middle clic on the window to
> select the points; after every clic, press the 'x' key to save the
> coordinates into file 'data_for_maxima'. Once you have finished your
> selections, press the 'd' key and the polygonal line should be plotted.
> Once you press 'd', Gnuplot writes into file 'message_for_maxima.mac'
> the code 'message:1$'. Meanwhile, Maxima is repeating an endless
> while-loop; during every iteration, Maxima reads if variable 'message'
> has changed from 0 to 1. When it is equal to 1, Maxima reads the
> contents of 'data_for_maxima' and plots the segments.
> See also embedded comments.
Thanks for the code. It gives me a beginning.
Here is a question about the code.
When I do the plot, instead of seeing the coordinates on the screen, I
only see the second coordinate.
The shown coordinates look like
]1,1.2000 -:00, y] where y is the second coordinate.
Why is this? Also, how do I correct it so that I see both coordinates?
More information about the Maxima