Index: view/data_loader.py
===================================================================
--- prview/data_loader.py	(revision f3d51f6ec6277f40c94acc80d658917deab47a7a)
+++ 	(revision )
@@ -1,12 +1,0 @@
-import os
-import wx
-
-def choose_data_file(parent):
-    path = None
-    dlg = wx.FileDialog(parent, "Choose a file", os.getcwd(), "", "*.txt", wx.OPEN)
-    if dlg.ShowModal() == wx.ID_OK:
-        path = dlg.GetPath()
-        mypath = os.path.basename(path)
-    dlg.Destroy()
-    
-    return path
Index: prview/perspectives/pr/inversion_panel.py
===================================================================
--- prview/perspectives/pr/inversion_panel.py	(revision fc4ab6e85049ecb55369c2b052e6d2861ed562d4)
+++ prview/perspectives/pr/inversion_panel.py	(revision 660b1e60ab822e113405bbf2f810f6667b460fe6)
@@ -571,4 +571,5 @@
                 self.file_radio.SetValue(True)
                 self._on_pars_changed(None)
+                self.manager.show_data(path)
         
 
Index: prview/perspectives/pr/pr.py
===================================================================
--- prview/perspectives/pr/pr.py	(revision 4a5de6fb907873c63516b0763785b44c8d1f5c15)
+++ prview/perspectives/pr/pr.py	(revision 660b1e60ab822e113405bbf2f810f6667b460fe6)
@@ -227,9 +227,9 @@
             else:
                 (value, dy[i]) = pr.pr_err(out, cov2, x[i])
-            sum += value
+            sum += value*pr.d_max/len(x)
             y[i] = value
             
-        y = y/sum*pr.d_max/len(x)
-        dy = dy/sum*pr.d_max/len(x)
+        y = y/sum
+        dy = dy/sum
         
         if cov2==None:
@@ -292,13 +292,38 @@
             return 0.0
 
-    def get_context_menu(self, plot_id=None):
+    def get_context_menu(self, graph=None):
         """
             Get the context menu items available for P(r)
-            @param plot_id: Unique ID of a plot, so that we can recognize those
-                            that we created
+            @param graph: the Graph object to which we attach the context menu
             @return: a list of menu items with call-back function
         """
+        # Look whether this Graph contains P(r) data
+        for item in graph.plottables:
+            if item.name=="P_{fit}(r)":
+                
+                return [["Compute P(r)", "Compute P(r) from distribution", self._on_context_inversion],
+                       ["Add P(r) data", "Load a data file and display it on this plot", self._on_add_data]]
+                
         return [["Compute P(r)", "Compute P(r) from distribution", self._on_context_inversion]]
-    
+
+    def _on_add_data(self, evt):
+        """
+            Add a data curve to the plot
+            WARNING: this will be removed once guiframe.plotting has its full functionality
+        """
+        path = self.choose_file()
+        if path==None:
+            return
+        
+        x, y, err = self.parent.load_ascii_1D(path)
+        
+        new_plot = Data1D(x, y, dy=err)
+        new_plot.name = "P_{loaded}(r)"
+        new_plot.xaxis("\\rm{r}", 'A')
+        new_plot.yaxis("\\rm{P(r)} ","cm^{-3}")
+            
+        wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title="P(r) fit"))
+        
+        
 
     def start_thread(self):
@@ -380,4 +405,17 @@
         # Popup result panel
         #result_panel = InversionResults(self.parent, -1, style=wx.RAISED_BORDER)
+        
+    def show_data(self, path=None):
+        if not path==None:
+            self._create_file_pr(path)  
+              
+        # Make a plot of I(q) data
+        new_plot = Data1D(self.pr.x, self.pr.y, self.pr.err)
+        new_plot.name = "I_{obs}(q)"
+        new_plot.xaxis("\\rm{Q}", 'A^{-1}')
+        new_plot.yaxis("\\rm{Intensity} ","cm^{-1}")
+        #new_plot.group_id = "test group"
+        wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title="Iq"))
+        
         
     def setup_plot_inversion(self, alpha, nfunc, d_max, q_min=None, q_max=None):
@@ -540,5 +578,4 @@
         
         
-          
           
     def _on_context_inversion(self, event):
Index: prview/perspectives/pr/requirements.txt
===================================================================
--- prview/perspectives/pr/requirements.txt	(revision 4a5de6fb907873c63516b0763785b44c8d1f5c15)
+++ prview/perspectives/pr/requirements.txt	(revision 660b1e60ab822e113405bbf2f810f6667b460fe6)
@@ -27,2 +27,3 @@
 23. Plot I(q) immediately when you choose a new file.
 24. *** probably need to ship the perspectives separately...
+25. If no data is available, disable the Fit button.
