Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 How to graph a normal distribution?
#1
Hello, if I have a problem in the following way:

x: 20
mu: 17
sigma: 1.1
well before graphing you need to get the Z-score, so I apply the following:

z = (x - mu)/sigma
Now I can just use z in a normal distribution, but here my big problem, as I generate values for the graph.

import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
import math

mu = 8
sigma = 2
# here x must be z
x = np.linspace(mu - 3*sigma, mu + 3*sigma, 10)
#----------------------------
print(np.linspace(mu - 3*sigma, mu + 3*sigma, 10))
plt.plot(x, stats.norm.pdf(x, mu, sigma))
plt.show()
good in this code x is generated but my doubt is that it replaced x by z and that at the same time I must generate the graph of said variable Exclamation
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  unsupervised learning for distribution of outliers dervast 3 167 Aug-01-2019, 12:41 AM
Last Post: scidam
  display graph in columns and rows william888 1 217 Jul-02-2019, 10:19 AM
Last Post: dataman
  span color on graph sunset/dawn mcgrim 0 430 Jun-13-2019, 09:22 AM
Last Post: mcgrim
  Draw graph (Python) Eberle 1 1,171 May-28-2019, 05:29 AM
Last Post: heiner55
  Automatically plot each variable on the same graph for each "ID" AdWill97 0 236 Apr-15-2019, 09:29 AM
Last Post: AdWill97
  Print a Graph (packages) dervast 1 244 Apr-11-2019, 08:14 AM
Last Post: Gribouillis
  Function for the Normal Loss Function L(z) Smelly 1 350 Feb-01-2019, 11:49 AM
Last Post: scidam
  Draw Weibull distribution probability function based on Confidence interval farzadtb 1 747 Jul-31-2018, 03:21 PM
Last Post: Vysero
  [Plot a stacked bar graph using plotly offline mode] niks250891 1 1,861 Apr-22-2018, 02:11 PM
Last Post: niks250891
  How we can embed a metplotlib graph in tkinter PrashantStd 1 4,072 Jan-10-2018, 08:37 PM
Last Post: Gribouillis

Forum Jump:


Users browsing this thread: 1 Guest(s)