change parametric plot setup programmatically
08-13-2018, 11:59 AM
Post: #1
 hata Junior Member Posts: 24 Joined: Sep 2015
change parametric plot setup programmatically
Hello, I'm struggling to find a way to change Xmin, Xmax, Ymin, Ymax variables programmatically before invoking the PLOT view.
So, I want to prevent the HP PRIME from deciding about these min. and max. values, because I want to control these myself (from within an application I'm developing).
Note that I can change Tmin and Tmax (independent variable). But this is NOT my question.

...
Xmin := -5; // Xmin changed to -5
STARTAPP(1) // start plotting: changed Xmin discarded
...

A second, related question: can you programmatically force an aspect ratio of 1 when plotting (like 'menu -> zoom -> square' from the plot menu)

Thank you
08-13-2018, 12:32 PM (This post was last modified: 08-13-2018 12:36 PM by JMB.)
Post: #2
 JMB Member Posts: 97 Joined: Jan 2016
RE: change parametric plot setup programmatically

The variable Xmin is used in several Apps (Function, Parametric, Advanced graphics, ...), so you need to use the prefix of the intended App.
08-13-2018, 12:42 PM
Post: #3
 Tim Wessman Senior Member Posts: 2,247 Joined: Dec 2013
RE: change parametric plot setup programmatically
If you are in your application program, you won't need to qualify which app, but if you are outside it is the best way. You can call specific VIEW calls, but not zoom levels I think.

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
08-13-2018, 03:01 PM
Post: #4
 hata Junior Member Posts: 24 Joined: Sep 2015
RE: change parametric plot setup programmatically

However I confirm that I do use the correct plot setup variables Xmin, Xmax, Ymin, Ymax.
The issue is, as described in my original post:
I change Xmin, Xmax, Ymin, Ymax variables programmatically before invoking the PLOT view, but this has no effect because the HP PRIME changes them again when I invoke the PLOT view (I want to control these values myself from within an application).
Is there a way to let the PRIME use the values I set myself ?
Thanks
08-13-2018, 07:25 PM (This post was last modified: 08-13-2018 07:26 PM by JMB.)
Post: #5
 JMB Member Posts: 97 Joined: Jan 2016
RE: change parametric plot setup programmatically
I don't know how you're writing your program, but for me something like the following works ok:
PHP Code:
EXPORT Test()BEGIN  Parametric.Xmin:=-1;  Parametric.Xmax:=1;  Parametric.Ymin:=-1;  Parametric.Ymax:=1;  STARTAPP("Parametric");  STARTVIEW(1);END;
When I execute Test, the plot view of the Parametric App appears, and when I check the Setup Plot view, the values assigned by the program are there.
I hope this helps.
08-14-2018, 09:39 AM
Post: #6
 hata Junior Member Posts: 24 Joined: Sep 2015
RE: change parametric plot setup programmatically
Hello JMP

When trying your example, indeed it works !
So I was able to find the problem:
when you execute it from the VIEW menu, it doesn't work.
Will try to find a workaround.

EXPORT VIEW "test" Test()
BEGIN
Parametric.Xmin:=-1;
Parametric.Xmax:=1;
Parametric.Ymin:=-1;
Parametric.Ymax:=1;
STARTVIEW(1);
END;

Many thanks
08-14-2018, 09:44 AM
Post: #7
 hata Junior Member Posts: 24 Joined: Sep 2015
RE: change parametric plot setup programmatically
OK, in the meantime I found the solution: temporarily switch to HOME view (just trial and error)

EXPORT VIEW "test" Test()
BEGIN
STARTVIEW(-1);
Parametric.Xmin:=-1;
Parametric.Xmax:=1;
Parametric.Ymin:=-1;
Parametric.Ymax:=1;
STARTVIEW(1);
END;

Thanks again
 « Next Oldest | Next Newest »

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