Skip to content
Prev 325437 / 398503 Next

Plotting two y-axis vs non-numeric x-axis

On Jun 15, 2013, at 11:14 AM, Birdada Simret wrote:

            
Er, Not really. The error was the line above that warning:

"Error in plot.window(...) : need finite 'xlim' values
In addition: Warning messages:
1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion
2: In min(x) : no non-missing arguments to min; returning Inf
3: In max(x) : no non-missing arguments to max; returning -Inf"

You are sending a character vector to plot() as the first argument, and plotting dispatch system cannot find a 'plot.character' method so it sends it to 'plot.default' which is expecting a numeric vector for x and things all fall apart from there.

You could use: seq_along(month)  # instead of month

(And obviously the xlab would need to be changed, since you are no longer working with "Hours".)

And. Please learn to post in plain text.

-- David
David Winsemius
Alameda, CA, USA