Error Bar Matlab Log Scale
Contents |
Support Answers MathWorks Search MathWorks.com MathWorks Answers Support MATLAB Answers™ MATLAB Central Community Home MATLAB Answers File Exchange Cody Blogs
Matlab Log Scale Bar Plot
Newsreader Link Exchange ThingSpeak Anniversary Home Ask Answer Browse More Contributors error bar matlab bar graph Recent Activity Flagged Content Flagged as Spam Help MATLAB Central Community Home MATLAB Answers File Exchange Cody
Shaded Error Bar Matlab
Blogs Newsreader Link Exchange ThingSpeak Anniversary Home Ask Answer Browse More Contributors Recent Activity Flagged Content Flagged as Spam Help Trial software MathWorks Support Team (view profile) 13,593 horizontal error bar matlab questions 13,593 answers 13,592 accepted answers Reputation: 2,574 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,593 questions 13,593 answers 13,592 accepted answers Reputation: 2,574 on 27 Jun 2009 Latest activity Commented on by Ohad BarSimanTov Ohad BarSimanTov (view scatter error bar matlab profile) 0 questions 0 answers 0 accepted answers Reputation: 0 on 27 Jul 2016 Accepted Answer by MathWorks Support Team MathWorks Support Team (view profile) 13,593 questions 13,593 answers 13,592 accepted answers Reputation: 2,574 227 views (last 30 days) 227 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])
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 Home Ask Answer Browse More Contributors Recent
Matlab Log Scale Contour Plot
Activity Flagged Content Flagged as Spam Help MATLAB Central Community Home MATLAB Answers File matlab log scale histogram Exchange Cody Blogs Newsreader Link Exchange ThingSpeak Anniversary Home Ask Answer Browse More Contributors Recent Activity Flagged Content Flagged as
Matlab Log Scale Vector
Spam Help Trial software Adam Goldsmith (view profile) 3 questions 0 answers 0 accepted answers Reputation: 1 Vote1 How do I get working y-axis errorbars using a log scale? Asked by Adam Goldsmith Adam https://www.mathworks.com/matlabcentral/answers/99844-how-can-i-use-the-errorbar-function-with-a-logarithmic-axis-in-matlab Goldsmith (view profile) 3 questions 0 answers 0 accepted answers Reputation: 1 on 8 Sep 2015 Latest activity Answered by Mike Garrity Mike Garrity (view profile) 0 questions 370 answers 198 accepted answers Reputation: 1,170 on 8 Sep 2015 81 views (last 30 days) 81 views (last 30 days) I'm trying to plot data on a semilog plot (y-axis: log, x-axis: linear), but the errorbars are seriously https://www.mathworks.com/matlabcentral/answers/241261-how-do-i-get-working-y-axis-errorbars-using-a-log-scale screwed up.All I'm doing is loading my data and entering:figure errorbar(hp_v3,hp_D0,hp_D0_,'ok') set(gca,'YScale','log') where hp_D0_ is the vector of uncertainty values for vector hp_D0. This results in the plot attached as an image, which obviously isn't working.I've also tried errrobarlogy, which produces literally the same plot. Any ideas? 0 Comments Show all comments Tags semilogyploterrorbarerrorbarlogyfigures Products MATLAB Related Content 1 Answer Mike Garrity (view profile) 0 questions 370 answers 198 accepted answers Reputation: 1,170 Vote1 Link Direct link to this answer: https://www.mathworks.com/matlabcentral/answers/241261#answer_191705 Answer by Mike Garrity Mike Garrity (view profile) 0 questions 370 answers 198 accepted answers Reputation: 1,170 on 8 Sep 2015 That looks like what happens if the bottom of the errorbar is negative.What do you get if you do this:h = errorbar(hp_v3,hp_D0,hp_D0_,'ok'); h.YData - h.LData Are the resulting values negative?If so, what's happening is that the log transform of the negative value results in a complex value which it can't transform to a point on the screen.Here's an attempt to recreate your data:rng default hp_v3 = 986:1002 hp_D0 = 1e-4*rand(1,17); hp_D0_ = 1e-4*randn(1,17); h = errorbar(hp_v3,hp_D0,hp_D0_,'ok') set(gca,'YScale','log'); We can tweak the LData to stay positive like this:ylim manual h.LData = h.YData - max(eps,h.YData-h.LData); 0 Comments Show all comme
toolboxes, and other File Exchange content using Add-On Explorer in MATLAB. » Watch video Highlights from errorbarlogx.m errorbarlogx(epsilon)ERRORBARLOGX Homogenize the error bars for X-axis in log https://www.mathworks.com/matlabcentral/fileexchange/9715-errorbarlogx-m scale. View all files Join the 15-year community celebration. Play games http://stackoverflow.com/questions/4393868/plotting-errorbars-in-the-logarithmic-domain-with-negative-values-matlab and win prizes! » Learn more 4.95238 5.0 | 21 ratings Rate this file 17 Downloads (last 30 days) File Size: 2.04 KB File ID: #9715 Version: 1.0 errorbarlogx.m by Frederic Moisy Frederic Moisy (view profile) 14 files 323 downloads 4.25151 21 Jan 2006 (Updated error bar 24 Jan 2006) Error bar plot for X-axis in log scale | Watch this File File Information Description ERRORBARLOGX Homogenize the error bars for X-axis in log scale. ERRORBARLOGX turns the X-axis of the current error bar plot to log scale, and homogonizes the length of the horizontal segements which terminate the vertical error bars. By default, error bar matlab Matlab's ERRORBAR draws vertical error bars which are terminated by small horizontal segments of uniform length for the X-axis in linear scale. But when turning the X-axis to log scale, these segments become uneven. Using ERRORBARLOGX makes them uniform again. ERRORBARLOGX(N) specifies the relative length of the horizontal segments, normalized with the total range of the data. By default, N=0.01 is used. Limitations: ERRORBARLOGX acts only on the last drawn curve. If this curve is not an error bar plot, it won't work. Example: x=logspace(1,3,20); y=5*(1 + 0.5*(rand(1,20)-0.5)).*x.^(-2); errorbar(x,y,y/2,'o-'); errorbarlogx(0.03); Acknowledgements This file inspired Eb Ticklength, Errorbarlogy, and Superbar. MATLAB release MATLAB 7.0.1 (R14SP1) Tags for This File Please login to tag files. error bar plotgraph typesgraphicslog scaleplottingspecializedxaxis Cancel Please login to add a comment or rating. Comments and Ratings (24) 03 Dec 2015 Mario Koddenbrock Mario Koddenbrock (view profile) 0 files 0 downloads 0.0 04 Apr 2015 Sergei Paleichuk Sergei Paleichuk (view profile) 0 files 0 downloads 0.0 15 Oct 2012 Emily Emily (view pr
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 about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Plotting errorbars in the logarithmic domain with negative values (Matlab) up vote 3 down vote favorite 1 I have a vector, call it x, which contains very small numbers that I calculated from a mean. I'd like to plot the logarithmic transform of x, say y=10*log10(x), along with errorbars equal to +- 2 standard deviations calculated when finding the mean. To do this, I'm using the following code: figure errorbar(lengths, 10*log10(x), ... 10*log10(x-2*std_x), 10*log10(x+2*std_x), 'o') My problem is that since x contains such small values, x-2*std_x is usually a negative number, and you can't take the log of negative numbers. So I suppose my question is how can I plot errorbars in the logarithmic domain when subtracting the standard deviation in the linear domain gives me negative numbers? I can't do the +- matlab plot logarithm share|improve this question edited May 4 '12 at 23:42 CharlesB 42.2k11117136 asked Dec 9 '10 at 0:49 Josiah 3891822 this also means that the error bar meaning isn't quite right - the error bars assume a gaussian distribution, and nonnegativity means that it's not gaussian. but I still understand why you would do this, and it's still reasonable :) –Peter Dec 9 '10 at 1:05 add a comment| 3 Answers 3 active oldest votes up