Suppose I have two plots on the unit sphere in Matlab. I would like to be able to match the two plots in the following sense: I want to overlap them and see if I have the same thing. In order to do this I would like to fix one of the plots and rotate the other by hand.
Is it possible to do this in Matlab: rotate a part of the plot while keeping another part fixed?
Related
I wonder if anyone can help me to plot two 2D histograms on the same plot.
I do some lifetime imaging and I want to reproduce my result as histograms (phasor plot method). I know how to plot a single 2D histogram, but not more, without removing the preceding one.
I am currently using the DIPimage toolbox, but I have seen that for plotting 2D histograms you can use as well the function 'ndhist'.
Please, find attached the picture. This is not obviously what I am after, as the background should be all blue and I would like to plot more 'clouds' over the universal circle.
I'm trying to generate a 3D structure from a set of 2D cross sections in Matlab- in my case it's a wing that I've optimized the structure for. For the simple example I have two cross sections that are not identical. They can be seen here.
Now I want to do a loft between the surfaces and put caps on the ends, which I do with isosurface and isocaps, respectively. Since I don't want the vague contours, I include a threshold
threshold=0.6;
% loft
fv=isosurface(xq,yq,zq,vq,threshold);
%lids
fvc=isocaps(xq,yq,zq,vq,threshold);
fvc.faces = fvc.faces + size(fv.vertices,1); %re-numbering
%structure with nodes and elements of surface+lids
fall.faces = [fv.faces; fvc.faces];
fall.vertices = [fv.vertices; fvc.vertices];
Now, if I call patch to plot it: pall=patch(fall), it looks like this.
Can anybody tell me why the outer surface is not smooth? And even better, can anyone provide a solution to the issue?
Is it simply that the spacing between the cross sections is too large?
EDIT: Just to clarify. The edge in the middle on the 3d plot is not wanted. I have no idea why it is there. As this is a wing, it's supposed to simply connect the 2d cross sections. There is no data in that region, only at z=2.5m and z=7.5m, as indicated by the cross sections figure.
I'm trying to find the largest inscribed square between two lines that intersect at two separate points on a MATLAB plot. First I import two different sets of data as arrays.
Then, after holding the figure, I call the commands
plot(dataSet1,dataSet2)
plot(dataSet2,dataSet1)
and have both of those plots on the same figure. This gives a graph that looks something like this:
My goal is to find the largest square that will fit inside those two lines. Most of what I have seen online is related to black and white matrices, which I believe isn't quite the same as this.
I currently have a contour plot, just like this one here
http://www.originlab.com/www/helponline/Origin/en/mergedProjects/Tutorial/images/Contour_Plot_with_Major_and_Minor_Levels_Filled_by_Using_Color_Palette/Graph_Gallery_Contour_Plot_Palette_16.png,
now I want to add some simple plots of functions in the length width plane, like f(width) = width^n and so on, but I don't know how to overlap these two plots.
So, you want to retain the current graph when adding new graphs: use hold on. See http://www.mathworks.nl/help/matlab/ref/hold.html.
I have a 3D data set of a surface that is not a function graph. The data is just a bunch of points in 3D, and the only thing I could think of was to try scatter3 in Matlab. Surf will not work since the surface is not a function graph.
Using scatter3 gave a not so ideal result since there is no perspective/shading of any sort.
Any thoughts? It does not have to be Matlab, but that is my go-to source for plotting.
To get an idea of the type of surface I have, consider the four images:
The first is a 3D contour plot, the second is a slice in a plane {z = 1.8} of the contour. My goal is to pick up all the red areas. I have a method to do this for each slice {z = k}. This is the 3rd plot, and I like what I see here a lot.
Iterating this over z give will give a surface, which is the 4th plot, which is a bit noisy (though I have ideas to reduce the noise...). If I plot just the black surface using scatter3 without the contour all I get is a black indistinguishable blob, but for every slice I get a smooth curve, and I have noticed that the curves vary pretty smoothly when I adjust z.
Some fine-tuning will give a much better 4th plot, but still, even if I get the 4th plot to have no noise at all, the result using scatter3 will be a black incomprehensible blob when plotted alone and not on top of the 3D contour. I would like to get a nice picture of the full surface that is not plotted on top of the 3D contour plot
In fact, just to compare and show how bad scatter3 is for surfaces, even if you had exact points on a sphere and used scatter3 the result would be a black blob, and wouldn't even look like a sphere
Can POV-Ray handle this? I've never used it...
If you have a triangulation of your points, you could consider using the trisurf function. I have used that before to generate closed surfaces that have no boundary (such as polyhedra and spheres). The downside is that you have to generate a triangulation of your points. This may not be ideal to your needs but it definitely an option.
EDIT: As #High Performance Mark suggests, you could try using delaunay to generate a triangulation in Matlab
just wanted to follow up on this question. A quick nice way to do this in Matlab is the following:
Consider the function d(x, y, z) defined as the minimum distance from (x, y, z) to your data set. Make sure d(x, y, z) is defined on some grid that contains the data set you're trying to plot.
Then use isosurface to plot a (some) countour(s) of d(x, y, z). For me plotting the contour 0.1 of d(x, y ,z) was enough: Matlab will plot a nice looking surface of all points within a distance 0.1 of the data set with good lighting and all.
In povray, a blob object could be used to display a very dense collection of points, if you make them centers of spheres.
http://www.povray.org/documentation/view/3.6.1/71/
If you want to be able to make slices of "space" and have them colored as per your data, then maybe the object pattern (based on a #declared blob object) might do the trick.
Povray also has a way to work with df3 files, which I've never worked with, but this user appears to have done something similar to your visualization.
http://paulbourke.net/miscellaneous/df3/