Skip to content
Snippets Groups Projects
Commit 3c9a8066 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

plot_int: inferno

parent ae6d11ee
No related branches found
No related tags found
1 merge request!1501fix discrepancies betwee plot_int and ba_plot (#504); protect a pointer by ASSERTs
......@@ -4,8 +4,7 @@ Plots data stored in BornAgain's .int or .int.gz format.
Can handle both 1D and 2D arrays.
"""
import argparse
import sys
import argparse, os, sys
import numpy as np
import bornagain as ba
from matplotlib import pyplot as plt
......@@ -13,6 +12,7 @@ from matplotlib import rc, colors
rc('font', **{'family': 'sans-serif', 'sans-serif': ['Helvetica']})
rc('text', usetex=True)
cmap = os.environ['CMAP'] if 'CMAP' in os.environ else 'inferno'
def plot_int(args):
data = ba.IOFactory.readDatafield(args.file)
......@@ -67,7 +67,7 @@ def plot_raw_data_2d(values, extent_array, ylog, intensity_min, intensity_max):
norm = colors.LogNorm(intensity_min, intensity_max)
else:
norm = colors.Normalize(intensity_min, intensity_max)
im = plt.imshow(values, norm=norm, extent=extent_array, aspect='auto')
im = plt.imshow(values, cmap=cmap, norm=norm, extent=extent_array, aspect='auto')
cb = plt.colorbar(im)
cb.set_label(r'Intensity (arb. u.)', size=16)
plt.xlabel(r'$\phi_f (^{\circ})$', fontsize=16)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment