Question

The plot is generated by the following commands in Maxima. How can I add dots / markers at given coordinates?

load(implicit_plot);
ip_grid_in:[15,15]$
implicit_plot ([x^2 = y^3 - 3*y + 1, y=x^2], [x, -4, 4], [y, -4, 4], 
           [gnuplot_preamble, "set zeroaxis"]);

I have tried adding [discrete, [[1.0,1.0], [1.0, 2.0]]] to the list of equations but apperantly implicit_plot cannot handle it (perhaps because it is not an equation).

Was it helpful?

Solution

I'm no maxima wizard, but in gnuplot, I would add points using set label.

set label 1 at 1,1 point
set label 2 at 1,2 point

Based on what you have above, I would think you could just add this to the preamble:

implicit_plot ([x^2 = y^3 - 3*y + 1, y=x^2], [x, -4, 4], [y, -4, 4], 
       [gnuplot_preamble, "set zeroaxis;set label 1 at 1,1 point;set label 2 at 1,2 point"]);

It's a bit ugly, but I'm betting that it works :)

Of course, you may need to unset those labels in a later preamble if maxima re-uses the same gnuplot instance and doesn't issue a reset implicitly:

unset label 1; unset label 2

There are lots of things you can do to customize the appearance of the points (color, point-type, etc). in gnuplot, help label should discuss a bunch of those options if you're interested.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top