Graph in a panel
simcacl
I wrote the following code fot the versione 6.12 and it works
It creates a new panel (panel2) embeded in a existing panel (panel1) and then it dispays a graph in the new panel
Newpanel/EXT=1/HOST=panel1/N=panel2/W =(500,30,20,325)
Display/HOST=panel2/W=(10,10,480,280) $wave
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???
Thanks
Simone
Use Panel1#Panel2 to refer to the exterior panel, as in this example:
DoWindow/K Panel1
DoWindow/K Panel2
NewPanel/N=Panel1
NewPanel/EXT=1/HOST=Panel1/N=Panel2/W =(500,30,20,325)
Make/O data=x
String wave="data"
Display/HOST=Panel1#Panel2/W=(10,10,480,280) $wave
End
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.
August 20, 2012 at 11:43 am - Permalink
August 20, 2012 at 12:09 pm - Permalink
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?
August 21, 2012 at 04:47 pm - Permalink
If you are making the wave each time you replace the graph, just overwrite the wave each time. You might do something like
Make/O data
// some sort of analysis fills in the data in the wave "data"
data = x // stand-in for analysis
if (WinType("panel2") != 7)
Newpanel/N=panel2/W =(100,100,700,500)
Display/HOST=panel2/W=(10,10,480,280) data
endif
end
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
August 22, 2012 at 09:37 am - Permalink
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....
August 23, 2012 at 10:42 pm - Permalink
You can, but you need to look up the syntax of the ShowInfo command. Use this instead:
ShowInfo/W=panel1
Info panels go with windows, not subwindow. They then adjust themselves to the active subwindow.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
August 24, 2012 at 09:09 am - Permalink
Newpanel /N=Panel1
NewPnale/Host=panel1 N=panel2
Display/Host=panel1#panel2 $data
I can't use the cursors in the graph on panel2???
August 24, 2012 at 10:15 am - Permalink
August 26, 2012 at 12:06 pm - Permalink