Post Reply 
Add points to plot
05-18-2020, 06:35 PM
Post: #1
Add points to plot
What's the best way to add (visible) points to a plot programmatically? Specifically for the Polar plot/app, but others as well.

I know I can plot individual points using the Stats2Var app, but then I don't think I can add e.g. a circle (which is easy in the Polar app). Or can I?
Find all posts by this user
Quote this message in a reply
05-18-2020, 09:10 PM
Post: #2
RE: Add points to plot
I think what you're looking for is the geometry app. It can do several things including parametric plots, points etc.

All the functions in the Toolbox->CAS->plot submenu are supposed to work as objects in the geometry app, you can even choose different colors.

Example:

       
Find all posts by this user
Quote this message in a reply
05-18-2020, 09:11 PM
Post: #3
RE: Add points to plot
Hi victorbc, I think using the geometry app would be wonderful for this, but I haven't found a way to add objects to it programmatically. Do you know how?
Find all posts by this user
Quote this message in a reply
05-18-2020, 09:28 PM
Post: #4
RE: Add points to plot
(05-18-2020 09:11 PM)anyfoo Wrote:  Hi victorbc, I think using the geometry app would be wonderful for this, but I haven't found a way to add objects to it programmatically. Do you know how?

If I'm not mistaken, you can use the Instruction() and DelInstruction() commands. I'll try to find some documentation on that.
Find all posts by this user
Quote this message in a reply
05-18-2020, 09:45 PM (This post was last modified: 05-18-2020 09:46 PM by victorvbc.)
Post: #5
RE: Add points to plot
(05-18-2020 09:28 PM)victorvbc Wrote:  
(05-18-2020 09:11 PM)anyfoo Wrote:  Hi victorbc, I think using the geometry app would be wonderful for this, but I haven't found a way to add objects to it programmatically. Do you know how?

If I'm not mistaken, you can use the Instruction() and DelInstruction() commands. I'll try to find some documentation on that.

Couldn't find anything except for the help menu in the calculator itself, here it is:

Instruction:

The Instruction command provides access to the list of symbolic definitions in the Symbolic view of the Geometry App. Each Symbolic view definition is numbered, with 1 being the first definition.

Instruction(n) returns the value of instruction n (equivalent to typing its name).

Instruction(n,0) returns a textual representation of instruction n.

Instruction(n,1) returns a list containing all the information for instruction n: {name, definition, value, color, visible(0/1), plotDetail (0-7), filled (0/1), traced (0/1), legend visible (0/1), {} or {font, dpi, x, y} text position for sliders and measures, animation data: {} or {animation type (0-3), steps per sec (0-15), pause (0-15), start (real), stop(real), steps(real)}}

Instruction(n, k) returns the kth-1 element from the meta data list, where k is between 2 and 12 inclusive (see above).

Instruction(n):= Sets the value of instruction n from a string.

Instruction(n,1):= sets all instruction data using the same list format as described above.

Instruction(n, k):= sets meta data object k-1 to a specific value, where k is between 2 and 12 inclusive (see above).

if n=0 or if n is greater than the number of current instructions, adds an instruction at the end of the instruction list.
if n<0, inserts an instruction at position -n.
n can also be the variable name, either using 'name' or "name"

DelInstruction:

The DelInstruction command allows you to delete one or more symbolic definitions of geometric objects in Symbolic view. Each Symbolic view definition is numbered, with 1 being he first definition.

DelInstruction erases ALL instructions.
DelInstruction(n) erases instruction n.
DelInstruction(a,b) erases instructions a to b.




Haven't used these in any program of mine, so I don't have any more advice, but this should get you going. Let me know if you can make it work.

Cheers.
Find all posts by this user
Quote this message in a reply
05-18-2020, 09:46 PM (This post was last modified: 05-18-2020 09:47 PM by anyfoo.)
Post: #6
RE: Add points to plot
Ah, thanks for the hint. I found the Help text myself after you mentioned it (Vars -> App -> Geometry -> Plot -> Instruction, then pressed "Help") and was just about to paste it, but you were quicker.

This looks very useful and should work better than how I originally planned to do it. The more I play around with the HP Prime, the more I like it. I will post back with my results.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)