I have created a slice in paraview. This slice is rotated about the z axis. Hence when I use the "Axes grid" for adding the axes, the axes also appears to be rotated. If there a way to define a new axes in Paraview that aligns with the rotated slice? Can someone please help me?
You will have to use the Transform filter and configure it manually based on your slice Z-rotation. Not very practical I agree.
Related
I wanted to change the position of z-axis in a 3d graph. I tried to do using graph properties but it does not work, Matlab has this option in 2D plot in axis properties window in the graph, but it does not work in 3d plots. Currently,the plot is at z=0 and I wanted to the position to z=6. Attached is the sketch where I need to change the position of the curve plot (red) from z=0 to z6. I appreciate if there is any solution/suggestion regarding this issue. Thank you.
sketch
Regards,
Alishah
A very simple solution for this question is that convert z in your formula to z-6. You know it from mathematics, It will shift a curve, 6 unit .
If you want to change in right or left, you plus or minus.
How to change in Paraview, the co-ordinate axes from default to left-handed co-ordinates from This to This
I am reading in a vtk file written in legacy format for rectilinear grid
Thanks for the help
ParaView does not support left-handed coordinates. The best you can do is convert your left handed coordinates to right-handed coordinates to make them displayed correctly. The easiest way to do so is probably to use the Transform filter and scale by -1 along one axis.
Unfortunately, you cannot change the labels of the orientation axes (in the lower right corner) to be labeled as left-handed. However, if you are using the Axes Grid, you can changes the labels of that to indicate left-handed coordinates.
I'm creating a simple GUI in MATLAB and I'm trying to create a figure that contains a 2d plot on an axes, all is working well, but I have a rough time trying to figure out how to fix the position of the axes/plot.
The axes seems to scale with the figure window size. If I maximize the figure on my screen, the axes is maximized within, etc. What I want to accomplish is to have a row of buttons beneath the plot on the same figure as the plot, basically an area of 50 (ish) pixels tall that the plot does not encroach on. I know how to do this in HTML, but I can't figure out a good way in MATLAB.
Any alternative approaches would also be greatly appreciated.
Change the units of the axes to anything other than 'normalized', like 'pixels'. Then it won't automatically resize with the figure. From this documentation page:
When you create a graph, MATLABĀ® creates an axes to display the graph. The axes is sized to fit in the figure and automatically resizes as you resize the figure. MATLAB applies the automatic resize behavior only when the axes Units property is set to normalized (the default).
Use set(gca,'Position',pos) where pos = [x y w h] to set the position and size of the axes in the units you chose.
See this answer for an example and a function for holding an axis size once you have it in place.
I would like to change the view of a 3D plot in matlab such that the y-axis points upward and the z-axis points to left. For example, consider the following plot:
Here the x-axis points forward, the y-axis points to the right and the z-axis points upward.
I would like to have the y-axis points upward and the z-axis points to the left instead. I tried to rotate the plot (using the figure window toolbar rotate button) but I could not get it to work. (It should just be a simple 90 degrees rotation about the x-axis)
Code to generate the plot:
membrane
view(100,50)
xlabel('x-axis');
ylabel('y-axis');
zlabel('z-axis');
grid on
Try using view. I don't have MATLAB available so I can't test it, but I think it can do what you want.
Example from the documentation:
Set the view along the y-axis, with the x-axis extending horizontally
and the z-axis extending vertically in the figure.
view([0 0]);
EDIT:
Try using three inputs to the view function. I can't experiment myself, but you should be able to do it if you choose the right values here.
From documentation:
view([x,y,z]) sets the view direction to the Cartesian coordinates x,
y, and z. The magnitude of (x,y,z) is ignored.
EDIT 2:
Check out camroll. I think camroll(90) (possibly in combination with view) will work.
From documentation:
camroll(dtheta) rotates the camera around the camera viewing axis by
the amounts specified in dtheta (in degrees). The viewing axis is the
line passing through the camera position and the camera target.
This was posted a while ago, but in case someone else is looking for ways to set y-axis as the vertical one here is a possible fix.
Manually: In the command window type cameratoolbar('show') which will open an interactive toolbar in your plot from which you could change the view. One of the options is to set a principle axis to x, y, or z.
Or in you script you could use cameratoolbar('SetCoordSys',coordsys) command which sets the principal axis of the camera motion. coordsys can be: x, y, z, or none.
http://uk.mathworks.com/help/matlab/ref/cameratoolbar.html
I want to create a perspective projection of a 3D image onto the x,y plane with a focal length of 10 and a principal point (-1, -5).
I found:
view
viewmtx
But I do not get how to tell matlab that I want to use the x,y plane nor how to set the focal length? Can someone explain me how to do that?
I'm afraid you are not looking for the right functions.
The view function does only change the point of view on the current axis, while viewmtxreturn a transformation matrix.
You may want to do something similar to what it is discussed on this post How do I draw a texture-mapped triangle in MATLAB?, where maketform and imtransform are the key functions to get a plane image reprojected into another certain 3d plane.