Commit cb719f8c authored by Zolnierczuk, Piotr's avatar Zolnierczuk, Piotr
Browse files

small plot cleanup

parent 43c976e5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ from .hdf import HdfConverter, convert_to_hdf # NOQA
from .reader  import (  read_echo, read_magnetic, read_xyz,         # NOQA
                        read_detimage, read_datfile, read_diffrun,  # NOQA
                        read_datreat , read_transmission )          # NOQA
from .writer  import EchoWriter, make_echofilename
from .writer  import EchoWriter, make_echofilename                  # NOQA
from .scans   import EchoScan, XYZScan                              # NOQA
# from .legacy_writer  import write_csv, generate_echo                       # NOQA
# from .legacy_history import extract_data, list_variables, parse_date       # NOQA
+8 −11
Original line number Diff line number Diff line
@@ -272,17 +272,18 @@ def plot_atari(hdfile, iecho=None, **kwargs):
        ax.axhline(res['average'][0]+res['amplitude'][0], color=dcol, lw=1, ls='--')
        ax.axhline(res['average'][0]-res['amplitude'][0], color=dcol, lw=1, ls='--')

        minup, maxup = None, None
        minud, maxud = None, None
        try:
            minup, maxup = min((min(up), min(dn))), max((max(up), max(dn)))
            minup = min(minup, min(pha))*0.8
            maxup = max(maxup, max(pha))*1.2
        except ValueError:
            tmp = np.hstack((pha,up,dn))
            minud = 10**np.floor(np.log10(min(tmp)))
            maxud = 10**np.ceil (np.log10(max(tmp)))
        except ValueError as exc:
            log.warning("cannot determine echo min/max: %s",exc)
            only_echo =True

        if only_echo:
            _txt = r'$A(Q,t)$=%.3g$\pm$%.3g' % res['amplitude']
            minup, maxup = None, None
            minud, maxud = None, None
            log.info("Phase=%.4g(%.4g) Amp=%.4g(%.4g) Average=%.4g(%.4g)",
                phase_ef, phase_err,
                res['amplitude'][0], res['amplitude'][1],
@@ -323,11 +324,7 @@ def plot_atari(hdfile, iecho=None, **kwargs):
        ax.set_xlabel(r'phase current [A]')
        ax.legend(loc='best', ncol=2) #('upper right')
        ax.grid(True)
        if minup is not None:
            ax.set_ylim(bottom=minup)
        if maxup is not None:
            ax.set_ylim(top=maxup)
        #
        ax.set_ylim(bottom=minud, top=maxud)
        fig.suptitle(r'%s: %s $Q$=%.3f$\AA^{-1}$ $\tau$=%.3gns' % (base, comment, q0,tau0))


+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ import matplotlib.pyplot as plt
from   matplotlib import colors

from .. import config, get_q, ANGSTROM
from ..inout.scans import XYZScan
from ..inout   import XYZScan
from .plotutil import norm_pix, get_pix


+2 −2
Original line number Diff line number Diff line
@@ -3,8 +3,8 @@ PySEN revision module
"""
import sys
__version__  = "2.0"
__release__  = "a7"
__date__     = "Nov 13, 2024"
__release__  = "a8"
__date__     = "Nov 14, 2024"

def version(full=False):
    "get pysen version number"