better ticks for slices
This commit is contained in:
parent
01c696bfa3
commit
a24058e9e3
1 changed files with 4 additions and 4 deletions
|
@ -34,7 +34,7 @@ def plot_imshow_with_reference( data_list,
|
||||||
elif isinstance(L, int) or isinstance(L, float):
|
elif isinstance(L, int) or isinstance(L, float):
|
||||||
L = [L for data in data_list]
|
L = [L for data in data_list]
|
||||||
|
|
||||||
sep = 10 if L[0] < 50 else 20 if L[0] < 200 else 100
|
sep = 10 if L[0] < 50 else 20 if L[0] < 100 else 50 if L[0]<250 else 100 if L[0] < 500 else 200 if L[0] < 1000 else 500 if L[0] < 2500 else 1000
|
||||||
ticks = [np.arange(0, l+1, sep)*len(dat)/l for l, dat in zip(L,data_list)]
|
ticks = [np.arange(0, l+1, sep)*len(dat)/l for l, dat in zip(L,data_list)]
|
||||||
tick_labels = [np.arange(0, l+1, sep) for l in L]
|
tick_labels = [np.arange(0, l+1, sep) for l in L]
|
||||||
|
|
||||||
|
@ -126,12 +126,12 @@ if __name__ == "__main__":
|
||||||
parser.add_argument('-t', '--title', type=str, default=None, help='Title for the plot.')
|
parser.add_argument('-t', '--title', type=str, default=None, help='Title for the plot.')
|
||||||
parser.add_argument('-log','--log_scale', action='store_true', help='Use log scale for the data.')
|
parser.add_argument('-log','--log_scale', action='store_true', help='Use log scale for the data.')
|
||||||
|
|
||||||
register_arguments_cosmo(parser)
|
# register_arguments_cosmo(parser)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
from pysbmy.field import read_field
|
from pysbmy.field import read_field
|
||||||
from pysbmy.cosmology import d_plus
|
# from pysbmy.cosmology import d_plus
|
||||||
|
|
||||||
ref_field = read_field(args.directory+args.reference) if args.reference is not None else None
|
ref_field = read_field(args.directory+args.reference) if args.reference is not None else None
|
||||||
fields = [read_field(args.directory+f) for f in args.filenames]
|
fields = [read_field(args.directory+f) for f in args.filenames]
|
||||||
|
@ -173,4 +173,4 @@ if __name__ == "__main__":
|
||||||
if args.output is not None:
|
if args.output is not None:
|
||||||
fig.savefig(args.output)
|
fig.savefig(args.output)
|
||||||
else:
|
else:
|
||||||
fig.savefig(args.directory+'slices.png')
|
fig.savefig(args.directory+'slices.png')
|
||||||
|
|
Loading…
Add table
Reference in a new issue