What exactly Scatter Plot in Core Plot? - iphone

What exactly Scatter Plot in Core Plot?
In my application,I am plotting values & join them except null values.If the null value is there in between then the plots are not joined.Is it the right way to plot values in Scatter plot?

Yes, that is the way scatter plot works in coreplot. Scatter plot is represented by joining the co-ordinate points using a line. If some data is missing, it will be represented by a broken link in scatter plot.
Alternatively you can try to represent a null value using zero value for that corresponding axis value and it can be represented as a sudden dip in the graph at that portion, but that again depends on your specific requirement.

Related

Residual analysis and subtracting values between scatter plots

I am trying to subtract the two corresponding values for each of the scatter plots to get a residual. Each point on the scatter plot below has a corresponding point in the plot above, but simply with a different value. For example, NE at the very left has a value of 0.5 in the top scatter plot and I'd like to subtract from it the value in the bottom plot which is 1. I have been trouble doing this. I couldn't get a level of detail calculation to work, because that aggregates everything, and I simply can't make a table calculation of avg(average scores) - predicted score. The predicted score is really just a trend line fitted on to the top scatter plot. Any help is appreciated.

Matlab or Origin - Combining two sets of 3D data in one contour plot

I have two sets of 3D data with XYZ coordinates. I would like to know if there is a program that can combine the two, such that:
One set of data is represented by the colours of the plot, and the other set of data is represented by the height (in 3D) of the plot.
I am familiar with both Matlab and Origin.
Can be done with surf(Z,C).
a = randi(20,20,20);
b = randi(20,20,20);
figure;
subplot(2,2,1);
surf(a);
title('Height');
subplot(2,2,2);
surf(b);
title('Color');
subplot(2,2,[3,4]);
surf(a,b);
title('Mixed');
Not the best representations but you can see one matrix yields height and one yields color.
Color of mixed plot comes from right plot
Height of mixed plot comes from left plot
It is easy if you use scatter3 function.
w=100;
x1=rand(1,w);
y1=rand(1,w);
z1=rand(1,w)*100;
z2=ceil(rand(1,w)*255);
figure
h=scatter3(x1,y1,z1,ones(1,w)*50,z2,'filled');

Can set axis with decimal power of 10? [duplicate]

I have plotted to vectors against each other, and they are already logarithmic and everything is fine with that. But now that I have my plot i want the grid to be logarithmic. I write "grid on" in my code, and I think there should be a way to do this in the plot, but I can't remember how. How do I make the grid logarithmic?
If you use loglog, semilogx or semilogy instead of plot, the grid will automatically be on a log scale for the corresponding axes when using grid on.
If you have already plotted the axes, you can execute the following on the command line:
set(gca,'yscale','log') %# to set the y-axis to logarithmic
set(gca,'xscale','log') %# to set the x-axis to logarithmic
Have a look at axes properties to find out what else you can modify.

Plot lots of points with alpha value in Matlab

When you want to plot scatter points with fixed alpha value in Matlab, you may the patch function, like advised in this SO question. But when you want to plot a high number of individual points, you should use the plot function, as advised in this SO question.
Is it still possible to plot a high number of scatter points with fixed alpha value in Matlab ?

Improve surface plot visualisation of scatter points

I want to visualize 4 vectors of scattered data with a surface plot. 3 vectors should be the coordinates. In addition the 4th vector should represent a surface color.
My first approach was to plot this data (xk,yk,zk,ck) using
scatHand = scatter3(xk,yk,zk,'*');
set(scatHand, 'CData', ck);
caxis([min(ck), max(ck)])
As a result I get scattered points of different color. As these points lie on the surface of a hemisphere it ist possible to get colored faces instead of just points. I replace the scattered points by a surface using griddata to first build an approximation
xk2=sort(unique(xk));
yk2=sort(unique(yk));
[xxk, yyk]=meshgrid(xk2, yk2);
zzk=griddata(xk,yk,zk,xxk,yyk,'cubic');
cck=griddata(xk,yk,clr,xxk,yyk,'cubic');
surf(xxk,yyk,zzk,cck);
shading flat;
This is already nearly what I want except that the bottom of the hemisphere is ragged. Of course if I increase the interpolation point numbers it gets better but than the handling of the plot gets also slow. So I wonder if there is an easy way to force the interpolation function to do a clear break. In addition it seems that the ragged border is because the value of zzk gets 'NaN' outside the circle the hemisphere shares with the z=0-plane.
The red points at the top are the first several entries of the original scattered data.
You can set the ZLim option to slice the plotted values within a certain range.
set(gca, 'Zlim', [min_value max_value])