|
From: | Byron Hawkins |
Subject: | Plotting basics |
Date: | Fri, 21 Feb 2014 00:27:25 -0800 |
I’m trying to make some very simple line plots, and I keep getting errors and strange output. My script just takes the matrix “plots” and the vector “index” and does this: if length(plots) > 0, semilogy(index, plots); end; 1. There is a warning about “axis: omitting non-positive data in log plot”. There are zeros in the matrix, but these are not drawn in the plot, which makes it look incomprehensible. Is it a problem to plot zeros? I’m not specifying any axis bounds, so maybe the auto-bounds generator is specifying zero, and that conflicts with the semilogy() function? I need to show zeros, but there needs to be logarithmic scaling too. 2. All the documentation says that “semilogy” and “plot” work just the same, but when I change “semilogy” to “plot”, I get errors about “subscript indices must either be positive integers less than 2^31…” What does it mean? Why can’t I have a linear plot? 3. When I use the axis() function, all my inputs are ignored. It just plots the same auto-bounds that it was plotting before. I call it like “axis([1,30,-100,1000]);” before anything else happens in the script. It would be really great if someone could point me in the right direction here, I have a paper deadline coming up very soon and I am totally stuck with this really basic plotting. Thanks for your help. Byron |
[Prev in Thread] | Current Thread | [Next in Thread] |