I want to extract data points of a plot, but this plot is in a .jpg format. I converted it to the .fig but there are two curves in this plot and I don’t know how to do it.
How can I extract data points for the plot that I attach here?
Related
I want to have a 3D polar plot in Matlab. I have a set of cartesian coordinates at points in space and also have corresponding data to plot.
For example, I have 200 numbers of Cartesian (x,y,z) points and 200 numbers of scalar data to be plotted. I tried using patternCustom in Matlab (by converting the cartesian coordinates to spherical polar ones). But it did not help.
The code I used like-
first I save the cartesian coordinates in a column then converting each point to spherical polar by
[az,el,r]=cart2sph(x,y,z);
patternCustom(M,el,az);
Can anyone please help me? thanks
I have some sparse data and want to plot them as markers connected by a smooth, interpolated line - like the default behaviour of Microsoft Excel.
There are solutions to this problem easily found on the internet, but I find them unsatisfactory. What they do is: plot the sparse data as one data set drawing it as markers without lines, interpolate it with a method of choice and plot the interpolation as the second data set, with lines without markers.
The problem with these tricks is that in the legend the two data sets will be listed separately. I would expect a single data set depicted in the legend as a line crossing through a marker.
Is it possible in Matlab?
If you want to plot an interpolated line there are lots of ways to do that. You can try generating an interpolated line using the matlab interp1() function.
Let's create x and y data with no NaN.
x = randn(1,10)
y = randn(1,10)
If you want 1000 data points where previously you only had a few, that's pretty easy:
x2 = min(x):(max(x)-min(x))/1000:max(x)
y2 = interp1(x,y,x2,'cubic')
and you can plot your data and spline using
plot(x,y,'r+')
hold on
plot(x2,y2,'r-')
A custom legend is straightforward when you use handle graphics. You can plot a dummy data set with a red line passing through a marker using
h(1) = plot(NaN,NaN,'r-+')
lstring{1} = 'Data';
You can then add a legend that points to this data set using
legend(h,lstring)
You'll end up with something that looks roughly like this:
The nice thing about using handle graphics (i.e. the h) is you can throw whatever data series you want into the legend as h(end+1) and lstring{end+1}.
im trying to compare data sets in MatLab, and in the figure im only able to place data tips along the curve but the data set im comparing with does not match my curve (hence the comparison). Is there anyway to plot data points anywhere on the plot or do they have to be somewhere along the curve?
Any help would be appreciated.
I am not sure if I understand what you meant...
load data1.dat % your curve
load data2.dat % Comparison
figure(1)
hold
plot(data1(:,1),data1(:,2),'k-') % You plot your curve
plot(data2(:,1),data2(:,2),'ro') % you plot you points for comparison
My data is xy rings with z as a height. I create a contour map of the data. I need to be able to create xy data points with the z component having a value somewhere between the 2 contour lines. Then extract all of the xyz data. I have found a few programs to extract the data but it is only x,y data and it is basically the xy data that I originally started with.
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.