MCPcopy Create free account
hub / github.com/bsomps/OpenGeoPlotter / plot

Method plot

OGP_v11.py:1802–2413  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1800
1801
1802 def plot(self): # Main drill hole plotting function
1803
1804 # Save the pencil line data
1805 pencil_line_data = []
1806 for line in self.drawing_lines:
1807 xdata, ydata = line.get_data()
1808 pencil_line_data.append((xdata, ydata))
1809
1810 self.calculate_coordinates()
1811 self.figure.clear() # Clear the entire figure
1812 ax = self.figure.add_subplot(111)
1813
1814
1815 # Re-add the pencil drawings if there
1816 self.drawing_lines = [] # Clear existing line references
1817 for xdata, ydata in pencil_line_data:
1818 line = Line2D(xdata, ydata, color='black', zorder=6)
1819 ax.add_line(line)
1820 self.drawing_lines.append(line)
1821
1822 self.canvas.draw_idle() # Redraw the canvas with the new plot and pencil lines
1823
1824 min_x_plan, max_x_plan = float('inf'), float('-inf')
1825 min_x_cross, max_x_cross = float('inf'), float('-inf')
1826 min_z, max_z = float('inf'), float('-inf')
1827 min_y, max_y = float('inf'), float('-inf')
1828
1829 self.min_x_cross, self.max_x_cross = float('inf'), float('-inf')
1830 self.min_z, self.max_z = float('inf'), float('-inf')
1831
1832 # Filter the data based on selected hole_ids
1833 selected_data = self.data[self.data['hole_id'].isin(self.hole_ids)]
1834
1835 # Update logic to determine actual axis limits
1836 for row in selected_data.itertuples():
1837 self.min_z = min(self.min_z, row.z)
1838 self.max_z = max(self.max_z, row.z)
1839
1840 # Initialize
1841 filtered_data = None
1842 vmin, vmax = None, None
1843
1844 # Set up normailzation
1845 if self.attribute_column and self.column_type(self.attribute_column, self.data) == 'continuous':
1846 if self.remove_outliers:
1847 filtered_data = self.data[pd.to_numeric(self.data[self.attribute_column], errors='coerce').notna()].copy()
1848 Q1 = filtered_data[self.attribute_column].quantile(self.lower_quantile / 100)
1849 Q3 = filtered_data[self.attribute_column].quantile(self.upper_quantile / 100)
1850 IQR = Q3 - Q1
1851
1852 # Remove outliers from filtered_data for the other plots
1853 filtered_data = filtered_data[~((filtered_data[self.attribute_column] < (Q1 - self.IQR * IQR)) | (filtered_data[self.attribute_column] > (Q3 + self.IQR * IQR)))]
1854
1855 vmin = filtered_data[self.attribute_column].min()
1856 vmax = filtered_data[self.attribute_column].max()
1857 else:
1858 # Use the original data without filtering for outliers
1859 vmin = self.data[self.attribute_column].min()

Callers 8

__init__Method · 0.95
generate_contoursMethod · 0.95
select_isolateMethod · 0.95
update_plotMethod · 0.95
secondary_bar_plotMethod · 0.95
toggle_viewMethod · 0.95

Calls 12

calculate_coordinatesMethod · 0.95
column_typeMethod · 0.95
determine_plot_styleMethod · 0.95
plot_barsMethod · 0.95
add_bar_legendMethod · 0.95
create_profile_lineMethod · 0.95
transform_coordinatesMethod · 0.95
plotMethod · 0.45

Tested by

no test coverage detected