Showing an organised top down view of a 3D function with Maxima

16 Views Asked by At

I'm trying to use Maxima to show the top down view of a 3D function, the different values (height/depth) of the function will be shown using a range of colours and a colour bar that Maxima provides automatically.

Using this website I was able to put together some code for the top down view of the function (the code before I decided to leave out, as it was just load(draw)$ and the function itself):

wxdraw3d(
enhanced3d=true, explicit(f(y,x,15,400,1),y,0,100,x,20,30),
xu_grid=100, yv_grid=100,
xyplane=0,
view=[0,0],
zrange=[0,50],
zlabel="Gap distance (m)",
xlabel="Gap number",
ylabel="Initial velocity (ms^{-1})",
title="f(n,u,15,400,1)"
);

Which gives the following plot

As you can see, there's several issues with the plot:

  • The colour bar has no label, which would use the current z-label
  • The vertical axis (label, numbers and the subdivisions) should be on the left hand side
  • The subdivisions of the horizontal axis should be on the bottom
  • All subdivisions on the plot should appear above and not underneath
  • Border should be resized so nothing is cut off or overlapping (referring to the black border around the output, the image was a crop of inside the border)

I tried another method from this website using the gnuplot code at the very bottom to give this modified code:

plot3d(
f(x,y,15,400,1),[x,0,100],[y,20,30],
[elevation,0],
[grid,100,100],
[zlabel,"Gap length (m)"],
[xlabel,"Gap number"],
[ylabel,"Initial velocity (ms^{-1})"],
[gnuplot_preamble,"set view map; unset surface"],
[gnuplot_pm3d,true]
);

However, that didn't work as it gave this plot. Which as you can see has way more problems than the first plot. Not only is it not as clear as the first plot, it barely resembles the plot from the website, there's less info, no colour bar, no numbered axes, an annoying grid, and even the colour gradient is worse.

For the first code I used, I could not find anything about labelling the colour bar, only the range, the colour itself and whether it is on or off; and I couldn't find anything on the border size or positioning of axis labels, etc. So there's no point trying to use this code yet, especially if I get the first code to work properly. With the size of the plot, I tried wxplot_size[], but that gave the error "draw: unknown option [600,400] ", it seems to round up to the nearest hundred.

Is there any way to modify the first code such that the colour bar is labelled, the vertical axis labelling is on the other side, the small subdivisions of each axis appear over the plot, and nothing outside of the plot is cut off or overlapping? If it's not possible to move the subdivisions to be above the plot, is there anyway to remove them?

Everything else seems fine apart from those issues, and I'm not entirely sure where else to ask about Maxima.