Gnuplot 5.3 has a new command for setting 3D view: set view projection xy/yz/xz
, though I could not find any variable that would indicate the state of this view. The show view writes it, though it cannot be used for state detection at programmatic (e.g. bind) stuff.
We have GPVAL_VIEW_MAP
for map view (and it is set for xy projection too), though the yz
and xz
projections apparently do not have anything set that would help to detect it. Could we get something set for that, please?
Neither the command
set view map
nor the commandset view projection
creates a unique state that can only result from this particular command. They are essentially a convenience short hand for a sequence ofset ...
commands affecting x_rot, z_rot, azimuth, scale, xyplane, axis tic positioning such that the resulting 3D plot layout more closely resembles what would have been generated by a suitable 2D plot command. You could reach the same state by issuing the individualset foo
commands, and you might wish to further tweak the layout (e.g. different choice of where to put axis tic labels). So no, I don't think there is any single thing you could test for and report back.Hi, Ethan!
First of all, let me thank you for your efforts at dealing with the issues and gnuplot development at general. I hope that you consider my pushes as humble attempts of a devoted gnuplot user, and not just as terrible invectives :-)
Regarding the
set view map
, I can not see how to do it with just setting rotations, etc. since when I only set an orientation of the common 3D view (that is without setting the map view), I can distort it by 3D rotations. Though it does not hold for the map view! When the map view is set on, varying the x_rot, z_rot values, etc. change nothing. And yes, according to that, we have theGPVAL_VIEW_MAP
variable that tells us whether we are in map view now.Not sure what you mean by "distort the view". Are you just noting that click-drag with the mouse buttons has a different meaning?
set view map
is equivalent toset view 0.0, 0.0, 1.417
plus a bunch of axis label tweaks. It also changes the mouse button bindings to those in 2D mode. If you move the view angles away from 0,0 then it is no longer an axial projection, e.g.set view 1., 1.
is close to the "map" view but canted by 1 degree. On the other handset view 0,0,1.8
gives you the same view asset view map
except that the scale fractionally larger so the plot area is bigger.I suppose it might sense to make the same change from 3D to 2D mouse button bindings for all combinations of x_rot, y_rot that produce regular aligned axial projections. On the other hand that would potentially trap you in one of those settings if you happened to rotate through it using the mouse.
I've tried to play with it more, and it seems to be more involved. I first dealt with
set view map
. When I do it, and when I doset view
then, it looked like getting the original (pre-map) view. Alas, while rot_x and rot_z get restored, the azimuth angle gets cleared! Is not it a bug? Could we get azimuth restored too? I guess that azimuth is affected just because azimuth is a later addition to gnuplot.Notice that at least the rot_x and rot_z restoration states that
set view map
is not equivalent to just doingset view angle1, angle2
since here we lose the original view. And sincesplot_map
is a part of theALMOST2D
macro, gnuplot makes a distinction here too.When I play with the
set view projection
stuff, I can see that subsequent issuing ofset view
does not restore the pre-projection view. It looks like some omission. I expected the restoration (byset view
command), thus have been considering it as a new state. Is it possible to get the rot_x and rot_z (and possibly even azimuth) restoration here?I feel an unease about the (partial and) inconsistent restoration via
set view
here. To not get understood wrong, I like theset view projection
commands; I've just expected them to be more likeset view map
, i.e. with restorations of the original state.BTW I do consider the
GPVAL_VIEW_MAP
variable within the key-bindings that I use for gnuplot, thus I recognize when it is at the map view. I just wanted to be able to recognize (inside key-bindings) when it is at the other (new) map-like views.The
set view projection
cases are more involved. Besides theset view projection xy
that is used as a nickname forset view map
, the other two preojections have mostly fixed views too, though not as fixed as the map view.Both
set view projection xz
andset view projection yz
get the view rotated by the < and > keys that should be about azimuth changes (this does not hold for xy/map view though).Along with that, the
set view projection yz
(though not the xz projection) gets thez
-axis-1
-multiplied on attempts to do the other rotations (by arrow keys). BTW Is this specific z-inversion intentional?No other common rotations seem to work (at least when using the respective key bindings) at the projections.
Taken together, even though the
xz
andyz
projection views are somewhat more flexible, they are still more fixed than just setting common 3D view for equivalent orientations. And since xy projection (map view) provides theGPVAL_VIEW_MAP
variable for its identification, the other two (that is xz and yz) projections could really state something at the variables too.