/usr/lib/python3/dist-packages/ginga/gtkw/Plot.py is in python3-ginga 2.6.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #
# Plot.py -- Plotting function for Gen2 FITS viewer.
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import matplotlib
matplotlib.use('GTKCairo')
from matplotlib.backends.backend_gtkcairo import FigureCanvasGTKCairo \
as FigureCanvas
from ginga.gtkw import Widgets
class PlotWidget(Widgets.WidgetBase):
def __init__(self, plot, width=500, height=500):
super(PlotWidget, self).__init__()
self.widget = FigureCanvas(plot.get_figure())
self.plot = plot
self.widget.set_size_request(width, height)
self.widget.show_all()
def configure_window(self, wd, ht):
self.logger.debug("canvas resized to %dx%d" % (wd, ht))
fig = self.plot.get_figure()
fig.set_size_inches(float(wd) / fig.dpi, float(ht) / fig.dpi)
#END
|