Menu

#486 variables for projection view

open
nobody
view (1)
5
2019-03-10
2019-02-22
No

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?

Discussion

  • Ethan Merritt

    Ethan Merritt - 2019-03-07

    Neither the command set view map nor the command set view projection creates a unique state that can only result from this particular command. They are essentially a convenience short hand for a sequence of set ... 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 individual set 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.

     
    • Martin Saturka

      Martin Saturka - 2019-03-08

      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 the GPVAL_VIEW_MAP variable that tells us whether we are in map view now.

       
      • Ethan Merritt

        Ethan Merritt - 2019-03-08

        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 to set 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 hand set view 0,0,1.8 gives you the same view as set 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.

         
        • Martin Saturka

          Martin Saturka - 2019-03-10

          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 do set 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 doing set view angle1, angle2since here we lose the original view. And since splot_map is a part of the ALMOST2D macro, gnuplot makes a distinction here too.

          When I play with the set view projection stuff, I can see that subsequent issuing of set view does not restore the pre-projection view. It looks like some omission. I expected the restoration (by set 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 the set view projection commands; I've just expected them to be more like set 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.

           
    • Martin Saturka

      Martin Saturka - 2019-03-08

      The set view projection cases are more involved. Besides the set view projection xy that is used as a nickname for set view map, the other two preojections have mostly fixed views too, though not as fixed as the map view.

      Both set view projection xz and set 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 the z-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 and yzprojection 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 the GPVAL_VIEW_MAP variable for its identification, the other two (that is xz and yz) projections could really state something at the variables too.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.