Dear all,

I know it is better to use plot2d, but I wonder why plot works
differently from plot2d when one of the variables is integer.

Consider this code

  // Generate x axis with real (double) numbers
  x = (1:20)/20

  // Generate y axis with random integers
  y = iconvert(100*rand(1,20),2)

  // Plot y vs x
  plot(x, y)

The plot represents x vs its index, which is not the intended behavior.
Replacing plot(x,y) with plot2d(x,y) we get the correct plot.

The documentation of both plot and plot2d requires "real" matrix or
vector. It seems that plot takes it a bit too literally (as a data type)
while plot2d adheres to the mathematical meaning of "real" (considering
integer numbers as a subset of real numbers).

Is there a fundamental reason for this?

The problem arises when one retrieves integers from a file without
converting them to double (which requires much more memory).

Regards,

Federico Miyara



---
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

Reply via email to