[Scilab-users] Why plot doesn't work on integers

Federico Miyara fmiyara at fceia.unr.edu.ar
Sat Feb 2 22:00:15 CET 2019


Thank you, I'm glad to help a little bit improve this great software.

Regards,

Federico Miyara

On 02/02/2019 17:29, Samuel Gougeon wrote:
> Hello Federico,
>
> Thanks for pointing this issue.
> It is clearly a bug. It occurs since the earliest ages of Scilab.
> It will be fixed ASAP.
>
> Regards
> Samuel
>
> Le 02/02/2019 à 09:42, Federico Miyara a écrit :
>>
>> 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
>>
>>
>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> 
>> 	Libre de virus. www.avast.com 
>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> 
>>
>>
>> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>
>>
>> _______________________________________________
>> users mailing list
>> users at lists.scilab.org
>> http://lists.scilab.org/mailman/listinfo/users
>
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users



---
El software de antivirus Avast ha analizado este correo electrónico en busca de virus.
https://www.avast.com/antivirus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20190202/3049f68f/attachment.htm>


More information about the users mailing list