Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
subtitle_placeholder.text = subtitle
prs.save(file_path)
if __name__ == '__main__':
from pandasgui.datasets import iris, flights, multi, pokemon
app = QtWidgets.QApplication([])
figs = []
for df in [iris, flights, multi]:
df.plot()
figs.append(plt.gcf())
win = FigureViewer(figs[0])
win.show()
win2 = TabbedFigureViewer(figs)
win2.show()
app.exec_()
def add_tab(self, fig):
"""Add a new tab containing a FigureViewer showing fig"""
image_viewer = FigureViewer(fig)
# Adds them to the tab_view
tab = QtWidgets.QWidget()
tab_layout = QtWidgets.QVBoxLayout()
tab.setLayout(tab_layout)
tab_layout.addWidget(image_viewer)
try:
fig_title = fig.texts[0].get_text()
except IndexError:
fig_title = f"untitled"
self.tab_widget.addTab(tab, fig_title)
def add_tab(self, fig):
"""Add a new tab containing a FigureViewer showing fig"""
image_viewer = FigureViewer(fig)
# Adds them to the tab_view
tab = QtWidgets.QWidget()
tab_layout = QtWidgets.QVBoxLayout()
tab.setLayout(tab_layout)
tab_layout.addWidget(image_viewer)
try:
fig_title = fig.texts[0].get_text()
except IndexError:
fig_title = f"untitled"
self.tab_widget.addTab(tab, fig_title)
subtitle_placeholder.text = subtitle
prs.save(file_path)
if __name__ == '__main__':
from pandasgui.datasets import iris, flights, multi, pokemon
app = QtWidgets.QApplication([])
figs = []
for df in [iris, flights, multi]:
df.plot()
figs.append(plt.gcf())
win = FigureViewer(figs[0])
win.show()
win2 = TabbedFigureViewer(figs)
win2.show()
app.exec_()