0

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).

Ali
  • 56,466
  • 29
  • 168
  • 265

1 Answers1

2

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.

mgilson
  • 300,191
  • 65
  • 633
  • 696
  • Upvoted, it works and acceptable as a workaround. The problem is that I have a bunch of datapoints that should be plotted along with the implicit function, making the gnu_plot preamble *VERY LONG*. Well, unless I hit some built in limit for the length of a line, it could work. – Ali Jan 03 '13 at 19:11
  • OK, I will post a new question if it doesn't work out. Thanks! – Ali Jan 05 '13 at 09:46