Nicole Ouellette
Nicole Ouellette

Reputation: 97

Plot doesn't show up in figure window

I am using the built-in Matlab "plot" function to make many plots from a lot of data. Every single one of them works except for one. What's even more strange is that the one that doesn't work essentially has identical code to others that do work.

Here's the part of the code that's supposed to plot in a separate figure:

f = figure;
ax = subplot(1,1,1, 'Position',[0.1 0.16 0.8 0.815]);
grid(ax, 'on')
hold(ax, 'on')
plot(ax, x, y)

Where x is a 100x1 double matrix of all the same number and y is a 100x1 uint32 matrix of all the same number, both of which are previously defined.

The axes come up in the figure just fine, but as soon as I try to plot anything the axes disappear and it becomes just a blank figure window.

This person had a similar problem, but the solution still didn't work for me (even in debug mode):

http://www.mathworks.fr/matlabcentral/newsreader/view_thread/286813

The only thing I can possibly think of that's different about this data set versus others that I've successfully plotted is that x and y are repetitive... could this have anything to do with it? Does Matlab have a "limit" to how many points it can plot at one time?

Any idea why this is happening to me or how to fix it? Any help is greatly appreciated. Thank you in advance.

Upvotes: 1

Views: 12307

Answers (1)

Nicole Ouellette
Nicole Ouellette

Reputation: 97

It was just an issue of bad data. The numbers Matlab was reading in were too small and so couldn't be plotted. Regenerating some better test data solved my problem. Thank you to those who offered suggestions!

Upvotes: 1

Related Questions