Plotting Error Bars On A Log Scale
Contents |
Support Answers MathWorks Search MathWorks.com MathWorks Answers Support MATLAB Answers™ MATLAB Central Community Home MATLAB Answers File Exchange Cody Blogs Newsreader Link Exchange ThingSpeak Anniversary logarithmic error bars Home Ask Answer Browse More Contributors Recent Activity Flagged Content Flagged as logarithmic error propagation Spam Help MATLAB Central Community Home MATLAB Answers File Exchange Cody Blogs Newsreader Link Exchange ThingSpeak Anniversary Home
Error Bars On Log Scale Excel
Ask Answer Browse More Contributors Recent Activity Flagged Content Flagged as Spam Help Trial software MathWorks Support Team (view profile) 13,649 questions 13,649 answers 13,648 accepted answers Reputation: 2,644
Errorbarlogx
Vote0 How can I use the ERRORBAR function with a logarithmic axis in MATLAB? Asked by MathWorks Support Team MathWorks Support Team (view profile) 13,649 questions 13,649 answers 13,648 accepted answers Reputation: 2,644 on 27 Jun 2009 Latest activity Commented on by Ohad BarSimanTov Ohad BarSimanTov (view profile) 0 questions 0 answers 0 accepted answers Reputation: 0 on 27 Jul error bars on log graphs 2016 Accepted Answer by MathWorks Support Team MathWorks Support Team (view profile) 13,649 questions 13,649 answers 13,648 accepted answers Reputation: 2,644 324 views (last 30 days) 324 views (last 30 days) When I type the following at the MATLAB prompt, I get a an errorbar with a log x axis:x = 1:100; y = sin(x); e = std(y)*ones(size(x)); errorbar(x,y,e) set(gca,'xscale','log') However, the errorbars of the first point in the resulting figure extend much farther than the other errorbars. I would like a function that can account for the logrithmic X-axis and make all of the errorbars have a uniform width. 1 Comment Show all comments Ohad BarSimanTov Ohad BarSimanTov (view profile) 0 questions 0 answers 0 accepted answers Reputation: 0 on 27 Jul 2016 Direct link to this comment: https://www.mathworks.com/matlabcentral/answers/99844#comment_381798 This is what I got after using others comments, here and stack overflow.errorbar(X,Y,E,'bo','linewidth',2) c=get(gca,'Children'); for i=1:length(c); set(c(i),'XData',get(c(i),'YData'),'YData',get(c(i),'XData')); end; axis([10^-5 10^-3 0.4 1]) % This is just to set the (Y and X) axis (flipped) set(gca,'xscale','log'); % set X log scale view(-90, 90) % Swap the axes if you
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies
Logarithmic Error Calculation
of this site About Us Learn more about Stack Overflow the company standard error of log transformed data Business Learn more about hiring developers or posting ads with us Mathematica Questions Tags Users Badges Unanswered Ask error propagation log base 10 Question _ Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute: Sign up Here's how it works: Anybody can https://www.mathworks.com/matlabcentral/answers/99844-how-can-i-use-the-errorbar-function-with-a-logarithmic-axis-in-matlab ask a question Anybody can answer The best answers are voted up and rise to the top How to plot data with error bars on a log scale in Mathematica 9? up vote 1 down vote favorite 2 I have data in the form d={{x1,y1,dy1},{x2,y2,dy2},..{xn,yn,dyn}}; so the error bars are different for each coordinate pair. I want to plot on a http://mathematica.stackexchange.com/questions/49123/how-to-plot-data-with-error-bars-on-a-log-scale-in-mathematica-9 logarithmic x-scale. Since I use Mathematica 9 the old library from Mathematica 6 with Errorlogplot does not seem to work. Kind regards Benjamin plotting data share|improve this question edited Jun 4 '14 at 18:15 asked Jun 4 '14 at 17:36 neverender 234 add a comment| 1 Answer 1 active oldest votes up vote 3 down vote Try the ErrorBarLogPlots package, which you can download here: Throw it in the folder that opens after evaluating this: SystemOpen@FileNameJoin[{$UserBaseDirectory, "Applications"}] Then load the package in Mathematica and go: << ErrorBarLogPlots` ErrorListLogLogPlot[{{1, 2, 2}, {2, 3, 1}, {4, 4, 2.6}, {9.5, 12, 5}}, Frame -> True, PlotRangePadding -> 0.1] Other plots available in this package are: ErrorListLogLinearPlot ErrorListLogPlot share|improve this answer edited Jun 4 '14 at 18:05 answered Jun 4 '14 at 17:44 Sjoerd C. de Vries 51.4k10131256 I downloaded it here library.wolfram.com/infocenter/MathSource/6747 and did as you said. When I evaluate the notebook it says installation failed! Does not seem to work with Mathematica 9 + Windows 8 ( probably has nothing to do with windows 8). –neverender Jun 4 '14 a
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more http://mathematica.stackexchange.com/questions/3897/plotting-error-bars-on-a-log-scale about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Mathematica Questions Tags Users Badges Unanswered Ask Question _ Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to error bars the top Plotting Error Bars on a Log Scale up vote 30 down vote favorite 15 I have a plot with ErrorListPlot data = Sort@RandomReal[1, {10, 2}]; error = RandomReal[0.5, 10]; errorplot = ErrorListPlot[ Partition[Riffle[data, ErrorBar /@ error], 2], Joined -> True] However, I would like to have it with the y-axis on a log scale. I can use ListLogPlot to get the log scale but this doesn't plot error bars on the errorbars. logplot = ListLogPlot[ data, PlotRange -> All, AxesOrigin -> {0, 0}, Joined -> True ] I tried Show[logplot, errorplot, PlotRange->All] to see if it would plot with the scale and ticks from the logplot but that didn't work right: I also tried to take the Ticks from the logplot: Show[errorplot, Ticks -> Ticks /. AbsoluteOptions@logplot] but that just gives an error. I tried to manually take the log of the data and then grab the tick-marks but that didn't work right data = Sort@RandomReal[{10, 100}, {10, 2}]; error = RandomReal[20, 10]; logdata = Transpose[{data[[All, 1]], Log[10, data[[All, 2]]]}]; errorup = Log[10, data[[All, 2]] + error] - logdata[[All, 2]]; errordown = Log[10, data[[All, 2]] - error] - logdata[[All, 2]]; logerror = Log[10, error]; logplot = ListLogPlot[ data, Joined -> True, AxesOrigin -> {0, 0} ] errorlogplot = ErrorListPlot[ Partition[ Riffle[logdata, ErrorBar /@ Transpose[{errordown, errorup}]], 2], Joined -> True, AxesOrigin -> {0, 0} ] errorlogplot2 = ErrorListPlot[ Partition[ Riffle[logdata, ErrorBar /@ Transpose[{errordown, errorup}]], 2], Joined -> True, AxesOrigin -> {0, 0}, Ticks -> (Ticks /. AbsoluteOptions@logplot) ] Is there an easy way to do this? On the log scale the error bars will appear asymmetrical. graphics plotting share|improve this question edited Apr 4