Commit f87a6eed authored by Martin Reinecke's avatar Martin Reinecke

tweaks

parent 36c7f0f6
......@@ -10,11 +10,12 @@ def plot_test():
fft = ift.FFTOperator(rg_space2)
field_rg1_1 = ift.Field(domain=rg_space1, val=np.random.randn(100))
field_rg1_2 = ift.Field(domain=rg_space1, val=np.random.randn(100))
field_rg2 = ift.Field(domain=rg_space2, val=np.random.randn(80 ** 2).reshape((80, 80)))
field_hp = ift.Field(domain=hp_space, val=np.random.randn(12*64**2))
field_gl = ift.Field(domain=gl_space, val=np.random.randn(32640))
field_rg1_1 = ift.Field.from_global_data(rg_space1, np.random.randn(100))
field_rg1_2 = ift.Field.from_global_data(rg_space1, np.random.randn(100))
field_rg2 = ift.Field.from_global_data(
rg_space2, np.random.randn(80 ** 2).reshape((80, 80)))
field_hp = ift.Field.from_global_data(hp_space, np.random.randn(12*64**2))
field_gl = ift.Field.from_global_data(gl_space, np.random.randn(32640))
field_ps = ift.power_analyze(fft.times(field_rg2))
## Start various plotting tests
......@@ -24,7 +25,8 @@ def plot_test():
ift.plot(field_rg2, title='2d rg')
ift.plot([field_rg1_1, field_rg1_2], title='list 1d rg', label=['1', '2'])
ift.plot(field_rg1_2, title='1d rg, xmin, ymin', xmin=0.5, ymin=0., xlabel='xmin=0.5', ylabel='ymin=0')
ift.plot(field_rg1_2, title='1d rg, xmin, ymin', xmin=0.5, ymin=0.,
xlabel='xmin=0.5', ylabel='ymin=0')
ift.plot_finish(title='Three plots')
ift.plot(field_hp, title='HP planck-color', colormap='Planck-like')
......@@ -36,4 +38,3 @@ def plot_test():
if __name__ == '__main__':
plot_test()
......@@ -289,6 +289,7 @@ def _plot(f, ax, **kwargs):
raise ValueError("Field type not(yet) supported")
_plots = []
_kwargs = []
......@@ -308,7 +309,8 @@ def plot_finish(**kwargs):
nx = kwargs.pop("nx", int(np.ceil(np.sqrt(nplot))))
ny = kwargs.pop("ny", int(np.ceil(np.sqrt(nplot))))
if nx*ny < nplot:
raise ValueError('Figure dimensions not sufficient for number of plots')
raise ValueError(
'Figure dimensions not sufficient for number of plots')
xsize = kwargs.pop("xsize", 6)
ysize = kwargs.pop("ysize", 6)
fig.set_size_inches(xsize, ysize)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment