Skip to content

Commit

Permalink
add lines layers by points
Browse files Browse the repository at this point in the history
  • Loading branch information
Marina Usova committed Nov 27, 2023
1 parent 35d7396 commit f0529ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ def factory_dataset():
method_params = SolverParameters(r=np.double(2.0), iters_limit=2000, number_of_parallel_points=5,
evolvent_density=12)
solver = Solver(problem=problem, parameters=method_params)
spl = StaticPainterNDListener("svc2d_transformator_state_stat.png", "output", vars_indxs=[0, 1], mode="surface",
spl1 = StaticPainterNDListener("svc2d_transformator_state_stat1.png", "output", vars_indxs=[0, 1], mode="surface",
calc="by points")
solver.add_listener(spl)
solver.add_listener(spl1)
spl2 = StaticPainterNDListener("svc2d_transformator_state_stat2.png", "output", vars_indxs=[0, 1], mode="lines layers",
calc="by points")
solver.add_listener(spl2)
log = "SVC_2D_Transformators_2000"
solver.load_progress(log) # загружаем точки из файла в солвер
solver.release_all_listener() # запускаем подключенных слушаетей
Expand Down
2 changes: 2 additions & 0 deletions iOpt/output_system/painters/plotters/plotters.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@ def plot_interpolation(self, points, values, points_count=100):
def plot_by_points(self, points, values):
if self.plotterType == 'surface':
self.ax.plot_trisurf(np.array(points)[:, 0], np.array(points)[:, 1], values, cmap=plt.cm.viridis, alpha=0.95)
if self.plotterType == 'lines layers':
self.ax.tricontourf(np.array(points)[:, 0], np.array(points)[:, 1], values, cmap=plt.cm.viridis)
def plot_points(self, points, values, clr='blue', mrkr='o', mrkrs=3):
if self.plotterType == 'lines layers':
self.ax.scatter(np.array(points)[:, 0], np.array(points)[:, 1], color=clr, marker=mrkr, s=mrkrs)
Expand Down

0 comments on commit f0529ea

Please sign in to comment.