Jump to content



Photo
- - - - -

Plot function


  • Please log in to reply
1 reply to this topic

#1 Toasterit

Toasterit

    Newbie

  • Members
  • Pip
  • 1 posts

  • Calculators:
    fx-9750gii

Posted 29 November 2016 - 03:14 AM

Does anybody know what the Plot function does? The user manual gives an explanation for PlotPhase, and syntax for PlotOn, PlotOff and PlotChange, but the only mention of Plot is where to the command is. I am asking because I am trying to debug a program that makes heavy use of this command.



#2 Krtyski

Krtyski

    Casio Addict

  • Members
  • PipPipPip
  • 61 posts
  • Gender:Male
  • Location:Tokyo, Japan
  • Interests:programming, smooth Jazz and 4-wheel driving.

  • Calculators:
    FX-502P, FX-602P, fx-603P, fx-4500PA, 2x fx-5800P, fx-9860GII-2(SH4A) and fx-cg20.

Posted 29 November 2016 - 10:23 AM

I do not have fx-9750GII but have fx-9860GII. I think the Plot command works same, so let me tell you about Plot command with fx-9860GII.

 

At first try following code;

 

File name: PLOT2.1
ClrGraph
CoordOff
GridOff
AxesOff
LabelOff

Plot 1,0

 

Note, you use CoordOff, not CoordOn.

 

Probably you know PlotOn 1,0 draw a dot at coordinate (1, 0). So what does Plot 1,0 draw?

Run the code , then you get following result.

 

PLOT2-1-1_convert_20150718183858.jpg

A cross hair cursor comes and brink in screen.

 

You can move the cursor using arrow keys. When you mode the cursor, what do you see?

There is no dot drawn, just the cursor is moved.

PLOT2-1-2_convert_20150718183930.jpg

Now you know that Plot 1,0 just display cursor without drawing dot.

 

Then push EXE key, 

PLOT2-1-3_convert_20150718183950.jpg

switched to text screen and then Done is shown.

 

In order to switch to graphics screen, press Shift F6 (G↔T),

PLOT2-1-2_convert_20150718183930.jpg

graphics screen comes back with the moved cursor.

 

Then again move the cursor, then what do you see?

PLOT2-1-4_convert_20150718184006.jpg

at this time you see dot!

 

Plot 1,0  display cross hair cursor, and press EXE key, then you finally get a dot.

Plot <x coordinate>,<y coordinate>

display cursor, does not draw dot. Press EXE key after the cursor is coming then draw dot. This is most different function from PlotOn command.

 

Run  PLOT2.1 code and

mode cursor
  

Press EXE key
  

Press Shift F6 (G↔T) to switch to graphics screen
  
move cursor
  
   ・
   ・
   ・

Repeating this, you can draw multiple dots.

==========

 

Change the second line of the code (CoordOff) to CoordOn, gives new name to the code;

File name: PLOT2.2
ClrGraph
CoordOn
GridOff
AxesOff
LabelOff

Plot 1,0


Run this;

PLOT2-2-1_convert_20150718184026.jpg

You will see X and Y coordinate values in the bottom line.

 

Use Plot command with CoordOn setting, you get coordinate value displayed. This is also different function from PlotOn and now you know Plot command works differently by CoordOn/Off setting.

Move the cursor, then the displayed coordinate values change.

Press Shift F6 to switch to graphics screen, then move the cursor,

PLOT2-2-3_convert_20150718184103.jpg

You see  a dot.

==========

 

it is annoying to switch to graphics screen every time, you will try run Plot 1,0 repeatedly,
Try this;

Fine name: PLOT2.3
ClrGraph
CoordOn
GridOff
AxesOff
LabelOff

While 1
Plot 1,0

WhileEnd


Using While / WhileEnd loop, to repeat Plot 1,0 .

Run this, 
At this time, cross hair cursor does not come up, but draw a dot at (1, 0). Why the cursor does not come up?

Before Casio Basic system hands over control from Plot command, the cursor is not displayed.  

 

Make the following code by command to hand over control from Plot to  ; 

Fine name: PLOT2.4
ClrGraph
CoordOn
GridOff
AxesOff
LabelOff

While 1
Plot 1,0

WhileEnd


Run this, 

PLOT2-4-1_convert_20150718184229.jpg

cursor comes, then you can move the cursor as you like. Press EXE key then plot a dot. The dot is hided by cursor, but you can see the dot when the cursor is moved.

PLOT2-4-2_convert_20150718184246.jpg

As ruing the while loop, cursor comes back on (1, 0). This behavior is as code of Plot 1,0◢ , no question about this.

=====

 

Try this;
 

File name: PLOT2.5
ClrGraph
CoordOn
GridOff
AxesOff
LabelOff

0→X:0→Y
While 1
Plot X,Y◢
Text
 1,1,"x=  "        (4 spaces)
Text 1,35,"y=   "     ( spaces)
Text 1,10,X
Text 1,45,Y
WhileEnd


Runs this, cursor comes on (0, 0) at first;
Move cursor and press EXE key where you want to plot a dot;

PLOT2-7-2_convert_20150718202833.jpg

This code shows X and Y values for further understanding how Plot command works.


Edited by Krtyski, 03 December 2016 - 04:20 PM.
Created image links





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users