File mplot/maxes.py changed (mode: 100644) (index d024c01..306a360) |
... |
... |
from . import mart |
17 |
17 |
from . import mgraph |
from . import mgraph |
18 |
18 |
|
|
19 |
19 |
from matplotlib import colors as mcolors |
from matplotlib import colors as mcolors |
|
20 |
|
from matplotlib import ticker |
20 |
21 |
|
|
21 |
22 |
|
|
22 |
23 |
# it is mostly for qt_plot, it offers availiable options to user |
# it is mostly for qt_plot, it offers availiable options to user |
23 |
24 |
__all__ = [ |
__all__ = [ |
24 |
|
'candidates_plot', 'candidates_sampling_plot', |
|
|
25 |
|
'candidates_plot', 'rejection_sampling_plot', |
|
26 |
|
'candidates_sampling_plot', |
25 |
27 |
'convex_hull_plot', 'tri_plot', 'tri_nodes_plot', |
'convex_hull_plot', 'tri_plot', 'tri_nodes_plot', |
26 |
28 |
'tri_R_plot', 'tri_GK_plot', |
'tri_R_plot', 'tri_GK_plot', |
27 |
29 |
'tri_R_nodes_plot', 'tri_GK_nodes_plot', |
'tri_R_nodes_plot', 'tri_GK_nodes_plot', |
|
... |
... |
__all__ = [ |
37 |
39 |
|
|
38 |
40 |
|
|
39 |
41 |
|
|
|
42 |
|
def rejection_sampling_plot(ax, linewidths=[0.7, 0.5, 0.4, 0.3, 0.2, 0.1]): |
|
43 |
|
from .. import simplex as six |
|
44 |
|
|
|
45 |
|
#č možná zrovna zde nebudem robiť vědu a použijme tringulaciju ze skříňky? |
|
46 |
|
nodes = ax.sample_box.f_model(1000) |
|
47 |
|
# -1 = 'out', 0=success, 1=failure, 2=mix |
|
48 |
|
event_ids = six.filter(ax.sample_box.Tri, nodes) |
|
49 |
|
mart.plot_sample(ax, nodes[event_ids==-1], ls='', marker='.',\ |
|
50 |
|
mec="#00007E", mfc="#00007E", ms=1.5, alpha=0.5,\ |
|
51 |
|
rasterized=True) |
|
52 |
|
mart.plot_sample(ax, nodes[event_ids==2], ls='', marker='.',\ |
|
53 |
|
mec="#00007E", mfc="#00007E", ms=1.5, alpha=0.5,\ |
|
54 |
|
rasterized=True) |
|
55 |
|
|
|
56 |
|
mart.setup(ax) |
|
57 |
|
mart.curly(ax, linewidths=linewidths) |
|
58 |
|
mart.triplot(ax, color="#B2B2B2", lw=0.5, zorder=1000) |
|
59 |
|
mart.plot_points(ax, ms=5, zorder=100500) |
|
60 |
|
try: |
|
61 |
|
mart.plot_boundaries(ax, lw=0.7, zorder=10500) |
|
62 |
|
except: |
|
63 |
|
pass |
|
64 |
|
ax.xaxis.set_major_formatter(ticker.NullFormatter()) |
|
65 |
|
ax.yaxis.set_major_formatter(ticker.NullFormatter()) |
|
66 |
|
ax.xaxis.set_major_locator(ticker.NullLocator()) |
|
67 |
|
ax.yaxis.set_major_locator(ticker.NullLocator()) |
40 |
68 |
|
|
41 |
69 |
|
|
42 |
70 |
def candidates_sampling_plot(ax, linewidths=[0.7, 0.5, 0.4, 0.3, 0.2, 0.1]): |
def candidates_sampling_plot(ax, linewidths=[0.7, 0.5, 0.4, 0.3, 0.2, 0.1]): |
|
... |
... |
def candidates_sampling_plot(ax, linewidths=[0.7, 0.5, 0.4, 0.3, 0.2, 0.1]): |
75 |
103 |
mart.plot_boundaries(ax, lw=0.7, zorder=10500) |
mart.plot_boundaries(ax, lw=0.7, zorder=10500) |
76 |
104 |
except: |
except: |
77 |
105 |
pass |
pass |
|
106 |
|
ax.xaxis.set_major_formatter(ticker.NullFormatter()) |
|
107 |
|
ax.yaxis.set_major_formatter(ticker.NullFormatter()) |
|
108 |
|
ax.xaxis.set_major_locator(ticker.NullLocator()) |
|
109 |
|
ax.yaxis.set_major_locator(ticker.NullLocator()) |
78 |
110 |
|
|
79 |
111 |
def candidates_plot(ax): |
def candidates_plot(ax): |
80 |
112 |
tri_plot(ax, tri_space=None, linewidths=[0.7, 0.5, 0.4, 0.3], data_offset=0.4) |
tri_plot(ax, tri_space=None, linewidths=[0.7, 0.5, 0.4, 0.3], data_offset=0.4) |
|
... |
... |
def tri_nodes_plot(ax, tri_space=None, tn_scheme=None,\ |
129 |
161 |
tn_scheme = ax.sample_box.Tri.tn_scheme |
tn_scheme = ax.sample_box.Tri.tn_scheme |
130 |
162 |
except: |
except: |
131 |
163 |
import quadpy |
import quadpy |
132 |
|
tn_scheme = quadpy.tn.grundmann_moeller(sample_box.nvar, 5) |
|
|
164 |
|
tn_scheme = quadpy.tn.grundmann_moeller(ax.sample_box.nvar, 5) |
133 |
165 |
|
|
134 |
166 |
|
|
135 |
167 |
def _draw_nodes(*args, **kwargs): |
def _draw_nodes(*args, **kwargs): |
|
... |
... |
def tri_plot(ax, tri_space=None, linewidths=[0.7, 0.5, 0.4, 0.3, 0.2, 0.1], data |
215 |
247 |
mart.plot_boundaries(ax, lw=0.7, zorder=1050) |
mart.plot_boundaries(ax, lw=0.7, zorder=1050) |
216 |
248 |
except: |
except: |
217 |
249 |
pass |
pass |
218 |
|
mart.setup_labels(ax, data_offset) |
|
|
250 |
|
mart.setup_labels(ax, data_offset=data_offset) |
219 |
251 |
|
|
220 |
252 |
|
|
221 |
253 |
|
|