|
From: Jaime V. <vi...@fe...> - 2024-11-11 22:08:26
|
On 11/11/24 20:16, Patrick Alken wrote: > Is there a way to plot colored rectangle objects using spherical > coordinates to define them? I made a post on stackoverflow with my > dataset and what I'm trying to do: > > https://stackoverflow.com/questions/79178991/drawing-rectangles-in-spherical-coordinates-in-gnuplot > > > I am looking for a command like: > > set obj 1 rect from spherical THETA0,PHI0,R to spherical THETA1,PHI1,R > > but it doesn't appear this is possible (yet) in gnuplot. Is there > anyway to do this? > > Hello, This is probably not what you are looking for, but in any case, using Maxima (maxima.sourceforge.net) I can generate a gnuplot input file with something similar to what you want, with the following commands: d:%pi/10$ f:makelist([5,[th,5*d,6*d],[ph,i*d,i*d+d]],i,0,20)$ f:append(f,makelist([5,[th,4*d,5*d],[ph,i*d,i*d+d]],i,0,20))$ f:append(f,makelist([5,[th,3*d,4*d],[ph,i*d,i*d+d]],i,0,20))$ f:append(f,makelist([5,[th,2*d,3*d],[ph,i*d,i*d+d]],i,0,20))$ plot3d(f,[transform_xy, spherical_to_xyz],[grid,1,1],[z,-5,5],[gnuplot_script_file,"spherical_rectangles.gpt"],nolegend); The last command will show you the location where the "spherical_rectangles.gpt" file was saved. Regards, Jaime Villate |