Same height of HISTOGRAM and a DIFFERENT gaussian curve, not related to histogram dataHistogram peak identification and gauss fitting with minimal accumulated hight difference in c++Statistical analysis on Bell shaped (Gaussian) curveUn-normalized Gaussian curve on histogramCreating a 1D Second derivative of gaussian Windowhow to generate new points as offset with gaussian distribution for some points in spherical coordinates in pythonpython: selecting part of a gaussian fit curve of a histogram for analysisPlotting histogram with theoretical curve: Random realizationFitting un-normalized gaussian in histogram pythonrandomly select histogram data MATLABHow to plot a gaussian curve over histogram in chart.js?

How to evaluate math equation, one per line in a file?

What will happen to a ball kept on a frictionless inclined plane?

How to equalize the chance of throwing the highest dice? (Riddle)

How can I speed up secure erasing of a disk?

Do one quarter of Swedes named 'Ali' have a criminal record?

Distributed AG on SQL Server 2017 Standard Edition?

What's a good use case for SELECT * in production code?

Horizontal alignment of matrix in an array by using llap and phantom

Why does E7 sharp 9 have a G?

Can Vice President Pence be impeached before President Trump?

Threatening to discontinue a service for a client

Someone said to me, "We basically literally did." What were they trying to express to me?

What makes the planets to be symmetric

Do Klingons have escape pods?

What is the largest piece of space debris volumetrically?

Memory models for assembly libraries for Turbo C

How does Peano Postulates construct Natural numbers only?

What is the difference between "cat < filename" and "cat filename"?

Dollar cost averaging vs buy low/sell high

Does USB version speed matter for input devices?

Why do HK chefs use a white cloth to clutch wok?

Starting with D&D: Starter Set vs Dungeon Master's Guide

Match blood types in C

Origin of Aliens in 'A Quiet Place'?



Same height of HISTOGRAM and a DIFFERENT gaussian curve, not related to histogram data


Histogram peak identification and gauss fitting with minimal accumulated hight difference in c++Statistical analysis on Bell shaped (Gaussian) curveUn-normalized Gaussian curve on histogramCreating a 1D Second derivative of gaussian Windowhow to generate new points as offset with gaussian distribution for some points in spherical coordinates in pythonpython: selecting part of a gaussian fit curve of a histogram for analysisPlotting histogram with theoretical curve: Random realizationFitting un-normalized gaussian in histogram pythonrandomly select histogram data MATLABHow to plot a gaussian curve over histogram in chart.js?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









0


















I have one data something like this, but with 1000 points:
fractions = [ 85,86,78,89,73,80,85,79,......83]
(we could assume a 1000 random points between (70,90)



(edit: I want the maximum height of the Gaussian the be the same as maximum height of histogram.)



And I want to compare this with a gaussian curve given by



def quasars_gaussian_curve(mu= 45,sigma=0.35):

x = np.linspace(mu - 3*sigma, mu + 3*sigma, 100)
plt.plot(x, stats.norm.pdf(x, mu, sigma)


So when I do this:
quasars_gaussian_curve(mu, sigma))



plt.hist(fraction,density = 1) 
plt.show()


I get this :



! [Histogram vs gaussian: I need the gaussian to have the same height as my histogram]
https://imgur.com/hqrnfCH










share|improve this question



























  • normed=True in plt.hist

    – mamun
    Mar 28 at 21:59











  • normed has been depreciated to 'density', and I have used that in my example too.

    – WildBoi11
    Mar 28 at 22:02











  • Sorry, let me rephrase my question. I want the maximum height of the Gaussian to be the same as the Histogram.

    – WildBoi11
    Mar 28 at 22:04

















0


















I have one data something like this, but with 1000 points:
fractions = [ 85,86,78,89,73,80,85,79,......83]
(we could assume a 1000 random points between (70,90)



(edit: I want the maximum height of the Gaussian the be the same as maximum height of histogram.)



And I want to compare this with a gaussian curve given by



def quasars_gaussian_curve(mu= 45,sigma=0.35):

x = np.linspace(mu - 3*sigma, mu + 3*sigma, 100)
plt.plot(x, stats.norm.pdf(x, mu, sigma)


So when I do this:
quasars_gaussian_curve(mu, sigma))



plt.hist(fraction,density = 1) 
plt.show()


I get this :



! [Histogram vs gaussian: I need the gaussian to have the same height as my histogram]
https://imgur.com/hqrnfCH










share|improve this question



























  • normed=True in plt.hist

    – mamun
    Mar 28 at 21:59











  • normed has been depreciated to 'density', and I have used that in my example too.

    – WildBoi11
    Mar 28 at 22:02











  • Sorry, let me rephrase my question. I want the maximum height of the Gaussian to be the same as the Histogram.

    – WildBoi11
    Mar 28 at 22:04













0













0









0








I have one data something like this, but with 1000 points:
fractions = [ 85,86,78,89,73,80,85,79,......83]
(we could assume a 1000 random points between (70,90)



(edit: I want the maximum height of the Gaussian the be the same as maximum height of histogram.)



And I want to compare this with a gaussian curve given by



def quasars_gaussian_curve(mu= 45,sigma=0.35):

x = np.linspace(mu - 3*sigma, mu + 3*sigma, 100)
plt.plot(x, stats.norm.pdf(x, mu, sigma)


So when I do this:
quasars_gaussian_curve(mu, sigma))



plt.hist(fraction,density = 1) 
plt.show()


I get this :



! [Histogram vs gaussian: I need the gaussian to have the same height as my histogram]
https://imgur.com/hqrnfCH










share|improve this question
















I have one data something like this, but with 1000 points:
fractions = [ 85,86,78,89,73,80,85,79,......83]
(we could assume a 1000 random points between (70,90)



(edit: I want the maximum height of the Gaussian the be the same as maximum height of histogram.)



And I want to compare this with a gaussian curve given by



def quasars_gaussian_curve(mu= 45,sigma=0.35):

x = np.linspace(mu - 3*sigma, mu + 3*sigma, 100)
plt.plot(x, stats.norm.pdf(x, mu, sigma)


So when I do this:
quasars_gaussian_curve(mu, sigma))



plt.hist(fraction,density = 1) 
plt.show()


I get this :



! [Histogram vs gaussian: I need the gaussian to have the same height as my histogram]
https://imgur.com/hqrnfCH







python histogram gaussian curve






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 22:05







WildBoi11

















asked Mar 28 at 21:57









WildBoi11WildBoi11

12 bronze badges




12 bronze badges















  • normed=True in plt.hist

    – mamun
    Mar 28 at 21:59











  • normed has been depreciated to 'density', and I have used that in my example too.

    – WildBoi11
    Mar 28 at 22:02











  • Sorry, let me rephrase my question. I want the maximum height of the Gaussian to be the same as the Histogram.

    – WildBoi11
    Mar 28 at 22:04

















  • normed=True in plt.hist

    – mamun
    Mar 28 at 21:59











  • normed has been depreciated to 'density', and I have used that in my example too.

    – WildBoi11
    Mar 28 at 22:02











  • Sorry, let me rephrase my question. I want the maximum height of the Gaussian to be the same as the Histogram.

    – WildBoi11
    Mar 28 at 22:04
















normed=True in plt.hist

– mamun
Mar 28 at 21:59





normed=True in plt.hist

– mamun
Mar 28 at 21:59













normed has been depreciated to 'density', and I have used that in my example too.

– WildBoi11
Mar 28 at 22:02





normed has been depreciated to 'density', and I have used that in my example too.

– WildBoi11
Mar 28 at 22:02













Sorry, let me rephrase my question. I want the maximum height of the Gaussian to be the same as the Histogram.

– WildBoi11
Mar 28 at 22:04





Sorry, let me rephrase my question. I want the maximum height of the Gaussian to be the same as the Histogram.

– WildBoi11
Mar 28 at 22:04












1 Answer
1






active

oldest

votes


















0



















Ok. So there's this astropy package for Python. Didn't know it had this Gaussian1D class in astro fitting and modeling.
If anyone runs into same problems, even if it's not astronomy and wants to fit a Gaussian curve to their given Amplitude, Mean and StandardDeviataion this is the perfect solution probably. And probably the shortest



Here's how I did it.



from astropy.modeling.models import Gaussian1D

def fit_gaussian_curve():
g1 = Gaussian1D(0.11,44,0.35 )
x = np.linspace(44 - 3*0.35, 44 + 3*0.35, 100)
plt.plot(x,g1(x))


(The Max height of histogram was around 0.11, mean 44 and sigma 0.35)
And here is my plot now. Compare it to the previous, mission complete.



!https://imgur.com/MYraeeD
More info here:
http://docs.astropy.org/en/stable/modeling/






share|improve this answer



























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );














    draft saved

    draft discarded
















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55407455%2fsame-height-of-histogram-and-a-different-gaussian-curve-not-related-to-histogra%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown


























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0



















    Ok. So there's this astropy package for Python. Didn't know it had this Gaussian1D class in astro fitting and modeling.
    If anyone runs into same problems, even if it's not astronomy and wants to fit a Gaussian curve to their given Amplitude, Mean and StandardDeviataion this is the perfect solution probably. And probably the shortest



    Here's how I did it.



    from astropy.modeling.models import Gaussian1D

    def fit_gaussian_curve():
    g1 = Gaussian1D(0.11,44,0.35 )
    x = np.linspace(44 - 3*0.35, 44 + 3*0.35, 100)
    plt.plot(x,g1(x))


    (The Max height of histogram was around 0.11, mean 44 and sigma 0.35)
    And here is my plot now. Compare it to the previous, mission complete.



    !https://imgur.com/MYraeeD
    More info here:
    http://docs.astropy.org/en/stable/modeling/






    share|improve this answer






























      0



















      Ok. So there's this astropy package for Python. Didn't know it had this Gaussian1D class in astro fitting and modeling.
      If anyone runs into same problems, even if it's not astronomy and wants to fit a Gaussian curve to their given Amplitude, Mean and StandardDeviataion this is the perfect solution probably. And probably the shortest



      Here's how I did it.



      from astropy.modeling.models import Gaussian1D

      def fit_gaussian_curve():
      g1 = Gaussian1D(0.11,44,0.35 )
      x = np.linspace(44 - 3*0.35, 44 + 3*0.35, 100)
      plt.plot(x,g1(x))


      (The Max height of histogram was around 0.11, mean 44 and sigma 0.35)
      And here is my plot now. Compare it to the previous, mission complete.



      !https://imgur.com/MYraeeD
      More info here:
      http://docs.astropy.org/en/stable/modeling/






      share|improve this answer




























        0















        0











        0









        Ok. So there's this astropy package for Python. Didn't know it had this Gaussian1D class in astro fitting and modeling.
        If anyone runs into same problems, even if it's not astronomy and wants to fit a Gaussian curve to their given Amplitude, Mean and StandardDeviataion this is the perfect solution probably. And probably the shortest



        Here's how I did it.



        from astropy.modeling.models import Gaussian1D

        def fit_gaussian_curve():
        g1 = Gaussian1D(0.11,44,0.35 )
        x = np.linspace(44 - 3*0.35, 44 + 3*0.35, 100)
        plt.plot(x,g1(x))


        (The Max height of histogram was around 0.11, mean 44 and sigma 0.35)
        And here is my plot now. Compare it to the previous, mission complete.



        !https://imgur.com/MYraeeD
        More info here:
        http://docs.astropy.org/en/stable/modeling/






        share|improve this answer














        Ok. So there's this astropy package for Python. Didn't know it had this Gaussian1D class in astro fitting and modeling.
        If anyone runs into same problems, even if it's not astronomy and wants to fit a Gaussian curve to their given Amplitude, Mean and StandardDeviataion this is the perfect solution probably. And probably the shortest



        Here's how I did it.



        from astropy.modeling.models import Gaussian1D

        def fit_gaussian_curve():
        g1 = Gaussian1D(0.11,44,0.35 )
        x = np.linspace(44 - 3*0.35, 44 + 3*0.35, 100)
        plt.plot(x,g1(x))


        (The Max height of histogram was around 0.11, mean 44 and sigma 0.35)
        And here is my plot now. Compare it to the previous, mission complete.



        !https://imgur.com/MYraeeD
        More info here:
        http://docs.astropy.org/en/stable/modeling/







        share|improve this answer













        share|improve this answer




        share|improve this answer










        answered Mar 28 at 22:53









        WildBoi11WildBoi11

        12 bronze badges




        12 bronze badges

































            draft saved

            draft discarded















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55407455%2fsame-height-of-histogram-and-a-different-gaussian-curve-not-related-to-histogra%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown









            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript