File wellmet/mplot/maxes.py changed (mode: 100644) (index 2f2a0ed..6bc245a) |
... |
... |
from matplotlib import lines as mlines |
24 |
24 |
|
|
25 |
25 |
# it is mostly for qt_plot, it offers availiable options to user |
# it is mostly for qt_plot, it offers availiable options to user |
26 |
26 |
__all__ = [ |
__all__ = [ |
|
27 |
|
'tri_vector_plot', |
27 |
28 |
'GRaph', |
'GRaph', |
28 |
29 |
'rbf_plot', 'rbf_density_plot', 'rbf_diagram', |
'rbf_plot', 'rbf_density_plot', 'rbf_diagram', |
29 |
30 |
'candidates_plot', 'rejection_sampling_plot', |
'candidates_plot', 'rejection_sampling_plot', |
|
... |
... |
__all__ = [ |
42 |
43 |
'completehull_plot' |
'completehull_plot' |
43 |
44 |
] |
] |
44 |
45 |
|
|
|
46 |
|
#č ten [plot] zásadně vytvaří své struktury, nepouzívá oné ze skříňky, |
|
47 |
|
#č protože já vím, že v těch obrázcích, ve kterých chcu ho použit, |
|
48 |
|
#č můde být třeba použit řez a skříňka tedy potřebné struktury může nemít |
|
49 |
|
def tri_vector_plot(ax, tri_space=None, linewidths=[0.7, 0.5, 0.4, 0.3, 0.2, 0.1], |
|
50 |
|
ms=3, mew=0.6, lw=0.7, data_offset=1, nrid=200): |
|
51 |
|
from .. import simplex as six |
|
52 |
|
if tri_space is None: |
|
53 |
|
tri_space = ax.space |
|
54 |
|
|
|
55 |
|
import quadpy |
|
56 |
|
tn_scheme = quadpy.tn.stroud_tn_3_6b(2) |
|
57 |
|
|
|
58 |
|
Tri = six.GaussCubatureIntegration(ax.sample_box, tn_scheme, incremental=False) |
|
59 |
|
Tri.get_pf_estimation() |
|
60 |
|
ax.sample_box.Tri = Tri |
|
61 |
|
mart.setup(ax) |
|
62 |
|
if tri_space == ax.space: |
|
63 |
|
#mart.triplot(ax, color="#B2B2B2", lw=lw/1.4, zorder=100) |
|
64 |
|
s = (1, 1, 1, 0) #'xkcd:light seafoam green' #a7ffb5 |
|
65 |
|
f = '#fdc1c500' #(253/255, 193/255, 197/255, 1) # '#fdc1c5' #'xkcd: pale rose' # (#fdc1c5) |
|
66 |
|
m = '#FFF39A00'#(255/255, 243/255, 154/255, 1)#'#FFF39A' #'xkcd: dark cream' # (255, 243, 154, 255) |
|
67 |
|
sfm_colors = [s, f, m] |
|
68 |
|
mart.tripcolor(ax, sfm_colors=sfm_colors, color="#B2B2B200", |
|
69 |
|
linewidth=lw/1.4/2, zorder=100) |
|
70 |
|
else: |
|
71 |
|
mart.tri_plot(ax, Tri=Tri, color="#B2B2B2", lw=lw/1.4, zorder=100, rasterized=True) |
|
72 |
|
|
|
73 |
|
mart.simplex_vectors(ax, color='grey', zorder=10500)#, scale_units='height', scale=0.0025) #width=0.003, |
|
74 |
|
|
|
75 |
|
mart.plot_points(ax, ms=ms, mew=mew, zorder=100500) |
|
76 |
|
#č curly a boundaries raději nakreslíme co nejpozději |
|
77 |
|
mart.curly(ax, nrid=nrid, linewidths=linewidths) |
|
78 |
|
try: |
|
79 |
|
mart.plot_boundaries(ax, lw=lw, zorder=1050, nrod=nrid) |
|
80 |
|
except: |
|
81 |
|
pass |
|
82 |
|
min_coord = np.abs(np.min(getattr(ax.sample_box, ax.space))) |
|
83 |
|
mart.setup_labels(ax, data_offset=data_offset * min_coord) |
|
84 |
|
|
|
85 |
|
|
45 |
86 |
|
|
46 |
87 |
def GRaph(ax, df=None, ls='', **kwargs): |
def GRaph(ax, df=None, ls='', **kwargs): |
47 |
88 |
from .. import sball |
from .. import sball |
|
... |
... |
def convergence_legend(ax): |
324 |
365 |
|
|
325 |
366 |
proxy_handles.append(mlines.Line2D([], [], color='b', label=r'$p_{\pazocal{F}}$')) |
proxy_handles.append(mlines.Line2D([], [], color='b', label=r'$p_{\pazocal{F}}$')) |
326 |
367 |
#proxy_handles.append(mlines.Line2D([], [], color='m', label=r"$p_{\mathrm{f,v}}^{\left(N_{\mathrm{sim}}\right)}$")) |
#proxy_handles.append(mlines.Line2D([], [], color='m', label=r"$p_{\mathrm{f,v}}^{\left(N_{\mathrm{sim}}\right)}$")) |
327 |
|
proxy_handles.append(mlines.Line2D([], [], color='r', label=r"$p_{\mathrm{f}}^{\left(N_{\mathrm{sim}}\right)}$")) |
|
|
368 |
|
proxy_handles.append(mlines.Line2D([], [], color='r', label=r"$p_{\mathrm{f,v}}^{\left(N_{\mathrm{sim}}\right)}$")) |
328 |
369 |
proxy_handles.append(mlines.Line2D([], [], color='#AAAAAA', \ |
proxy_handles.append(mlines.Line2D([], [], color='#AAAAAA', \ |
329 |
370 |
label=r"$p_{\pazocal{O}}^{\left(N_{\mathrm{sim}}\right)}$")) |
label=r"$p_{\pazocal{O}}^{\left(N_{\mathrm{sim}}\right)}$")) |
330 |
371 |
|
|
File wellmet/mplot/mfigs.py changed (mode: 100644) (index e84d507..d6a20c5) |
... |
... |
from matplotlib import ticker |
16 |
16 |
__all__ = [ |
__all__ = [ |
17 |
17 |
'convergence_diagram', 'convergence_legend', 'double_proxy_diagram', |
'convergence_diagram', 'convergence_legend', 'double_proxy_diagram', |
18 |
18 |
'four_branch_convergence', 'beta_diagram', 'double_diagram', 'suspension_3d', |
'four_branch_convergence', 'beta_diagram', 'double_diagram', 'suspension_3d', |
19 |
|
'double_tri_R_plot', 'double_tri_R_twins_plot', 'double_plot', 'G_U_distortion', |
|
|
19 |
|
'double_tri_R_plot', 'double_tri_R_twins_plot', 'double_100_plot', 'G_U_distortion', |
20 |
20 |
'double_pprod_R_plot', 'double_mprod_R_plot', |
'double_pprod_R_plot', 'double_mprod_R_plot', |
|
21 |
|
'triple_vector_plot', |
21 |
22 |
'triple_plot', 'triple_wide', 'triple_wide_50_100', 'triple_plot_50_100', |
'triple_plot', 'triple_wide', 'triple_wide_50_100', 'triple_plot_50_100', |
22 |
23 |
'triple_nodes_plot', 'triple_wide_25_50', |
'triple_nodes_plot', 'triple_wide_25_50', |
23 |
24 |
'triple_plot_35_50', 'convex_plot_7', 'quadruple_plot', |
'triple_plot_35_50', 'convex_plot_7', 'quadruple_plot', |
|
... |
... |
def G_U_distortion(fig, sample_box, space): |
314 |
315 |
|
|
315 |
316 |
|
|
316 |
317 |
|
|
317 |
|
def double_plot(fig, sample_box, space, lim=100): |
|
|
318 |
|
def double_100_plot(fig, sample_box, space, lim=100): |
318 |
319 |
#fig.set_figwidth(19/2.54) |
#fig.set_figwidth(19/2.54) |
319 |
320 |
ax = fig.add_subplot(122) |
ax = fig.add_subplot(122) |
320 |
321 |
ax.sample_box = sample_box |
ax.sample_box = sample_box |
|
... |
... |
def triple_plot_35_50(fig, sample_box, space): |
389 |
390 |
triple_plot(fig, sample_box, space, npoints=[35, 50]) |
triple_plot(fig, sample_box, space, npoints=[35, 50]) |
390 |
391 |
|
|
391 |
392 |
def triple_wide_25_50(fig, sample_box, space): |
def triple_wide_25_50(fig, sample_box, space): |
392 |
|
triple_nodes_plot(fig, sample_box, space, npoints=[25, 50]) |
|
|
393 |
|
triple_vector_plot(fig, sample_box, space, npoints=[25, 50]) |
393 |
394 |
fig.set_figwidth(19/2.54) |
fig.set_figwidth(19/2.54) |
394 |
395 |
|
|
395 |
396 |
def triple_nodes_plot(fig, sample_box, space, npoints=[25, 50]): |
def triple_nodes_plot(fig, sample_box, space, npoints=[25, 50]): |
|
... |
... |
def triple_nodes_plot(fig, sample_box, space, npoints=[25, 50]): |
416 |
417 |
maxes.tri_nodes_plot(ax, tri_space=None, tn_scheme=tn_scheme) |
maxes.tri_nodes_plot(ax, tri_space=None, tn_scheme=tn_scheme) |
417 |
418 |
ax.set_title(space_labels[space], pad=10) |
ax.set_title(space_labels[space], pad=10) |
418 |
419 |
|
|
|
420 |
|
def triple_vector_plot(fig, sample_box, space, npoints=[25, 50]): |
|
421 |
|
ax = fig.add_subplot(131) |
|
422 |
|
ax.sample_box = sample_box[0:npoints[0]] |
|
423 |
|
ax.space = space |
|
424 |
|
|
|
425 |
|
maxes.tri_vector_plot(ax, tri_space=None) |
|
426 |
|
ax.set_title(space_labels[space], pad=10) |
|
427 |
|
|
|
428 |
|
ax = fig.add_subplot(132, sharex=ax, sharey=ax) |
|
429 |
|
ax.sample_box = sample_box[0:npoints[1]] |
|
430 |
|
ax.space = space |
|
431 |
|
maxes.tri_vector_plot(ax, tri_space=None) |
|
432 |
|
ax.set_title(space_labels[space], pad=10) |
|
433 |
|
|
|
434 |
|
ax = fig.add_subplot(133, sharex=ax, sharey=ax) |
|
435 |
|
ax.sample_box = sample_box |
|
436 |
|
ax.space = space |
|
437 |
|
maxes.tri_vector_plot(ax, tri_space=None) |
|
438 |
|
ax.set_title(space_labels[space], pad=10) |
419 |
439 |
|
|
420 |
440 |
def triple_plot(fig, sample_box, space, npoints=[100, 200]): |
def triple_plot(fig, sample_box, space, npoints=[100, 200]): |
421 |
441 |
ax = fig.add_subplot(133) |
ax = fig.add_subplot(133) |