COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

Possible to extract data matrix from plot figure?

• Email
• Follow

```Hi!

I have a somewhat silly question I think... If you have a matlab figure (.fig) containing a 2D plot, is it possible to extract the matrix of X and Y values from the graph? I only have the figures, not the data....
I've tried "h = get(gca)", but I can't find anything in the handle that seems to be the actual data of the graph in the plot...

This may not at all be possible, but I figured I'd ask anyway!=)
Thanks!
Ida
```
 0

See related articles to this posting

```Dear all,
I just found the solution to my own problem! Seems I was just not looking hard enough.
a = get(gca);
b = h.Children;
b.XData and b.YData gives me the two vectors I want! =) (b(n).XData and b(n).YData gives you graph n if you have many in the axis).
Cheers,
Ida

"Ida Haggstrom" <ida_haggstrom@yahoo.se> wrote in message <hqk5og\$8vg\$1@fred.mathworks.com>...
> Hi!
>
> I have a somewhat silly question I think... If you have a matlab figure (.fig) containing a 2D plot, is it possible to extract the matrix of X and Y values from the graph? I only have the figures, not the data....
> I've tried "h = get(gca)", but I can't find anything in the handle that seems to be the actual data of the graph in the plot...
>
> This may not at all be possible, but I figured I'd ask anyway!=)
> Thanks!
> Ida
```
 0

1 Replies
1015 Views

Similar Articles

12/20/2013 10:58:10 PM
page loaded in 31165 ms. (0)

Similar Artilces:

how to extract matrix data from gui contour plot
I'm pretty new to Matlab. I have this 2D gui contour map and I want to extract the data in the form of a matrix. Where is the data stored and how do i go about doing so? Blake mei wrote: > I have this 2D gui contour map and I want to extract the data in the > form of a matrix. Where is the data stored and how do i go about doing so? _Which_ data? The values that the contours were overlayed on, or the set of contours? get(ContourPlotHandle, 'ZData') %the Z values that were to be contoured T = findall(ContourPlotHandle, 'Type', 'patch'...

[plot] Updating matrix data in plot
Hello everyone! I have a little problem. I plot a matrix data and then I want to update 'xdata' and 'ydata' by using 'set'. This code explains my problem: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% x = [1 1 2 2 1; 5 5 6 6 5]; y = [1 2 2 1 1; 5 6 6 5 5]; h = plot(x',y'); %I plot some (i this example two) rectangles. axis([0 7 0 7]); x = x+1; %I add a constant to make an illusion of movement. y = y+1; %As above. set(h,'xdata',x','ydata',y') % <- error %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% When I use 'set'...

Bitmap data extraction (matrix of matrix)
Hello, This is most likely a simple question for those who use Mathematica on a semi-regular basis, but ... I have a 512x512 matrix composed of 1x3 matrix elements, and want to create a 512x512 matrix composed of a single value in the original 1x3 elements. That doesn't look very well defined, so please let me explain further in the hopes of clarifying what I am after. It's a bitmap image file (512x512) and I want to extract a part of the "raw" data for further processing. The raw data in the original file consists of values for the red, green and blue (RGB)...

How to extract generated plot data (or mesh data) from a Graphics3D
Hi, everyone I would be thankful if someone can help me on this problem: I am using Mathematica 6.0 and it introduces new graphical capabilities that is not compatible with ver. 5.2, I could extract generated mesh data from a Plot3D for further manipulation using for instance the following code: p=Plot3D[Sin[x] y, {x, 0, 4}, {y, 0, 4}] p // FullForm (* to see the structure of p *) p[[1, 1]] (* a list of mesh points in p *) now in ver. 6.0 I cannot exctract mesh data from a Graphics3D object especially when used with built in commands like Sphere[...] like this: g = Graphics3D[Sp...

plot matrix data
I am trying to plot a 3D graph of DNA melting. The data is 122x82. I just mesh the data and could get the 3D plot. One problem is that the X axis is from 1 to 121 so does the y is from 1 to 81. But the actual value for X axis should be from 219 to 340 and Y from 19 to 100. How can I do that? Jane help xlim help ylim "Jane Ren" <jsren2003@yahoo.com> wrote in message news:eee1052.-1@webx.raydaftYaTP... >I am trying to plot a 3D graph of DNA melting. The data is 122x82. I > just mesh the data and could get the 3D plot. One problem is that the > X axis is from 1 to 121...

Extracting data from figure
This problem is rather odd: I have a figure saved as .fig file in which some vector x is plotted. Unfortunately this vector is gone and I would like to get my numerical values back. How is it possible? Saying it differently: x=[1 2 3 4 5]; %Our data plot(x); %Plot data hgsave('figure'); %Save figure to figure.fig Then I move 'figure.mat' to other machine and how am I suppose to get the x vector from figure when I open it in Matlab? Best regards Przemek Pawelczak Hi, try : hgload('figure.fig') get(findobj('type','line'),'XData') and read ...

Data extraction from a matrix
I want to extracted the data around the maximum values of a matrix from each column, and put it into a new matrix of the same size. For example, I have A =[ 1 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 3 1 1 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] so each column has the max value of 1 6 1 1 1 1 1 3 1 . Lets say i want to extract the 8 points around each maxim value into matrix B, so B = [ 1 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 0 0 1 3 1 1 6 1 0 0 1 1 1 1 1 1 0 0 0 0 0] I'm thinking to use [mx,idx] = max(A); to find the maximums, but not sure how to add the extra values around idx. Any id...

extract data from figure
Hello, is there any way to open a .FIG-File in Matlab, and then extract the data contained in it to workspace variables? Thanx in advance. Kind regard,s prg "prof rumsdiegeige" <professor_rumsdiegeige@yahoo.com> wrote in message <f9h1p6\$2si\$1@fred.mathworks.com>... > Hello, > > is there any way to open a .FIG-File in Matlab, and then > extract the data contained in it to workspace variables? yes - a FIG file is stored in Matlab's MAT format and can be read with load(figFilename,'-mat'). Yair Altman http://ymasoftware.com On Aug 10, 12:...

Plot data matrix in 3D
Hello I have a data matrix of dimension [nxm]. Each row refers to a given value on the x-axes and each columns to a given value on the y-axes such that I have other two vectors X[n] and Y[m]. How can I plot it in 3d? thank you in advance "Paolo " <tarpanelli@libero.it> wrote in message <hha2s2\$ght\$1@fred.mathworks.com>... > Hello > > I have a data matrix of dimension [nxm]. Each row refers to a given value on the x-axes and each columns to a given value on the y-axes such that I have other two vectors X[n] and Y[m]. > > How can I plot it i...

Extracting specific data from a matrix
I have a 180000x4 where column 1 is Longitude, 2 is Latitude, 3 is Magnitude, and 4 is # of stars. I am supposed to add the number of stars at all latitudes with a given longitude/magnitude. I want to extract the rows with the same longitudes and put them into new matrices but the only way I know how to do this is for example: m=N((1:100),:) The problem is that I don't know which rows I need to include in each set. How do I create a matrix with the data of the other columns where the longitude is equal to a certain value? On Dec 14, 2:13=A0pm, "Josh " <juliusj...@gmai...