Question: I need the result of this variable in a program, but I don't understand why I can't get the right result.

```
double r = pow((3/2), 2) * 0.0001;
printf("%f", r);

```

Answer: 
The main point is that you need to add the canvas to a layout and add this layout to the widget. At the end you also should not forget to draw the canvas.

```
class Create_Canvas(QWidget):
    def __init__(self, parent):
        QWidget.__init__(self,parent)
        self.setAcceptDrops(True)

        figure = plt.figure()
        self.canvas = FigureCanvas(figure)
        toolbar = NavigationToolbar(self.canvas, self)

        self.right_layout = QVBoxLayout()
        self.right_layout.addWidget(self.canvas)
        self.right_layout.addWidget(toolbar)
        # set the layout of this widget, otherwise the elements will not be seen.
        self.setLayout(self.right_layout)
        # plot some stuff
        self.ax = figure.add_subplot(111)
        self.ax.plot([1,2,5])        
        # finally draw the canvas
        self.canvas.draw()

```

(This is how it would look in PyQt4, should be similar in PyQt5).
In PyQt5 you need to use super on the main window class to accept the drops. The dropevent function should be like this:

```
def dropEvent(self,e):
        """
        This function will enable the drop file directly on to the 
        main window. The file location will be stored in the self.filename
        """
        if e.mimeData().hasUrls:
            e.setDropAction(QtCore.Qt.CopyAction)
            e.accept()
            for url in e.mimeData().urls():
                if op_sys == 'Darwin':
                    fname = str(NSURL.URLWithString_(str(url.toString())).filePathURL().path())
                else:
                    fname = str(url.toLocalFile())
            self.filename = fname
            print("GOT ADDRESS:",self.filename)
            self.readData()
        else:
            e.ignore() # just like above functions  

```

The complete [code](https://youtu.be/1q3Z2clyIEQ) gives this output:
[![enter image description here](https://i.stack.imgur.com/LvI1D.gif)](https://i.stack.imgur.com/LvI1D.gif)