/gp_plot.py (5d721d117448dbb96c554ea8f0e4651ffe9ac457) (2718 bytes) (mode 100644) (type blob)
#!/usr/bin/env python
# coding: utf-8
import PyGnuplot as gp
import os
# nikdo mi neuvěří, že by tohle postačílo a nebylo by nutné tohlensto furt úpravovat
def gp_plot(sample_box, space='R', terminal='png', filename=''):
if not filename:
filename = 'store/%s_%s_%s'%(sample_box.gm_signature, space, sample_box.nsim)
if space in ['Rn', 'GK', 'G']:
gp.c('set autoscale xy')
gp.c('set size square')
gp.c('set zeroaxis')
elif space in ['P', 'U']:
gp.c('set xrange [0:1]')
gp.c('set yrange [0:1]')
gp.c('set size square')
#gp.c('set autoscale')
gp.c('unset zeroaxis')
else: # R teda?
gp.c('set size noratio')
gp.c('set autoscale')
gp.c('unset zeroaxis')
gp.c('set terminal ' + terminal)
gp.c('set output "%s.%s"'%(filename, terminal))
if os.name == 'posix':
gp.c('set decimalsign locale "POSIX"')
# legenda
gp.c('unset key')
# se mi zda, že gp bere data v řadcích
f_name = "%s_failure.dat" % (filename)
s_name = "%s_success.dat" % (filename)
gp.s(getattr(sample_box.failure_samples, space).T, f_name)
gp.s(getattr(sample_box.success_samples, space).T, s_name)
# rozkaz, který předaváme gnuplotovi
gp_plot = 'plot "%s" title "Success points" w p lc rgb "green", "%s" title "Failure points" w p lc rgb "red"' % (s_name, f_name)
# Kružničky chcete?
# Кружочки ннада?
if space in ['Rn', 'G']:
gp.c('set parametric')
for i in range(5):
lw = 2 - i*0.3
gp_plot += ', cos(t)*%s,sin(t)*%s notitle w l lc rgb "black" lw %s'%(i+1, i+1, lw)
# ne všichni majó definované hranice
try:
bounds = sample_box.get_2D_boundary()
for i in range(len(bounds)):
bound = getattr(bounds[i], space).T
gp.s(bound, "%s_boundary_%s.dat"%(filename, i+1))
gp_plot += ', "%s_boundary_%s.dat" notitle w l lc rgb "blue"'%(filename, i+1)
except AttributeError:
pass
# Plot!
gp.c(gp_plot)
# nikdo mi neuvěří, že by tohle postačílo a nebylo by nutné tohlensto furt úpravovat
def plot(data2D, terminal='png', filename=''):
if not filename:
filename = 'store/plot_%s'%(len(data2D[0]))
gp.c('set terminal ' + terminal)
gp.c('set output "%s.%s"'%(filename, terminal))
if os.name == 'posix':
gp.c('set decimalsign locale "POSIX"')
# se mi zda, že gp bere data v řadcích
gp.s(data2D, filename+'.dat')
# Plot!
# rozkaz, který předaváme gnuplotovi
gp.c('plot "%s.dat" ' % (filename))
Mode |
Type |
Size |
Ref |
File |
100644 |
blob |
11744 |
9fdf445de3ce04c9c28d9cf78a18d830b54703ab |
IS_stat.py |
100644 |
blob |
6 |
0916b75b752887809bac2330f3de246c42c245cd |
__init__.py |
100644 |
blob |
26851 |
b0ccb9c800e0fd7ecb869b0e052b387f77868382 |
blackbox.py |
100644 |
blob |
7266 |
441664a465885f76786e9a259015983579217d09 |
candybox.py |
100644 |
blob |
17034 |
221ae6f21b8244d7e9ed9863ed8108f9d58317ef |
estimation.py |
100644 |
blob |
18416 |
dc3be53fec074c8de2b32c8ebc5c684e19bcb2b6 |
f_models.py |
100644 |
blob |
28874 |
d8521ed3cc7d9f32c63335fb60c2df206c14525f |
g_models.py |
100644 |
blob |
2718 |
5d721d117448dbb96c554ea8f0e4651ffe9ac457 |
gp_plot.py |
100644 |
blob |
10489 |
1f6dd06a036fdc4ba6a7e6d61ac0b84e8ad3a4c1 |
mplot.py |
100644 |
blob |
896 |
14e91bd579c101f1c85bc892af0ab1a196a165a0 |
plot.py |
100644 |
blob |
2807 |
1feb1d43e90e027f35bbd0a6730ab18501cef63a |
plotly_plot.py |
100644 |
blob |
14307 |
b6a7545356e45f9abd98af3a9411f3e2437d17b0 |
qt_plot.py |
100644 |
blob |
6251 |
fc18a41a14682b505a10a2947cfd6fdbea4c59cd |
reader.py |
100644 |
blob |
4228 |
278bfa08534fcbdf58652edf636fb700395a5f1d |
samplebox.py |
100644 |
blob |
5553 |
bac994ae58f1df80c7f8b3f33955af5402f5a4f3 |
sball.py |
100644 |
blob |
21563 |
c9f8f898feec1fbcb76061bb3df981ce6e455049 |
whitebox.py |
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"
Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/iam-git/WellMet
Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/iam-git/WellMet
Clone this repository using git:
git clone git://git.rocketgit.com/user/iam-git/WellMet
You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a
merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main