[Scilab-users] Request for suggestions with plotting.

classic Classic list List threaded Threaded
3 messages Options
aweeks aweeks
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] Request for suggestions with plotting.

Hi All,

 

I wonder if anyone could suggest a solution to this problem?

 

I want to:

 

                Create a figure.                                                                                 This remains fixed.          This I can do.

                Create four axes within the figure.                                            These remain fixed.        This I can do.

 

                In each of the four axes plot two reference curves.           These remain fixed.        This I can do.

 

                Repeatedly call a function A

which calls an inner function B

which plots a curve in each of the four axes having deleted the ones it plotted on the previous call of A.                               This I can’t do.

 

The idea is that the figure, axes and reference curves remain in place while the temporary curves are repeatedly deleted and re-plotted to allow an ‘animation’ showing the progression of the curves.

 

I can’t see a way to pass and delete the handles to the polylines produced by plot2d / gce.  I’ve tried passing as parameters, using global variables, all to no avail.  The most common error is from ‘delete’, complaining that “The handle is not valid”.

 

Many thanks in anticipation.

 

Adrian Weeks
Development Engineer, Hardware Engineering EMEA
Office: +44 (0)2920 528500 | Desk: +44 (0)2920 528523 | Fax: +44 (0)2920 520178
[hidden email]

HID Global Logo

Unit 3, Cae Gwyrdd,
Green meadow Springs,
Cardiff, UK,
CF15 7AB.
www.hidglobal.com

 

 


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Antoine Monmayrant Antoine Monmayrant
Reply | Threaded
Open this post in threaded view
|

Re: Request for suggestions with plotting.

Hello Adrian,

Here is what I would do:

(1) use 'tag' property field of your curve together with findobj to get access to the plot to be updated, without passing the handle.
(2) instead of deleting the curve and recreating it, I would directly modify its content (data property) and then ask for a replot/rescale if needed.

You can have a look at the content of function 'replot()' for a typical example.
It get called when the user changes the top slider in the GUI or presses Re-run.
It is far from perfect, but it does something that might look like what you want.

Hope it helps,

Antoine

On 24/07/2020 19:11, Adrian Weeks wrote:

Hi All,

 

I wonder if anyone could suggest a solution to this problem?

 

I want to:

 

                Create a figure.                                                                                 This remains fixed.          This I can do.

                Create four axes within the figure.                                            These remain fixed.        This I can do.

 

                In each of the four axes plot two reference curves.           These remain fixed.        This I can do.

 

                Repeatedly call a function A

which calls an inner function B

which plots a curve in each of the four axes having deleted the ones it plotted on the previous call of A.                               This I can’t do.

 

The idea is that the figure, axes and reference curves remain in place while the temporary curves are repeatedly deleted and re-plotted to allow an ‘animation’ showing the progression of the curves.

 

I can’t see a way to pass and delete the handles to the polylines produced by plot2d / gce.  I’ve tried passing as parameters, using global variables, all to no avail.  The most common error is from ‘delete’, complaining that “The handle is not valid”.

 

Many thanks in anticipation.

 

Adrian Weeks
Development Engineer, Hardware Engineering EMEA
Office: +44 (0)2920 528500 | Desk: +44 (0)2920 528523 | Fax: +44 (0)2920 520178
[hidden email]

HID Global Logo

Unit 3, Cae Gwyrdd,
Green meadow Springs,
Cardiff, UK,
CF15 7AB.
www.hidglobal.com

 

 


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

decay_rate_gui.sce (16K) Download Attachment
aweeks aweeks
Reply | Threaded
Open this post in threaded view
|

Re: [EXT] Re: Request for suggestions with plotting.

Hello Antoine,

 

Thank you very much for your reply, it certainly did help.

I was trying to delete then re-plot the curves – it hadn’t occurred to me to just change the data – as ever, the solution is easy once you’ve seen it.

I notice you’re re-scaling the plots by manually changing the data bounds – I will need to do this – I haven’t come across a ‘re-scale’ function.

 

Very many thanks again.

 

Adrian Weeks
Development Engineer, Hardware Engineering EMEA
Office: +44 (0)2920 528500 | Desk: +44 (0)2920 528523 | Fax: +44 (0)2920 520178
[hidden email]

HID Global Logo

Unit 3, Cae Gwyrdd,
Green meadow Springs,
Cardiff, UK,
CF15 7AB.
www.hidglobal.com

 

 

From: users <[hidden email]> On Behalf Of Antoine Monmayrant
Sent: 25 July 2020 07:04
To: [hidden email]
Subject: [EXT] Re: [Scilab-users] Request for suggestions with plotting.

 

*** Please use caution this is an externally originating email. ***

Hello Adrian,

Here is what I would do:

(1) use 'tag' property field of your curve together with findobj to get access to the plot to be updated, without passing the handle.
(2) instead of deleting the curve and recreating it, I would directly modify its content (data property) and then ask for a replot/rescale if needed.

You can have a look at the content of function 'replot()' for a typical example.
It get called when the user changes the top slider in the GUI or presses Re-run.
It is far from perfect, but it does something that might look like what you want.

Hope it helps,

Antoine

On 24/07/2020 19:11, Adrian Weeks wrote:

Hi All,

 

I wonder if anyone could suggest a solution to this problem?

 

I want to:

 

                Create a figure.                                                                                 This remains fixed.          This I can do.

                Create four axes within the figure.                                            These remain fixed.        This I can do.

 

                In each of the four axes plot two reference curves.           These remain fixed.        This I can do.

 

                Repeatedly call a function A

which calls an inner function B

which plots a curve in each of the four axes having deleted the ones it plotted on the previous call of A.                               This I can’t do.

 

The idea is that the figure, axes and reference curves remain in place while the temporary curves are repeatedly deleted and re-plotted to allow an ‘animation’ showing the progression of the curves.

 

I can’t see a way to pass and delete the handles to the polylines produced by plot2d / gce.  I’ve tried passing as parameters, using global variables, all to no avail.  The most common error is from ‘delete’, complaining that “The handle is not valid”.

 

Many thanks in anticipation.

 

Adrian Weeks
Development Engineer, Hardware Engineering EMEA
Office: +44 (0)2920 528500 | Desk: +44 (0)2920 528523 | Fax: +44 (0)2920 520178
[hidden email]

HID Global Logo

Unit 3, Cae Gwyrdd,
Green meadow Springs,
Cardiff, UK,
CF15 7AB.
www.hidglobal.com

 

 



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users