Warning:  Due to planned infrastructure maintenance, the EBRAINS Wiki and EBRAINS Support system will be unavailable for up to three days starting Monday, 14 July. During this period, both services will be inaccessible, and any emails sent to the support address will not be received.

Attention: We are currently experiencing some issues with the EBRAINS Drive. Please bear with us as we fix this issue. We apologise for any inconvenience caused.


Changes for page Widget PhasePlane

Last modified by ldomide on 2023/03/08 17:28

From version 1.6
edited by teodoramisan
on 2023/01/03 12:52
Change comment: There is no comment for this version
To version 1.7
edited by teodoramisan
on 2023/01/03 13:29
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -61,3 +61,38 @@
61 61  (((
62 62  pip install tvb-widgets
63 63  )))
64 +
65 +== API usage ==
66 +
67 +First, the correct matplotlib backend must be set, which enables the interaction with the TimeSeries widget, by running the following command:
68 +
69 +(% class="box" %)
70 +(((
71 +%matplotlib widget
72 +)))
73 +
74 +Then, the PhasePlaneWidget (from the tvb-widgets API), the package lab (from tvb simulator) and the display function should be imported:
75 +
76 +(% class="box" %)
77 +(((
78 +{{{from tvbwidgets.api import PhasePlaneWidget
79 +from tvb.simulator.lab import *
80 +}}}
81 +
82 +{{{from IPython.core.display_functions import display}}}
83 +)))
84 +
85 +The widget can be initialized with the required parameters (Model and Integrator) as it shows below:
86 +
87 +(% class="box" %)
88 +(((
89 +{{{w = PhasePlaneWidget(model=models.Generic2dOscillator(),
90 + integrator=integrators.HeunDeterministic())}}}
91 +)))
92 +
93 +Finally, to display and interact with the PhasePlane widget, the **//get_widget//**// //method is used inside the //**display **//function:
94 +
95 +(% class="box" %)
96 +(((
97 +{{{display(w.get_widget(plot_size=(6,7)))}}}
98 +)))
Public

TVB Widgets