Graph in a panel
| simcacl | August 20, 2012 - 10:17 | ||
|---|---|---|---|
|
I have a problem with the last version of Igor (6.22) Newpanel/EXT=1/HOST=panel1/N=panel2/W =(500,30,20,325) With the versione 6.22 it doen't work, I can manage only by creating the new panel not embeded in old one. Any hits??? Simone |
|||

Joined: 2007-07-19
Location: United States
Panel2 isn't a top-level window. It is a logical subwindow of Panel1 (the host window).
Use Panel1#Panel2 to refer to the exterior panel, as in this example:
Also, I'd recommend against using a command like 'String wave = "data"'.
Wave is a keyword with so many other meanings you'd be better off using String wavesName="data", instead.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
Joined: 2012-08-19
Location: Italy
Thanks jim!
Joined: 2012-08-19
Location: Italy
I have a related problem to this procedure.
I wrote the code in a way in which I can display different graphs on the panel 2. The problem is that new graph is dislay on the old ones in a new subwindow
I would like to display only one graph (deleting the previuos one), any suggestion?
In any case how can call the different graph?
panel1#panel2#G0
panel1#panel2#G1
ect?
Joined: 2007-06-29
Location: United States
There are a couple of ways to do this.
If you are making the wave each time you replace the graph, just overwrite the wave each time. You might do something like
This code makes the wave called "data" and does something to it. Then, if the panel called "panel2" does not exist, it makes the panel and the embedded graph. If the panel already exists (and, we assume, the graph) it skips the step of making the panel and graph. But the wave has been replaced with a new version of the wave with new contents, and the graph will update to reflect that fact.
This code is for illustration; I would separate the analysis part from the panel-making part by writing two functions. Then the function that makes the graph can call the analysis function. I find that I virtually always need to call the analysis part separately at some point in the evolution of the code.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Joined: 2012-08-19
Location: Italy
Thanks John for the suggestion.
I have other questions
Can I use the cursors on a graph embeded in a panel??
I try to write the command
Showinfo /panel1#panel2 but it doesn't works....
Joined: 2007-06-29
Location: United States
I try to write the command
Showinfo /panel1#panel2 but it doesn't works....
You can, but you need to look up the syntax of the ShowInfo command. Use this instead:
ShowInfo/W=panel1Info panels go with windows, not subwindow. They then adjust themselves to the active subwindow.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Joined: 2012-08-19
Location: Italy
So I have this situation
Newpanel /N=Panel1
NewPnale/Host=panel1 N=panel2
Display/Host=panel1#panel2 $data
I can't use the cursors in the graph on panel2???
Joined: 2007-06-29
Location: United States
Sure you can use cursors in the graph subwindow. Just click it to make it the active subwindow and then choose Show Info from the Panel Menu.