![]() |
Forum Index : Microcontroller and PC projects : picoMite: Line Plot - I don't get it... need some help
Author | Message | ||||
Amnesie Guru ![]() Joined: 30/06/2020 Location: GermanyPosts: 625 |
Hi all, I am simply to stupid to understand this command. I am trying to simplify things with built-in features (usually I am using the simple line command). You may laugh, since this is easy for you ![]() To try this command I created a simple program: Option explicit Dim yData(7) yData(1)=200 yData(2)=100 yData(3)=30 yData(4)=20 yData(5)=70 yData(6)=150 yData(7)=200 Dim integer nbr=7 Dim integer xstart=0 Dim integer xinc=10 Dim integer ystart=200 Dim integer yinc=1 CLS Line plot yData(),nbr,xstart,xinc,ystart,yinc What values do I need to choose for showing me ALL data-points? If I start the program there is only one line plotted. I read the manual on page 119 and I tought "well that's easy".. but it is not. My thinking: nbr = all my datapoints I want to draw (since there are 7, I choose 7) xstart = easy! just start at x-position 0 xinc = easy! to stretch the graph just draw eatch datapoint after 10 pixel ystart = hmm y-position to start let's start @ y-pos = 200... uhm error: "200 is invalid (valid is 0 to 7)" WHY? xstart has no problem with (for example 200) if I choose ystart=1 it works. yinc = I don't want to stretch this in the y-direction so I leave it on "1"... aaaaaand as a result all the MMBASIC interpreter "plots" is just one line (segment). ![]() Can anyone please give me one example in which a graph is plottet and is "streched" (x incremented by let's say 10 pixels or so)? Greetings Daniel Edited 2025-02-09 04:55 by Amnesie |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10226 |
ystart allows you to omit y elements it does not scale them. You need to use MATH WINDOW to do the scaling. You have defined an 8 element array therefore the start can be between element 1 and element 7. |
||||
Amnesie Guru ![]() Joined: 30/06/2020 Location: GermanyPosts: 625 |
Ok, I understand. But even with "ystart=1" there is only plotted one single line element / segment instead of the whole graph... if I set xinc=1 ALL data is plottet, but if I set xinc=10 only one is plotted... MANUAL: Yeah.. but as soon is the value is >1 less and less of the original graph is plotted.. I don't understand why. Edited 2025-02-09 05:17 by Amnesie |
||||
Amnesie Guru ![]() Joined: 30/06/2020 Location: GermanyPosts: 625 |
Hm it must be some kind of bug, I tried any possible value and it doesn't make any sense. The manual states Can anybody test the code below or try to plot more than 7 datapoints with an incremented x value of "10"? Just to be clear, this code should draw ALL datapoints as an graph, right?: Option explicit Dim yData(7) yData(1)=200 yData(2)=100 yData(3)=30 yData(4)=20 yData(5)=70 yData(6)=150 yData(7)=200 Dim integer nbr=7 Dim integer xstart=0 Dim integer xinc=10 Dim integer ystart=1 Dim integer yinc=1 CLS Line plot yData(),nbr,xstart,xinc,ystart,yinc Because it does not. Only one line. Greetings Daniel Edited 2025-02-09 06:37 by Amnesie |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10226 |
Looks like a bug - will fix |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6269 |
I agree. There does seem to be a problem with xinc Tested on V6.00.01 No time to do further testing for now. Hopefully later I will try earlier versions. Jim VK7JH MMedit |
||||
Amnesie Guru ![]() Joined: 30/06/2020 Location: GermanyPosts: 625 |
Thanks a lot Peter, I've encountered this (probably bug) in earlier versions but was to afraid to ask ![]() Greetings Daniel |
||||
phil99![]() Guru ![]() Joined: 11/02/2018 Location: AustraliaPosts: 2603 |
While awaiting the fix a work-around is to use POLYGON. The polygon has to be closed so at each end add a line down to the X axis (or other convenient place) and close along the X axis. These lines can be hidden by drawing background colour lines over them. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |