0

I'm attempting to perform a Gaussian on a small portion of my histogrammed data. I understand how to make reference to the indices on the x-axis by using the ":". However I would like to examine the specific values which lie between a specific interval. I have histogrammed all of the data, but I would like to perform a Gaussian on this specific portion: I am currently utilizing the following code, but this does not correspond to the specified values that I'm attempting to use. The full data set is referred to as "data", but I would only like to reference a small portion of this

import numpy as np
import matplotlib.pyplot as plt
from scipy import loadtxt, optimize



ax = plt.axes()
subplt.hist(data, 100, color = 'g')
data2=data[500:600]
ax.hist(data,30,color='g')
mu = np.mean(data)
sigma = np.std(data)
N=number of data points
SDmean = sigma/np.sqrt(N)


      textstr = 

      'Mean, $\\mu=%g$ \n' \
      'Standard Deviation, $\\sigma=%.2f$ \n' \
      'Number of Values, $n=%i$ \n' \
      'Standard Deviation of the Mean, \n' \
      '  $\\sigma_{\\mu} = %.2e$' \
      %(mu, sigma,N, SDmean)
      ax.text(0.05, 0.95, textstr, transform=ax.transAxes, fontsize=12,
    verticalalignment='top')
J.Doe
  • 1
  • 1
  • 1

0 Answers0