How to construct and plot the following accumulated list? Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How to construct pairs in a list?Select rows of matrix that are higher than a given rowHow do I select only those lists whose elements are all above a certain number?Selecting every n-th element from a listFinding pairs where the intersection of them is empty set from a nested listHow to compare and remove x-coordinates (and the associated y-coordinates) that are less than previous x-coordinates?ListPlot with colorsModifying a function so that it will take multiple conditionsHow to construct a list of lengths efficientlySelecting cases from a list based on two conditions

Should I use a zero-interest credit card for a large one-time purchase?

Why wasn't DOSKEY integrated with COMMAND.COM?

How to convince students of the implication truth values?

When was Kai Tak permanently closed to cargo service?

Why are there no cargo aircraft with "flying wing" design?

Trademark violation for app?

Fundamental Solution of the Pell Equation

Is there such thing as an Availability Group failover trigger?

Generate an RGB colour grid

What causes the direction of lightning flashes?

Is grep documentation wrong?

Does classifying an integer as a discrete log require it be part of a multiplicative group?

How does the math work when buying airline miles?

Is there any way for the UK Prime Minister to make a motion directly dependent on Government confidence?

How do I find out the mythology and history of my Fortress?

Is it common practice to audition new musicians one-on-one before rehearsing with the entire band?

What is homebrew?

Delete nth line from bottom

How to answer "Have you ever been terminated?"

Why didn't Eitri join the fight?

Did MS DOS itself ever use blinking text?

How can I use the Python library networkx from Mathematica?

Extracting terms with certain heads in a function

Do square wave exist?



How to construct and plot the following accumulated list?



Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?How to construct pairs in a list?Select rows of matrix that are higher than a given rowHow do I select only those lists whose elements are all above a certain number?Selecting every n-th element from a listFinding pairs where the intersection of them is empty set from a nested listHow to compare and remove x-coordinates (and the associated y-coordinates) that are less than previous x-coordinates?ListPlot with colorsModifying a function so that it will take multiple conditionsHow to construct a list of lengths efficientlySelecting cases from a list based on two conditions










2












$begingroup$


I have a list, say it is



a = 1,3,3.2,3.9,4,4.4,4.9,5,7,8


To get the accumulate:



acc = Accumlate[a]


I want to plot the number of elements less than or equal to a certain element against the accumulated value of the list elements.
The pairs should look like (acc[[i]], number of elements less than a[[i]]). For instance, (1, 1), (4, 2), (7.2,3), etc.



Then I want to take the derivative of the plot to plot it as well.










share|improve this question











$endgroup$







  • 1




    $begingroup$
    The plotting is not a problem see ListPlot. Also, if you want a derivative you will have to define this as you don't have a continuous function. What have you tried so far?
    $endgroup$
    – Hugh
    Apr 13 at 11:26










  • $begingroup$
    The plot is an issue when I have very large number of pairs like 1000 pairs. I am trying to do it using ListPlot and a Do loop but it does not work. I am doing: ListLinePlot[Do[Print[acc[[i]], Count[a[[i]]], i, 10]] but it only prints the pairs for me with an empty plot.
    $endgroup$
    – Hamza
    Apr 13 at 12:04










  • $begingroup$
    Your combined use of Do and Print doesn't do what you expect. Print merely prints to the screen but does not build a list; use Table instead. Also, Count is something else.
    $endgroup$
    – Roman
    Apr 13 at 16:29















2












$begingroup$


I have a list, say it is



a = 1,3,3.2,3.9,4,4.4,4.9,5,7,8


To get the accumulate:



acc = Accumlate[a]


I want to plot the number of elements less than or equal to a certain element against the accumulated value of the list elements.
The pairs should look like (acc[[i]], number of elements less than a[[i]]). For instance, (1, 1), (4, 2), (7.2,3), etc.



Then I want to take the derivative of the plot to plot it as well.










share|improve this question











$endgroup$







  • 1




    $begingroup$
    The plotting is not a problem see ListPlot. Also, if you want a derivative you will have to define this as you don't have a continuous function. What have you tried so far?
    $endgroup$
    – Hugh
    Apr 13 at 11:26










  • $begingroup$
    The plot is an issue when I have very large number of pairs like 1000 pairs. I am trying to do it using ListPlot and a Do loop but it does not work. I am doing: ListLinePlot[Do[Print[acc[[i]], Count[a[[i]]], i, 10]] but it only prints the pairs for me with an empty plot.
    $endgroup$
    – Hamza
    Apr 13 at 12:04










  • $begingroup$
    Your combined use of Do and Print doesn't do what you expect. Print merely prints to the screen but does not build a list; use Table instead. Also, Count is something else.
    $endgroup$
    – Roman
    Apr 13 at 16:29













2












2








2





$begingroup$


I have a list, say it is



a = 1,3,3.2,3.9,4,4.4,4.9,5,7,8


To get the accumulate:



acc = Accumlate[a]


I want to plot the number of elements less than or equal to a certain element against the accumulated value of the list elements.
The pairs should look like (acc[[i]], number of elements less than a[[i]]). For instance, (1, 1), (4, 2), (7.2,3), etc.



Then I want to take the derivative of the plot to plot it as well.










share|improve this question











$endgroup$




I have a list, say it is



a = 1,3,3.2,3.9,4,4.4,4.9,5,7,8


To get the accumulate:



acc = Accumlate[a]


I want to plot the number of elements less than or equal to a certain element against the accumulated value of the list elements.
The pairs should look like (acc[[i]], number of elements less than a[[i]]). For instance, (1, 1), (4, 2), (7.2,3), etc.



Then I want to take the derivative of the plot to plot it as well.







plotting list-manipulation






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 at 16:26









Roman

5,56111131




5,56111131










asked Apr 13 at 11:22









HamzaHamza

225




225







  • 1




    $begingroup$
    The plotting is not a problem see ListPlot. Also, if you want a derivative you will have to define this as you don't have a continuous function. What have you tried so far?
    $endgroup$
    – Hugh
    Apr 13 at 11:26










  • $begingroup$
    The plot is an issue when I have very large number of pairs like 1000 pairs. I am trying to do it using ListPlot and a Do loop but it does not work. I am doing: ListLinePlot[Do[Print[acc[[i]], Count[a[[i]]], i, 10]] but it only prints the pairs for me with an empty plot.
    $endgroup$
    – Hamza
    Apr 13 at 12:04










  • $begingroup$
    Your combined use of Do and Print doesn't do what you expect. Print merely prints to the screen but does not build a list; use Table instead. Also, Count is something else.
    $endgroup$
    – Roman
    Apr 13 at 16:29












  • 1




    $begingroup$
    The plotting is not a problem see ListPlot. Also, if you want a derivative you will have to define this as you don't have a continuous function. What have you tried so far?
    $endgroup$
    – Hugh
    Apr 13 at 11:26










  • $begingroup$
    The plot is an issue when I have very large number of pairs like 1000 pairs. I am trying to do it using ListPlot and a Do loop but it does not work. I am doing: ListLinePlot[Do[Print[acc[[i]], Count[a[[i]]], i, 10]] but it only prints the pairs for me with an empty plot.
    $endgroup$
    – Hamza
    Apr 13 at 12:04










  • $begingroup$
    Your combined use of Do and Print doesn't do what you expect. Print merely prints to the screen but does not build a list; use Table instead. Also, Count is something else.
    $endgroup$
    – Roman
    Apr 13 at 16:29







1




1




$begingroup$
The plotting is not a problem see ListPlot. Also, if you want a derivative you will have to define this as you don't have a continuous function. What have you tried so far?
$endgroup$
– Hugh
Apr 13 at 11:26




$begingroup$
The plotting is not a problem see ListPlot. Also, if you want a derivative you will have to define this as you don't have a continuous function. What have you tried so far?
$endgroup$
– Hugh
Apr 13 at 11:26












$begingroup$
The plot is an issue when I have very large number of pairs like 1000 pairs. I am trying to do it using ListPlot and a Do loop but it does not work. I am doing: ListLinePlot[Do[Print[acc[[i]], Count[a[[i]]], i, 10]] but it only prints the pairs for me with an empty plot.
$endgroup$
– Hamza
Apr 13 at 12:04




$begingroup$
The plot is an issue when I have very large number of pairs like 1000 pairs. I am trying to do it using ListPlot and a Do loop but it does not work. I am doing: ListLinePlot[Do[Print[acc[[i]], Count[a[[i]]], i, 10]] but it only prints the pairs for me with an empty plot.
$endgroup$
– Hamza
Apr 13 at 12:04












$begingroup$
Your combined use of Do and Print doesn't do what you expect. Print merely prints to the screen but does not build a list; use Table instead. Also, Count is something else.
$endgroup$
– Roman
Apr 13 at 16:29




$begingroup$
Your combined use of Do and Print doesn't do what you expect. Print merely prints to the screen but does not build a list; use Table instead. Also, Count is something else.
$endgroup$
– Roman
Apr 13 at 16:29










2 Answers
2






active

oldest

votes


















1












$begingroup$

Assuming that there are no duplicate elements in the list, and that the list is sorted in ascending order:



ListLinePlot[Transpose[Accumulate[a], Range[Length[a]]]]


If the list isn't sorted, you should replace Accumulate[a] with Accumulate[Sort[a]].



enter image description here



If you need the derivative, it may be easier to first construct an interpolating function. Here I make the interpolation linear (InterpolationOrder -> 1) but you can change this. You can get the above plot with Plot[b[x], x, 1, Total[a]] and the first-derivative plot with



b = Interpolation[Transpose[Accumulate[Sort[a]], Range[Length[a]]], 
InterpolationOrder -> 1];
Plot[b'[x], x, 1, Total[a]]


enter image description here






share|improve this answer











$endgroup$




















    3












    $begingroup$

    try this



    a = 1, 3, 3.2, 3.9, 4, 4.4, 4.9, 5, 7, 8;
    acc = Accumulate@a;
    aa[x_] := Length@Select[a, # <= a[[x]] &];
    list = Transpose[acc, aa /@ Range@Length@a]
    ListLinePlot@list



    1,1,4,2,7.2,3,11.1,4,15.1,5,19.5,6,24.4,7,29.4,8,36.4,9,44.4,10




    enter image description here






    share|improve this answer











    $endgroup$












    • $begingroup$
      The y-axis should represent the number of elements less than or equal a[[i]] not the element itself.
      $endgroup$
      – Hamza
      Apr 13 at 13:57










    • $begingroup$
      @Hamza fixed....
      $endgroup$
      – J42161217
      Apr 13 at 14:12











    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "387"
    ;
    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: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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/3.0/"u003ecc by-sa 3.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%2fmathematica.stackexchange.com%2fquestions%2f195111%2fhow-to-construct-and-plot-the-following-accumulated-list%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1












    $begingroup$

    Assuming that there are no duplicate elements in the list, and that the list is sorted in ascending order:



    ListLinePlot[Transpose[Accumulate[a], Range[Length[a]]]]


    If the list isn't sorted, you should replace Accumulate[a] with Accumulate[Sort[a]].



    enter image description here



    If you need the derivative, it may be easier to first construct an interpolating function. Here I make the interpolation linear (InterpolationOrder -> 1) but you can change this. You can get the above plot with Plot[b[x], x, 1, Total[a]] and the first-derivative plot with



    b = Interpolation[Transpose[Accumulate[Sort[a]], Range[Length[a]]], 
    InterpolationOrder -> 1];
    Plot[b'[x], x, 1, Total[a]]


    enter image description here






    share|improve this answer











    $endgroup$

















      1












      $begingroup$

      Assuming that there are no duplicate elements in the list, and that the list is sorted in ascending order:



      ListLinePlot[Transpose[Accumulate[a], Range[Length[a]]]]


      If the list isn't sorted, you should replace Accumulate[a] with Accumulate[Sort[a]].



      enter image description here



      If you need the derivative, it may be easier to first construct an interpolating function. Here I make the interpolation linear (InterpolationOrder -> 1) but you can change this. You can get the above plot with Plot[b[x], x, 1, Total[a]] and the first-derivative plot with



      b = Interpolation[Transpose[Accumulate[Sort[a]], Range[Length[a]]], 
      InterpolationOrder -> 1];
      Plot[b'[x], x, 1, Total[a]]


      enter image description here






      share|improve this answer











      $endgroup$















        1












        1








        1





        $begingroup$

        Assuming that there are no duplicate elements in the list, and that the list is sorted in ascending order:



        ListLinePlot[Transpose[Accumulate[a], Range[Length[a]]]]


        If the list isn't sorted, you should replace Accumulate[a] with Accumulate[Sort[a]].



        enter image description here



        If you need the derivative, it may be easier to first construct an interpolating function. Here I make the interpolation linear (InterpolationOrder -> 1) but you can change this. You can get the above plot with Plot[b[x], x, 1, Total[a]] and the first-derivative plot with



        b = Interpolation[Transpose[Accumulate[Sort[a]], Range[Length[a]]], 
        InterpolationOrder -> 1];
        Plot[b'[x], x, 1, Total[a]]


        enter image description here






        share|improve this answer











        $endgroup$



        Assuming that there are no duplicate elements in the list, and that the list is sorted in ascending order:



        ListLinePlot[Transpose[Accumulate[a], Range[Length[a]]]]


        If the list isn't sorted, you should replace Accumulate[a] with Accumulate[Sort[a]].



        enter image description here



        If you need the derivative, it may be easier to first construct an interpolating function. Here I make the interpolation linear (InterpolationOrder -> 1) but you can change this. You can get the above plot with Plot[b[x], x, 1, Total[a]] and the first-derivative plot with



        b = Interpolation[Transpose[Accumulate[Sort[a]], Range[Length[a]]], 
        InterpolationOrder -> 1];
        Plot[b'[x], x, 1, Total[a]]


        enter image description here







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 13 at 16:30

























        answered Apr 13 at 16:18









        RomanRoman

        5,56111131




        5,56111131





















            3












            $begingroup$

            try this



            a = 1, 3, 3.2, 3.9, 4, 4.4, 4.9, 5, 7, 8;
            acc = Accumulate@a;
            aa[x_] := Length@Select[a, # <= a[[x]] &];
            list = Transpose[acc, aa /@ Range@Length@a]
            ListLinePlot@list



            1,1,4,2,7.2,3,11.1,4,15.1,5,19.5,6,24.4,7,29.4,8,36.4,9,44.4,10




            enter image description here






            share|improve this answer











            $endgroup$












            • $begingroup$
              The y-axis should represent the number of elements less than or equal a[[i]] not the element itself.
              $endgroup$
              – Hamza
              Apr 13 at 13:57










            • $begingroup$
              @Hamza fixed....
              $endgroup$
              – J42161217
              Apr 13 at 14:12















            3












            $begingroup$

            try this



            a = 1, 3, 3.2, 3.9, 4, 4.4, 4.9, 5, 7, 8;
            acc = Accumulate@a;
            aa[x_] := Length@Select[a, # <= a[[x]] &];
            list = Transpose[acc, aa /@ Range@Length@a]
            ListLinePlot@list



            1,1,4,2,7.2,3,11.1,4,15.1,5,19.5,6,24.4,7,29.4,8,36.4,9,44.4,10




            enter image description here






            share|improve this answer











            $endgroup$












            • $begingroup$
              The y-axis should represent the number of elements less than or equal a[[i]] not the element itself.
              $endgroup$
              – Hamza
              Apr 13 at 13:57










            • $begingroup$
              @Hamza fixed....
              $endgroup$
              – J42161217
              Apr 13 at 14:12













            3












            3








            3





            $begingroup$

            try this



            a = 1, 3, 3.2, 3.9, 4, 4.4, 4.9, 5, 7, 8;
            acc = Accumulate@a;
            aa[x_] := Length@Select[a, # <= a[[x]] &];
            list = Transpose[acc, aa /@ Range@Length@a]
            ListLinePlot@list



            1,1,4,2,7.2,3,11.1,4,15.1,5,19.5,6,24.4,7,29.4,8,36.4,9,44.4,10




            enter image description here






            share|improve this answer











            $endgroup$



            try this



            a = 1, 3, 3.2, 3.9, 4, 4.4, 4.9, 5, 7, 8;
            acc = Accumulate@a;
            aa[x_] := Length@Select[a, # <= a[[x]] &];
            list = Transpose[acc, aa /@ Range@Length@a]
            ListLinePlot@list



            1,1,4,2,7.2,3,11.1,4,15.1,5,19.5,6,24.4,7,29.4,8,36.4,9,44.4,10




            enter image description here







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 13 at 14:12

























            answered Apr 13 at 12:45









            J42161217J42161217

            4,573324




            4,573324











            • $begingroup$
              The y-axis should represent the number of elements less than or equal a[[i]] not the element itself.
              $endgroup$
              – Hamza
              Apr 13 at 13:57










            • $begingroup$
              @Hamza fixed....
              $endgroup$
              – J42161217
              Apr 13 at 14:12
















            • $begingroup$
              The y-axis should represent the number of elements less than or equal a[[i]] not the element itself.
              $endgroup$
              – Hamza
              Apr 13 at 13:57










            • $begingroup$
              @Hamza fixed....
              $endgroup$
              – J42161217
              Apr 13 at 14:12















            $begingroup$
            The y-axis should represent the number of elements less than or equal a[[i]] not the element itself.
            $endgroup$
            – Hamza
            Apr 13 at 13:57




            $begingroup$
            The y-axis should represent the number of elements less than or equal a[[i]] not the element itself.
            $endgroup$
            – Hamza
            Apr 13 at 13:57












            $begingroup$
            @Hamza fixed....
            $endgroup$
            – J42161217
            Apr 13 at 14:12




            $begingroup$
            @Hamza fixed....
            $endgroup$
            – J42161217
            Apr 13 at 14:12

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Mathematica Stack Exchange!


            • 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.

            Use MathJax to format equations. MathJax reference.


            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%2fmathematica.stackexchange.com%2fquestions%2f195111%2fhow-to-construct-and-plot-the-following-accumulated-list%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

            getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

            Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

            Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.