sigbertklinke / plot.matrix

Visualizes a matrix object plainly as heatmap. It provides a single S3 function plot for matrices.
8 stars 3 forks source link

fmt.key bug #2

Closed fdchevalier closed 5 years ago

fdchevalier commented 5 years ago

Dear Sigbert,

After modifying behavior of key=NULL, I encountered a bug when plotting a matrix with default parameters (my bad to not have tested this in the first place).

Here is a reproducible example with the current version of the package in the repository:

plot(x)
# Error in sprintf(fmt.key, breaks) : 'fmt' is not a character vector

This error comes from the fact that a default value for fmt.key is not set anymore when not plotting the key. By separating the test for key from the other tests now done on line 198, these tests are always FALSE by default and fmt.key keeps is NULL value. I moved the block that sets the fmt.key default value in the fmt.key test block. This has resolved the problem in all cases I was able to test.

Fred