| 1641 | |
| 1642 | |
| 1643 | def secondary_bar_plot(self): |
| 1644 | |
| 1645 | # Get a list of numerical columns |
| 1646 | numerical_columns = self.data.select_dtypes(include=[np.number]).columns.tolist() |
| 1647 | if not numerical_columns: |
| 1648 | QMessageBox.warning(self, "Warning", "No numerical columns found in the data.") |
| 1649 | return |
| 1650 | |
| 1651 | # Create a dialog for the user to select a column |
| 1652 | column, ok = QInputDialog.getItem(self, "Select Column", "Choose a numerical column for the secondary bar plot:", numerical_columns, 0, False) |
| 1653 | |
| 1654 | if ok and column: |
| 1655 | self.bar_column = column # Store the selected column as an instance variable |
| 1656 | self.plot() # Re-draw the plot |
| 1657 | self.canvas.draw() |
| 1658 | |
| 1659 | |
| 1660 | def plot_bars(self, bar_column, ax): |