in Julia. The above plot was created in MATLAB with the command:
waterfall(xi, tdata, abs(u1data'))
where xi and tdata was 1d arrays and u1data is a 2d array containing u1 at each xi and t value. Is there a corresponding way of creating such a plot in Julia?
If not, how does one produce a surface plot with just matrices (no function for finding z from x and y)? I’ve tried this:
using PlotlyJS;
PlotlyJS.plot(surface(z=abs.(u1data), x=xi, y=tdata));
and absolutely no plot is generated (nor is an error message or warning message). I’ve issued this command both in the Julia REPL and in Jupyter Lab. I have WebIO installed using the command:
I’ve been able to answer the surface plot question of mine. I just converted xi and tdata to 2d arrays with each element corresponding to the value of the variable in question at the particular point in the grid, and used plot_surface from PyPlot. Specifically, using the code:
pygui(true) makes the plot get launched as an interactive GUI (as opposed to a static image in the browser, which is the default); the xlabel, ylabel and zlabel commands are just adding in labels.
I would like to just say thank you for the obvious effort you put into your answer, it is very much appreciated. My tdata is not equally spaced and it has over 49,000 elements, so I had to adapt your code to my situation. Namely, I had to write code to cherry pick elements of tdata that were closest to the integer values of t. With this change, however, I find your code with WGLMackie did produce the required plot window.
I do have a follow up query though. How do you save this figure to a file? I’ve looked up the documentation for Makie but its save() function only seems to work when you feed it a scene object and there’s no scene object created in this code.