ErrorListPlot crops error barsDefine function that behaves almost identically to Mathematica functionWhat's...

Ramanujan's radical and how we define an infinite nested radical

Why do climate experts from the UN/IPCC rarely mention Grand Solar Minimum?

'Dimension too large' error when setmathfont has the option Scale=MatchLowercase

How bad is a Computer Science course that doesn't teach Design Patterns?

Is Screenshot Time-tracking Common?

find command cannot find my files which do exist

How can I portray body horror and still be sensitive to people with disabilities?

Is it possible to detect 100% of SQLi with a simple regex?

What happens if you declare more than $10,000 at the US border?

How does Artisan's Blessing handle rusted and mistreated weapons?

Why don't reads from /dev/zero count as I/O?

QGIS 3.4.4 sorts numerical values as text, solution?

Is it ethical to apply for a job on someone's behalf?

Does a code with length 6, size 32 and distance 2 exist?

Rudeness by being polite

Father gets chickenpox, but doesn't infect his two children. How is this possible?

Was Opportunity's last message to Earth "My battery is low and it's getting dark"?

How can a kingdom keep the secret of a missing monarch from the public?

Why Third 'Reich'? Why is 'reich' not translated when 'third' is? What is the English synonym of reich?

MySQL: Is it a security risk to deactivate the setting "bind-address"?

Run a command that requires sudo after a time has passed

Should I prune double "trunk" of orange tree seedling?

How can changes in personality/values of a person who turned into a vampire be explained?

Can a planet be tidally unlocked?



ErrorListPlot crops error bars


Define function that behaves almost identically to Mathematica functionWhat's the simplest way to plot an ErrorListPlot with only y error bars?Including error bars on graph in MathematicaHow do I adjust error bar tick size with ErrorListPlot?Misalignment of plot points when adding error barsError bars in BarChart3DError bars from listsPlotting error bars in both dimensions for straight line modelBarChart with error barsHow to plot data as (X,Y) points with error bars on YHow to Plot Error Bars Without Caps using ErrorListPlot













1












$begingroup$


The default behaviour of ErrorListPlot often crops error bars, as in the example below. How can this be fixed in a clean way?



Needs["ErrorBarPlots`"];
data = Table[{{x, Cos[x]}, ErrorBar[Cos[x]^2]}, {x, 0, 2 Pi}];
plot = ErrorListPlot[data, PlotRangePadding -> Scaled[.05]]


The ErrorListPlot generated by the above code










share|improve this question









$endgroup$

















    1












    $begingroup$


    The default behaviour of ErrorListPlot often crops error bars, as in the example below. How can this be fixed in a clean way?



    Needs["ErrorBarPlots`"];
    data = Table[{{x, Cos[x]}, ErrorBar[Cos[x]^2]}, {x, 0, 2 Pi}];
    plot = ErrorListPlot[data, PlotRangePadding -> Scaled[.05]]


    The ErrorListPlot generated by the above code










    share|improve this question









    $endgroup$















      1












      1








      1


      1



      $begingroup$


      The default behaviour of ErrorListPlot often crops error bars, as in the example below. How can this be fixed in a clean way?



      Needs["ErrorBarPlots`"];
      data = Table[{{x, Cos[x]}, ErrorBar[Cos[x]^2]}, {x, 0, 2 Pi}];
      plot = ErrorListPlot[data, PlotRangePadding -> Scaled[.05]]


      The ErrorListPlot generated by the above code










      share|improve this question









      $endgroup$




      The default behaviour of ErrorListPlot often crops error bars, as in the example below. How can this be fixed in a clean way?



      Needs["ErrorBarPlots`"];
      data = Table[{{x, Cos[x]}, ErrorBar[Cos[x]^2]}, {x, 0, 2 Pi}];
      plot = ErrorListPlot[data, PlotRangePadding -> Scaled[.05]]


      The ErrorListPlot generated by the above code







      plotting






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 3 hours ago









      TomTom

      1,243919




      1,243919






















          2 Answers
          2






          active

          oldest

          votes


















          2












          $begingroup$

          Here is my solution. Calculate the value of each data point plus (and minus) it's error bar. Then you can calculate the location of the highest (and lowest) error bar. Then use this to specify the PlotRange.



          data = Table[{{x, Cos[x]}, ErrorBar[Cos[x]^2]}, {x, 0, 2 Pi}];
          minima = #[[1]][[2]] - #[[2]][[1]] & /@ data;
          maxima = #[[1]][[2]] + #[[2]][[1]] & /@ data;
          plot = ErrorListPlot[data, PlotRange -> {Min[minima], Max[maxima]}, PlotRangePadding -> Scaled[.05]]


          ErrorListPlot generated by the above code



          We can make a nice little function that we can use in a similar way to ErrorListPlot but takes care of the PlotRange automatically as we desired. The difference here is that other optional arguments have to be grouped together into a list. I'm sure there's a nicer way to do this with optional arguments, but I don't know how to implement it.



          errorListPlot[data_, opts_] := Module[{minima, maxima},
          minima = #[[1]][[2]] - #[[2]][[1]] & /@ data;
          maxima = #[[1]][[2]] + #[[2]][[1]] & /@ data;
          ErrorListPlot[data, PlotRange -> {Min[minima], Max[maxima]}, opts]
          ]

          data = Table[{{x, Cos[x]}, ErrorBar[Cos[x]^2]}, {x, 0, 2 Pi}];
          errorListPlot[data, {PlotRangePadding -> Scaled[.05], PlotStyle -> Red}]


          ErrorListPlot generated with custom 'errorListPlot' Module defined above






          share|improve this answer











          $endgroup$





















            2












            $begingroup$

            You can just Show plot with the option PlotRange -> All:



            Show[plot, PlotRange -> All]


            enter image description here



            Why?



            plot already contains full lines which you can see by looking at plot[[1]] which contains all the graphics directives and primitives:



            Graphics[plot[[1]]]


            enter image description here



            Somehow, the FrontEnd thinks displaying the cropped version is in some sense better. You can always override the rendering choices of the FrontEnd using Show with appropriate options.






            share|improve this answer











            $endgroup$













            • $begingroup$
              Much neater! I feel like a right mug now
              $endgroup$
              – Tom
              1 hour ago











            Your Answer





            StackExchange.ifUsing("editor", function () {
            return StackExchange.using("mathjaxEditing", function () {
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            });
            });
            }, "mathjax-editing");

            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%2f191880%2ferrorlistplot-crops-error-bars%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









            2












            $begingroup$

            Here is my solution. Calculate the value of each data point plus (and minus) it's error bar. Then you can calculate the location of the highest (and lowest) error bar. Then use this to specify the PlotRange.



            data = Table[{{x, Cos[x]}, ErrorBar[Cos[x]^2]}, {x, 0, 2 Pi}];
            minima = #[[1]][[2]] - #[[2]][[1]] & /@ data;
            maxima = #[[1]][[2]] + #[[2]][[1]] & /@ data;
            plot = ErrorListPlot[data, PlotRange -> {Min[minima], Max[maxima]}, PlotRangePadding -> Scaled[.05]]


            ErrorListPlot generated by the above code



            We can make a nice little function that we can use in a similar way to ErrorListPlot but takes care of the PlotRange automatically as we desired. The difference here is that other optional arguments have to be grouped together into a list. I'm sure there's a nicer way to do this with optional arguments, but I don't know how to implement it.



            errorListPlot[data_, opts_] := Module[{minima, maxima},
            minima = #[[1]][[2]] - #[[2]][[1]] & /@ data;
            maxima = #[[1]][[2]] + #[[2]][[1]] & /@ data;
            ErrorListPlot[data, PlotRange -> {Min[minima], Max[maxima]}, opts]
            ]

            data = Table[{{x, Cos[x]}, ErrorBar[Cos[x]^2]}, {x, 0, 2 Pi}];
            errorListPlot[data, {PlotRangePadding -> Scaled[.05], PlotStyle -> Red}]


            ErrorListPlot generated with custom 'errorListPlot' Module defined above






            share|improve this answer











            $endgroup$


















              2












              $begingroup$

              Here is my solution. Calculate the value of each data point plus (and minus) it's error bar. Then you can calculate the location of the highest (and lowest) error bar. Then use this to specify the PlotRange.



              data = Table[{{x, Cos[x]}, ErrorBar[Cos[x]^2]}, {x, 0, 2 Pi}];
              minima = #[[1]][[2]] - #[[2]][[1]] & /@ data;
              maxima = #[[1]][[2]] + #[[2]][[1]] & /@ data;
              plot = ErrorListPlot[data, PlotRange -> {Min[minima], Max[maxima]}, PlotRangePadding -> Scaled[.05]]


              ErrorListPlot generated by the above code



              We can make a nice little function that we can use in a similar way to ErrorListPlot but takes care of the PlotRange automatically as we desired. The difference here is that other optional arguments have to be grouped together into a list. I'm sure there's a nicer way to do this with optional arguments, but I don't know how to implement it.



              errorListPlot[data_, opts_] := Module[{minima, maxima},
              minima = #[[1]][[2]] - #[[2]][[1]] & /@ data;
              maxima = #[[1]][[2]] + #[[2]][[1]] & /@ data;
              ErrorListPlot[data, PlotRange -> {Min[minima], Max[maxima]}, opts]
              ]

              data = Table[{{x, Cos[x]}, ErrorBar[Cos[x]^2]}, {x, 0, 2 Pi}];
              errorListPlot[data, {PlotRangePadding -> Scaled[.05], PlotStyle -> Red}]


              ErrorListPlot generated with custom 'errorListPlot' Module defined above






              share|improve this answer











              $endgroup$
















                2












                2








                2





                $begingroup$

                Here is my solution. Calculate the value of each data point plus (and minus) it's error bar. Then you can calculate the location of the highest (and lowest) error bar. Then use this to specify the PlotRange.



                data = Table[{{x, Cos[x]}, ErrorBar[Cos[x]^2]}, {x, 0, 2 Pi}];
                minima = #[[1]][[2]] - #[[2]][[1]] & /@ data;
                maxima = #[[1]][[2]] + #[[2]][[1]] & /@ data;
                plot = ErrorListPlot[data, PlotRange -> {Min[minima], Max[maxima]}, PlotRangePadding -> Scaled[.05]]


                ErrorListPlot generated by the above code



                We can make a nice little function that we can use in a similar way to ErrorListPlot but takes care of the PlotRange automatically as we desired. The difference here is that other optional arguments have to be grouped together into a list. I'm sure there's a nicer way to do this with optional arguments, but I don't know how to implement it.



                errorListPlot[data_, opts_] := Module[{minima, maxima},
                minima = #[[1]][[2]] - #[[2]][[1]] & /@ data;
                maxima = #[[1]][[2]] + #[[2]][[1]] & /@ data;
                ErrorListPlot[data, PlotRange -> {Min[minima], Max[maxima]}, opts]
                ]

                data = Table[{{x, Cos[x]}, ErrorBar[Cos[x]^2]}, {x, 0, 2 Pi}];
                errorListPlot[data, {PlotRangePadding -> Scaled[.05], PlotStyle -> Red}]


                ErrorListPlot generated with custom 'errorListPlot' Module defined above






                share|improve this answer











                $endgroup$



                Here is my solution. Calculate the value of each data point plus (and minus) it's error bar. Then you can calculate the location of the highest (and lowest) error bar. Then use this to specify the PlotRange.



                data = Table[{{x, Cos[x]}, ErrorBar[Cos[x]^2]}, {x, 0, 2 Pi}];
                minima = #[[1]][[2]] - #[[2]][[1]] & /@ data;
                maxima = #[[1]][[2]] + #[[2]][[1]] & /@ data;
                plot = ErrorListPlot[data, PlotRange -> {Min[minima], Max[maxima]}, PlotRangePadding -> Scaled[.05]]


                ErrorListPlot generated by the above code



                We can make a nice little function that we can use in a similar way to ErrorListPlot but takes care of the PlotRange automatically as we desired. The difference here is that other optional arguments have to be grouped together into a list. I'm sure there's a nicer way to do this with optional arguments, but I don't know how to implement it.



                errorListPlot[data_, opts_] := Module[{minima, maxima},
                minima = #[[1]][[2]] - #[[2]][[1]] & /@ data;
                maxima = #[[1]][[2]] + #[[2]][[1]] & /@ data;
                ErrorListPlot[data, PlotRange -> {Min[minima], Max[maxima]}, opts]
                ]

                data = Table[{{x, Cos[x]}, ErrorBar[Cos[x]^2]}, {x, 0, 2 Pi}];
                errorListPlot[data, {PlotRangePadding -> Scaled[.05], PlotStyle -> Red}]


                ErrorListPlot generated with custom 'errorListPlot' Module defined above







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 2 hours ago

























                answered 3 hours ago









                TomTom

                1,243919




                1,243919























                    2












                    $begingroup$

                    You can just Show plot with the option PlotRange -> All:



                    Show[plot, PlotRange -> All]


                    enter image description here



                    Why?



                    plot already contains full lines which you can see by looking at plot[[1]] which contains all the graphics directives and primitives:



                    Graphics[plot[[1]]]


                    enter image description here



                    Somehow, the FrontEnd thinks displaying the cropped version is in some sense better. You can always override the rendering choices of the FrontEnd using Show with appropriate options.






                    share|improve this answer











                    $endgroup$













                    • $begingroup$
                      Much neater! I feel like a right mug now
                      $endgroup$
                      – Tom
                      1 hour ago
















                    2












                    $begingroup$

                    You can just Show plot with the option PlotRange -> All:



                    Show[plot, PlotRange -> All]


                    enter image description here



                    Why?



                    plot already contains full lines which you can see by looking at plot[[1]] which contains all the graphics directives and primitives:



                    Graphics[plot[[1]]]


                    enter image description here



                    Somehow, the FrontEnd thinks displaying the cropped version is in some sense better. You can always override the rendering choices of the FrontEnd using Show with appropriate options.






                    share|improve this answer











                    $endgroup$













                    • $begingroup$
                      Much neater! I feel like a right mug now
                      $endgroup$
                      – Tom
                      1 hour ago














                    2












                    2








                    2





                    $begingroup$

                    You can just Show plot with the option PlotRange -> All:



                    Show[plot, PlotRange -> All]


                    enter image description here



                    Why?



                    plot already contains full lines which you can see by looking at plot[[1]] which contains all the graphics directives and primitives:



                    Graphics[plot[[1]]]


                    enter image description here



                    Somehow, the FrontEnd thinks displaying the cropped version is in some sense better. You can always override the rendering choices of the FrontEnd using Show with appropriate options.






                    share|improve this answer











                    $endgroup$



                    You can just Show plot with the option PlotRange -> All:



                    Show[plot, PlotRange -> All]


                    enter image description here



                    Why?



                    plot already contains full lines which you can see by looking at plot[[1]] which contains all the graphics directives and primitives:



                    Graphics[plot[[1]]]


                    enter image description here



                    Somehow, the FrontEnd thinks displaying the cropped version is in some sense better. You can always override the rendering choices of the FrontEnd using Show with appropriate options.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited 2 hours ago

























                    answered 2 hours ago









                    kglrkglr

                    185k10202420




                    185k10202420












                    • $begingroup$
                      Much neater! I feel like a right mug now
                      $endgroup$
                      – Tom
                      1 hour ago


















                    • $begingroup$
                      Much neater! I feel like a right mug now
                      $endgroup$
                      – Tom
                      1 hour ago
















                    $begingroup$
                    Much neater! I feel like a right mug now
                    $endgroup$
                    – Tom
                    1 hour ago




                    $begingroup$
                    Much neater! I feel like a right mug now
                    $endgroup$
                    – Tom
                    1 hour ago


















                    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%2f191880%2ferrorlistplot-crops-error-bars%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

                    ORA-01691 (unable to extend lob segment) even though my tablespace has AUTOEXTEND onORA-01692: unable to...

                    Always On Availability groups resolving state after failover - Remote harden of transaction...

                    Circunscripción electoral de Guipúzcoa Referencias Menú de navegaciónLas claves del sistema electoral en...