|
Walter Roberson <roberson@hushmail.com> wrote in message <ew5Jk.11$tV.9@newsfe08.iad>...
> Eddie wrote:
> > So, my understanding of the documentation of the getimage function from the Image Processing
> > Toolbox is that if I say:
>
> > xp = linspace(-10,10,350);
> > fig = figure;
> > plot(xp,xp.^2);
> > A = getimage(fig);
>
> > A should now be a matrix that contains the data relating to the pixels of the figure with
> > the plotted parbola. However, when I try this, A is empty.
> > What I am doing wrong?
>
> Look at the documentation again. getimage() returns whatever is in the first CData array
> that is found under the given handle. Objects of type image have CData arrays (as well as
> some other kinds of objects such as objects of type patch), but plot() creates
> objects of time axes and lineseries, neither of which have CData arrays.
>
> Perhaps what you wanted to look at was getframe().
OK, you're right. I saw that a figure was a valid argument to the function, and assumed magic would happen. getframe() won't work for my purposes though because I need to suppress the actual display of the plot, and getframe() requires the figure to be visible. Other suggestions?
|