can gnuplot point the z axis to left or right? - plot

I am new to gnuplot, and am using it to draw 3d plots. I would expect gnuplot should be able to orient the xyz coordinate system in any orientation, but that doesn't seem to be the case. The z axis appears constrained to be in a vertical plane perpendicular the screen of my monitor. In other words, I cannot get the z axis to point at all to the left or right. Is this possible, and if so how is it done? I will try to include an image of a 3d plot made with Mathcad that shows what I mean.enter image description here

Related

Rendering combined 2D and 3D maps in R

I saw this figure in Leland Wilkinson's book the Grammar of Graphics and was wondering how I could go about creating something similar in R.
I am suspicious this could be done using rgl, persp3d, but there's a couple aspects that are unclear to me like how to create the conformal mapping shown in the coordinates of the XY plane, as well as how to create the 2D color map in a 3D context.
Any advice would be much appreciated. Thanks!
That should be possible with rgl, but there might be some snags in the details. Here's the outline:
The green surface does not appear to have a rectangular base,
so you'll pass matrices for all of x, y and z coordinates to surface3d() to draw it.
I can't tell if the map is on a flat surface with curved edges, or if it's a curved surface. In either case, you plot the surface with a 2D texture showing the map and the contours.
a. To produce that 2D texture, use whatever mapping software you've got, and output the image to a PNG file.
b. To put it on the surface, use surface3d() with arguments texture = <filename>, texture_s = ..., texture_t = ...) where texture_s and texture_t are set to coordinates in the image (bottom left = (0,0), top right = (1,1)) corresponding to each x and y location. The z value is
either constant or varying depending on whether you want it flat
or curved.
The axes will be drawn with axis3d.

R: create animated gif in rgl with rotation around Z axis

I need to produce an animated gif from a OpenGL visualization package rgl in R. The recipe is described in this link at genomearchitecture.com. First we create some 3D cube with our image. It was produced in plot3D package via scatter3D() commands. Next we invoke a rgl window with it by
require(plot3Drgl)
plotrgl()
The recipe from the link above sounds as follows (essential part):
for (i in 1:90) {
view3d(userMatrix=rotationMatrix(2*pi * i/90, 1, -1, -1))
rgl.snapshot(filename=paste("animation/frame-",
sprintf("%03d", i), ".png", sep=""))
}
that is we create 90 rgl snapshots and rotate our object using parameters in userMatrix=rotationMatrix() directive. However exactly this directive performs rotation around some specific axis, and the whole rotating animation looks kinky, especially if we have just a 3D geographical map to rotate, like on this image.
We do not want this image rotate and go upside down, we just need to rotate it around vertical Z axis. However, every attempt to modify the directive view3d(userMatrix=rotationMatrix(2*pi * i/90, 1, -1, -1)) changing vector (1,-1,-1) produces the cube with Z axis facing to us with initial position of the angle.
In the static framework the position of the cube can be intuitively controlled by two polar coordinates via directive
plotdev(theta=10,phi=15)
It would be good to program the snapshots running theta from 0 to 2 pi with some reasonable phi, but setting theta, phi instead of userMatrix works good only for static image. In rgl window it again produces something not expected, for example, theta=0, phi=0 again aim Z axis towards us. How it is possible to modify the view angle directive to make the cube rotate around its Z axis?

GNUPLOT, How can i know the coordinate (x,y,z)

I'm new for the Gnuplot.
I have some trouble.
For the 2D graph, There is the coordinate (x,y) at the left-bottom but i want to know.
How can i know the coordinate (x,y,z) when i move the mouse pointer on the 3D graph.
I waste my time for search the answer but I'm still cannot find.
thank in advance for your help.
That is not possible, because gnuplot doesn't hold all data points to be accessed by the mouse.
In 2D, the displayed coordinates are extracted from the graph boundaries, but there is no such things to snap the mouse pointer to the nearest plotted data point (like requested in How can I make gnuplot show coordinates of a plotted function which have same x value as the mouse pointer?).
Because of the missing "data snapping", it is not possible to extract the 3D coordinates from the 2D mouse position.

Object under mouse beyond near clipping plane

I have a perspective projection. I want to have an object follow the mouse. It works fine when I set the object to be almost on a near clipping plane. But as the object goes beyond the near clipping plane, its movement is more and more distorted in a comparison to the mouse position. I know I need to change X and Y coordinates to reflect modified Z, but I don't know exact equation.
The viewport limits map to the near plane, so close to the near plane the scaling factor is ~1. So all you have to do is to scale by the distance of the object in view coordinates in relation to the distance of the near clipping plane:
scale = Z_object / Z_near

IDL: Can I get the coordinates of a point on my plot's cartesian plane?

I have a plot like this:
http://i.imgur.com/i9xp5.png
I need the data coordinates of points in order to plot wind barbs.
Now, if I wanted a wind barb to be drawn at x=100, y=20, is there a way I can obtain the data coordinates of that ( or other ) points of my plot?
Would the ARROW procedure be of any use to you? It looks like you could
just pass it your data coordinates (x0=100, y0=20) for the base of the arrow,
and another set of coordinates x1 and y1 representing the length and direction for the arrowhead end. It should take care of placing and scaling them properly on your plot.
But I don't think ARROW gives you any control over the arrow style, except for color,
heaviness of the lines, and filled vs. unfilled. If you need to use a different
shape, I think you might have to express it as an array of XY points to define
the vertices of your custom arrow symbol, then rotate, scale, translate, and PLOTS
line segments between each symbol vertex.
The DATA and DEVICE graphics keywords tell the various plotting routines whether
the coordinates are in data coordinates or device coordinates. I'm not sure from
your description which is the appropriate setting, but one of them should do what you want.

Resources