Option to have stats on graph or not

This commit is contained in:
2026-02-27 17:55:12 +01:00
parent 35ca52fd84
commit 2f7924e580
2 changed files with 15 additions and 13 deletions

View File

@@ -44,7 +44,7 @@ parser.add_argument('--normalizey', action="store_true",
help='Set y-axis to normalized probability density')
parser.add_argument('--log', default="INFO",
help='Console log level: Number or DEBUG, INFO, WARNING, ERROR')
parser.add_argument('--graphinfo',
parser.add_argument('--graphinfo', action="store_true",
help='Put information on the PDF graph')
args = parser.parse_args()
@@ -103,6 +103,8 @@ info = -np.emath.log2(prob)
#print("information content: %f bits", info)
## place text on plot: https://matplotlib.org/3.3.4/gallery/recipes/placing_text_boxes.html
fig, ax = plt.subplots()
if args.graphinfo:#put info on corner of graph
textstr = '\n'.join((
r'$n=%d$' % (samplesize),
r'$\mu=%.2f$' % (mean, ),

View File

@@ -1,5 +1,5 @@
#!/bin/bash
echo "Loading data from file"
./infocalc.py DATA testdata.csv data1 0.9 1.1
./infocalc.py DATA testdata.csv data1 0.9 1.1 --graphinfo
echo "Creating simulated curve from parameters"
./infocalc.py SIM 8 1.0 0.5 0.9 1.1