wolfhece 2.1.119__py3-none-any.whl → 2.1.120__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1242,7 +1242,18 @@ class Matplotlib_Figure(wx.Frame):
1242
1242
  size_x, size_y = self.fig.get_size_inches()
1243
1243
 
1244
1244
  if self.wx_exists:
1245
- wx.Frame.__init__(self, None, -1, 'Matplotlib Figure', size=(size_x*dpi+16, size_y*dpi+240), style=wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER)
1245
+ size_x = size_x*dpi+16
1246
+ size_y = size_y*dpi+240
1247
+
1248
+ #compare to screen size
1249
+ screen = wx.Display(0)
1250
+ screen_size = screen.GetGeometry().GetSize()
1251
+ if size_x > screen_size[0]:
1252
+ size_x = screen_size[0]
1253
+ if size_y > screen_size[1]:
1254
+ size_y = screen_size[1]
1255
+
1256
+ wx.Frame.__init__(self, None, -1, 'Matplotlib Figure', size=(size_x, size_y), style=wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER)
1246
1257
 
1247
1258
  self.ax_dict:dict[str,Axes] = {} # dict of axes
1248
1259
  self.ax:list[Axes] = [] # list of axes -- always flatten
@@ -2048,6 +2059,13 @@ class Matplotlib_Figure(wx.Frame):
2048
2059
  return key, list(self.ax_dict.values()).index(key)
2049
2060
 
2050
2061
  def plot(self, x:np.ndarray, y:np.ndarray, ax:Axes | int | str= None, **kwargs):
2062
+ """ Plot x, y on the current ax or on the ax specified
2063
+
2064
+ :param x: x values
2065
+ :param y: y values
2066
+ :param ax: ax to plot on
2067
+ :param kwargs: kwargs for the plot (same as matplotlib.pyplot.plot)
2068
+ """
2051
2069
 
2052
2070
  ax, idx_ax = self.get_ax_idx(ax)
2053
2071
 
@@ -2068,8 +2086,72 @@ class Matplotlib_Figure(wx.Frame):
2068
2086
  self._line_current.SetSelection(len(ax.get_lines())-1)
2069
2087
 
2070
2088
  self.fig.tight_layout()
2089
+ self.fig.canvas.draw()
2071
2090
  self.update_layout()
2072
2091
 
2092
+ def scatter(self, x:np.ndarray, y:np.ndarray, ax:Axes | int | str= None, **kwargs):
2093
+ """ Scatter Plot x, y on the current ax or on the ax specified
2094
+
2095
+ :param x: x values
2096
+ :param y: y values
2097
+ :param ax: ax to plot on
2098
+ :param kwargs: kwargs for the plot (same as matplotlib.pyplot.plot)
2099
+ """
2100
+
2101
+ ax, idx_ax = self.get_ax_idx(ax)
2102
+
2103
+ ax.scatter(x, y, **kwargs)
2104
+
2105
+ new_props = Matplolib_line_properties(ax.get_lines()[-1], self._axes_properties[idx_ax])
2106
+
2107
+ if self.wx_exists:
2108
+ new_props.add_props_to_sizer(self._collaps_pane.GetPane(), self._sizer_grid_props)
2109
+
2110
+ ax_prop:Matplotlib_ax_properties = self._axes_properties[idx_ax]
2111
+ ax_prop._lines.append(new_props)
2112
+ ax_prop.get_properties()
2113
+
2114
+ if self.wx_exists:
2115
+ if ax == self.cur_ax:
2116
+ self._line_current.SetItems([line.get_label() for line in ax.get_lines()])
2117
+ self._line_current.SetSelection(len(ax.get_lines())-1)
2118
+
2119
+ self.fig.tight_layout()
2120
+ self.fig.canvas.draw()
2121
+ self.update_layout()
2122
+
2123
+ def violinplot(self, dataset:np.ndarray, position:np.ndarray=None, ax:Axes | int | str= None, **kwargs):
2124
+ """ Plot x, y on the current ax or on the ax specified
2125
+
2126
+ :param x: x values
2127
+ :param y: y values
2128
+ :param ax: ax to plot on
2129
+ :param kwargs: kwargs for the plot (same as matplotlib.pyplot.plot)
2130
+ """
2131
+
2132
+ ax, idx_ax = self.get_ax_idx(ax)
2133
+
2134
+ ax.violinplot(dataset, position, **kwargs)
2135
+
2136
+ # new_props = Matplolib_line_properties(ax.get_lines()[-1], self._axes_properties[idx_ax])
2137
+
2138
+ # if self.wx_exists:
2139
+ # new_props.add_props_to_sizer(self._collaps_pane.GetPane(), self._sizer_grid_props)
2140
+
2141
+ # ax_prop:Matplotlib_ax_properties = self._axes_properties[idx_ax]
2142
+ # ax_prop._lines.append(new_props)
2143
+ # ax_prop.get_properties()
2144
+
2145
+ # if self.wx_exists:
2146
+ # if ax == self.cur_ax:
2147
+ # self._line_current.SetItems([line.get_label() for line in ax.get_lines()])
2148
+ # self._line_current.SetSelection(len(ax.get_lines())-1)
2149
+
2150
+ self.fig.tight_layout()
2151
+ self.fig.canvas.draw()
2152
+ self.update_layout()
2153
+
2154
+
2073
2155
  def to_dict(self) -> dict:
2074
2156
  """ properties to dict """
2075
2157