SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
rangetypes.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3
4# EB 04/05/2019
5# Plot range types
6
7import numpy as np
8import matplotlib
9matplotlib.rcParams['text.usetex'] = True
10matplotlib.rcParams['text.latex.preamble'] = [r"\usepackage{amsmath}",r"\usepackage{sansmath}", r"\sansmath"]
11matplotlib.rcParams['font.family'] = ['sans-serif']
12matplotlib.rcParams.update({'font.size': 14})
13
14import matplotlib.pyplot as plt
15
16f, ax = plt.subplots(1,2, figsize=(12,5), dpi=150)
17plt.subplots_adjust(left=0.08, right=0.99, bottom=0.11, top=0.98, wspace=0.3, hspace=0.4)
18Qmin = -10.0
19Qmax = 10.0
20Q = np.linspace(Qmin, Qmax, 100)
21qmin = -1.0
22qmax = 1.0
23q = (qmax - qmin) / (1 + np.exp(-Q)) + qmin
24#ax[0].set_xlim(qmin, qmax)
25ax[0].plot(q,Q)
26ax[0].set_xlabel(r"$q_{x}(\textsf{model})$", fontsize=16)
27ax[0].set_ylabel(r"$Q_{x}(\textsf{engine})$", fontsize=16)
28ax[0].grid(linewidth=0.5, linestyle=':')
29
30qmin = 0.01
31qmax = 100.0
32q = qmin * np.exp((np.log(qmax) - np.log(qmin)) / (1 + np.exp(-Q)))
33ax[1].set_xscale("log")
34ax[1].xaxis.set_major_formatter(matplotlib.ticker.FuncFormatter(lambda f, _: '{:.16g}'.format(f)))
35#ax[1].set_xlim(qmin, qmax)
36ax[1].plot(q,Q)
37ax[1].set_xlabel(r"$q_\textsf{aspect}(\textsf{model})$", fontsize=16)
38ax[1].set_ylabel(r"$Q_\textsf{aspect}(\textsf{engine})$", fontsize=16)
39ax[1].grid(linewidth=0.5, linestyle=':')
40plt.savefig("rangetypes.svg")
41plt.savefig("rangetypes.pdf")
42