Astroplan and PyQt

10 views
Skip to first unread message

François Hurter

unread,
Feb 17, 2022, 9:53:49 AM2/17/22
to astropy-dev
Hello,
I would like to use the plot_altitude function (from astroplan.plots Package) in a Qt5 application.

Using something like

class PlotCanvas(FigureCanvas):

    def __init__(self, parent=None, width=5, height=4, dpi=100):
        fig = Figure(figsize=(width, height), dpi=dpi)
        FigureCanvas.__init__(self, fig)
        self.setParent(parent)

        FigureCanvas.setSizePolicy(self,
                QSizePolicy.Expanding,
                QSizePolicy.Expanding)
        FigureCanvas.updateGeometry(self)
        self.plot()

    def plot(self):
        ax = self.figure.add_subplot(111)
        polaris_style = {'color': 'b'}
        
        plot_altitude(todaysTarget[0], observer, next_midnight, style_kwargs=polaris_style,brightness_shading=True)

        ax.set_title('My PyQt Matplotlib Example')
        self.draw()

But nothing is being displayed.

Is it possible to use 'plot_altitude' in a PyQt5 application ?

Many thanks for your reply and help.

Reply all
Reply to author
Forward
0 new messages