COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Plotyy barplot with standard deviation

• Email
• Follow

```Hi everybody

I have been trying to make  a barplot with two y-axes. I have two dataseries y1 and y2 that I want to plot and at the same time I want to have the standard deviations e1 and e2 of the dataseries y1 and y2 to be shown. I have used the code under consisting of two function files input1(x,y1,e1) and input2(x2,y2,e2). I can make a bar plot with two y-axes. The green bar shows the y1 dataserie and the blue bar shows y2. Only the standard deviation of y1 is shown. Somehow I cannot get the standard deviation of the blue bar to be shown? I also tried to put the errorbar plot in the function files, but it did not work for me. When I search on the newsgroup I have not been able to find any solution. It seems like it is something not many have tried before.

Best Regards

Jens

x=1:3
x2=4:6
y1=[10 20 30]
y2=[200 300 300]
y=[y2 y1]

e1=[1 3 4]
e2=[10 20 10]
std=[1 2 3 10 20 20]

[AX,H1,H2]=plotyy(x,y1,x+length(x),y2,input1(x,y1,e1),input2(x2,y2,e2))
ylim(AX(1), [0 50]);
ylim(AX(2), [0 350]);
set(H1,'FaceColor','g');
set(H2,'FaceColor','b');
set(AX(1),'YColor','g')
set(AX(2),'YColor','b')
hold on
H1=errorbar(1:3,y1,std(1:3),'+r')
hold on
H2=errorbar(4:6,y2,std(4:6),'+r')

function [f1]=input1(x,y1,e1)

f1 = @(x, y) bar(x, y1,0.6,'group');
end

function [f3]=input2(x2,y2,e2)

f3 = @(x2, y2) bar(x2, y2,0.6,'group');
end
```
 0

See related articles to this posting

```"jens " <storebonghoved@hotmail.com> wrote in message <hqfkck\$c3m\$1@fred.mathworks.com>...
> Hi everybody
>
> I have been trying to make  a barplot with two y-axes. I have two dataseries y1 and y2 that I want to plot and at the same time I want to have the standard deviations e1 and e2 of the dataseries y1 and y2 to be shown. I have used the code under consisting of two function files input1(x,y1,e1) and input2(x2,y2,e2). I can make a bar plot with two y-axes. The green bar shows the y1 dataserie and the blue bar shows y2. Only the standard deviation of y1 is shown. Somehow I cannot get the standard deviation of the blue bar to be shown? I also tried to put the errorbar plot in the function files, but it did not work for me. When I search on the newsgroup I have not been able to find any solution. It seems like it is something not many have tried before.
>
> Best Regards
>
> Jens
>
> x=1:3
> x2=4:6
> y1=[10 20 30]
> y2=[200 300 300]
> y=[y2 y1]
>
> e1=[1 3 4]
> e2=[10 20 10]
> std=[1 2 3 10 20 20]
>
> [AX,H1,H2]=plotyy(x,y1,x+length(x),y2,input1(x,y1,e1),input2(x2,y2,e2))
> ylim(AX(1), [0 50]);
> ylim(AX(2), [0 350]);
> set(H1,'FaceColor','g');
> set(H2,'FaceColor','b');
> set(AX(1),'YColor','g')
> set(AX(2),'YColor','b')
> hold on
> H1=errorbar(1:3,y1,std(1:3),'+r')
> hold on
> H2=errorbar(4:6,y2,std(4:6),'+r')
>
>
>
> function [f1]=input1(x,y1,e1)
>
> f1 = @(x, y) bar(x, y1,0.6,'group');
> end
>
>
> function [f3]=input2(x2,y2,e2)
>
> f3 = @(x2, y2) bar(x2, y2,0.6,'group');
> end

Hi Everybody

Is there not anybody that can help me?I have really tried many options, but nothing works. I optimized my code, but I still cannot get the standard deviation of the blue bars to be shown? There must be someone that knows how to fix maybe the axes handle or what is needed?

Best Regards

Jens

x=1:3
x2=4:6
y1=[10 20 30]
y2=[200 300 300]
y=[y2 y1]

e1=[1 3 4]
e2=[10 20 10]
std=[1 2 3 10 20 20]

[AX,H1,H2]=plotyy(x,y1,x+length(x),y2,input3(x2,y2,x,y))%input1(x,y1,e1),input2(x2,y2,e2))
hold on

Max=round(max(y1))+5
Max1=round(max(y2))+50
ylim(AX(1), [0 Max]);
ylim(AX(2), [0 Max1]);
set(H1,'FaceColor','g');
set(H2,'FaceColor','b');
set(AX(1),'YColor','g')
set(AX(2),'YColor','b')
set(AX,'XGrid','on')
set(AX,'YGrid','on')
H1(1)=errorbar(1:3,y1,std(1:3),'+k')
hold on
H2(1)=errorbar(4:6,y2,std(4:6),'+k')

function [f5,f6]=input3(x2,y2,x,y)

f5 = @(x2, y2) bar(x2, y2,0.6,'group');

f6 = @(x, y) bar(x, y1,0.6,'group');

end
```
 0

1 Replies
306 Views

Similar Articles

11/30/2013 7:58:02 PM
page loaded in 29582 ms. (0)

Similar Artilces:

Hole GAS (DIN standard)
Hi, why holes gas are quoted with M symbol and the relative value diameter in millimeter and not ex. GAS 1/4 as callout note ? And also replacing the M with G, at the next rebuild returns the symbol of metric thread ? Exist a workaround ? Alessandro Explain GAS??? TOP ha scritto: > Explain GAS??? > Hi TOP, when I use 'Straight pipe tapped hole' as hole wizard type in the DIN Standard. Alessandro GAZ is a French type threaded connection. http://www.malonespecialtyinc.com/tech.htm Bill "TOP" <kellnerp@cbd.net> wrote in message news:1139024631.373696.201030@f14g2000cwb.googlegroups.com... > Explain GAS??? > One more example GAZ. http://laduainc.com/Sum/Catalog/06ThDt/60TchDt.pdf Bill "TOP" <kellnerp@cbd.net> wrote in message news:1139024631.373696.201030@f14g2000cwb.googlegroups.com... > Explain GAS??? > THANKS.

Standard verses extended rule
I am using a C3640 12.3(11)t to route 130 PC's out to corporate WAN. NAT uses standard rule. Would I benifit by removing standard rule and NAT using extended rule, and what would these benefits be. Router is equipped with and is running Firewall feature set. IPS is active. I am not sure how standard vs extended rules effect firewall or overall routing performance. Router currently averages 15% CPU and Mem usage averages 35%. Thanks in advance. In article <%A6Rd.920\$OU1.61@newssvr21.news.prodigy.com>, stormrunner'_removethis'@comcast.net says... > I am using a C3640 12.3(11)t to route 130 PC's out to corporate WAN. NAT > uses standard rule. Would I benifit by removing standard rule and NAT using > extended rule, and what would these benefits be. Router is equipped with and > is running Firewall feature set. IPS is active. I am not sure how standard > vs extended rules effect firewall or overall routing performance. Router > currently averages 15% CPU and Mem usage averages 35%. > Let's say like this: if you don't know if you would benifit from extended rule versus standard, then you probably don't need

Latest standard after C99?
Hi, Is there any latest standard available after C99? Srinivas On 2010-05-01, Srinu wrote: > Is there any latest standard available after C99? No. -- Unix is simple. It just takes a genius to understand its simplicity --Dennis M. Ritchie Vivien MOREAU <vpm+news@serengetty.fr> writes: > On 2010-05-01, Srinu wrote: > >> Is there any latest standard available after C99? > > No. That's at least debatable! C99 was modified by three technical corrigenda so one could argue that the current standard is C99+TC1+TC2+TC3. You can read it at: http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf The changes are relatively small and it's certainly not wrong to say C99 is latest standard. -- Ben. On Sat, 1 May 2010 04:06:47 -0700 (PDT) Srinu <sinu.nayak2001@gmail.com> wrote: > Hi, > > Is there any latest standard available after C99? > > Srinivas There's the C1X Charter http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1250.pdf I'm cross-posting this to comp.lang.c and comp.std.c. Lorenzo Villari <vlllnz@tiscali.it> writes: > On Sat, 1 May 2010

Assigned gotos in standard C
too critical. In that case, the simplest C solution is to use a switch statement inside a loop. The switch index will be k, ranging from 0 to N, and the labels just become case labels. Calling functions (ie. calling then returning) from a dispatch loop, via a function table indexed by k, is another standard way. Putting each handler into it's own function is better than having a single giant function. For minimal overheads, you might need to use assembly code, but it gets fiddly. And non-portable. -- bartc "Adam" <adam.antonik@gmail.com> wrote

ISO standard BNF
There is an ISO standard EBNF (ISO/IEC 14977:1996(E), see http://www.cl.cam.ac.uk/~mgk25/iso-14977.pdf). It contains some unhappy features, such as the iuse of , as a concatenation operator and allowing nonterminal names with spaces in them. Has anybody ever used this version of EBNF, or ever seen it used in a book or paper? Adrian -- Dr Adrian Johnstone, Senior Lecturer in Computing, Computer Science Dep, Royal Holloway, University of London, Egham, Surrey, TW20 0EX, England. Email a.johnstone@rhul.ac.uk Tel:+44(0)1784 443425 Fax:+44(0)1784 439786 A Johnstone <adrian@sartre.cs.rhbnc.ac.uk> writes: > There is an ISO standard EBNF (ISO/IEC 14977:1996(E), see > http://www.cl.cam.ac.uk/~mgk25/iso-14977.pdf). > It contains some unhappy features, such as the use of , as > a concatenation operator and allowing nonterminal names with > spaces in them. Agreed. I never use spaces inside nonterminal names (only _ if needed) in order to reduce confusion. The , as concatenator is not such a bad idea (after writing some ISO EBNF grammars). > Has anybody ever used this version of EBNF, Yes. > or ever seen it used in a book or paper

C Standard as part of C++
Hello group, To what extent is it necessary to have the C90 Standard, in addition to the C++ Standard, to have the complete, official reference to the C++ language? For example, I've noted that I can't find some C90 API function in the C++ Standard even though these functions are part of C++. In what other ways is it necessary for one to have the C90 Standard? Thanks to all, Dave [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] Dave Theese wrote: > Hello group, > > To what extent is it necessary to have the C90 Standard, in addition > to the C++ Standard, to have the complete, official reference to the > C++ language? > > For example, I've noted that I can't find some C90 API function in > the C++ Standard even though these functions are part of C++. > > In what other ways is it necessary for one to have the C90 Standard? IMHO yes. In 1.1 Scope [intro.scope] paragraph 2 Simon says: "C++ is a general purpose programming language based on the C programming language as described in ISO/IEC 9899:1990 Programming languages – C (1.2

Open standard(s) for browse info?
Are there (one or more) open, stable, widely supported formats for source browse information, i.e. recording the locations in source code where identifiers are defined and used? An open analogue to, say, Microsoft's .bsc as opposed to .pdb. I realise a browse format could be built around an open debug format like DWARF, but I was hoping to find something designed specifically for browsing and cross-referencing rather than general debugging. [I suppose there's the format of the tags file that emacs or vi uses. -John]

I have an .xri image file from Phillips Medical Systems. The format consists of a header (128 bytes), containing information about the pixel format in the file, and then the pixel data itself. There is no gap between the header and pixel data. I am trying to read the file byte by byte using fread but don't know how to convert pixel data bit into an image. For example, the pixels are 2 byte signed integer values. Please help!

New C Standard book updated
All, There is a new version of the pdf of my book "The New C Standard: An Economic and Cultural Commentary" available for download at: http://www.coding-guidelines.com/cbook/cbook1_1.pdf The changes include integrating in the defect reports published in TC3, 60+ more references to work published in the last 2.5 years (and in some cases stuff I missed last time around), some new measurements (plus tuning of a few of the previous tables/figures), plus various typos fixed. A list of non-trivial changes is here: http://www.coding-guidelines.com/cbook/newmaterial1_1.txt I have also stripped out the appropriate range of sentence commentaries as stand-alone pdfs and included them with the Google searchable C Standard at (it make take a week or two for Google to index the pdfs): http://c0x.coding-guidelines.com As always, comments welcome.

Reading from piped standard input on w2k
Hi all My question is related to both csharp and perl (sort of). I am trying to fork and exec a csharp program from perl and then feed input to the csharp. The problem I am having is that when I am trying to read from Console.In via Console.Readline the read call never returns even though I send \n at the end of the string. Any idea how to make this work ? Do you think the buffering on the perl side is the problem ? Yuri Yuri Shtil <shtil@comcast.net> wrote: > Do you think the buffering on the perl side > is the problem ? What happened when you turned autoflush on? (per

Come & get it 2... standard MOLD COMPONENT parts
I have finally finished uploading my mold component library. I didn't include everything though (I have tons more). After looking through my library folders, I realized that some of it was so old (probably SW99 or before) that they were out of date. What I mean by this, is that my methods have changed SO MUCH since then that I would be better off starting over on a lot of them to make a better model. My apologies for taking so long but I was slammed yesterday. I posted that they were there yesterday afternoon with a reply to the "Come & get it..." thread. But to make su

Text of Jim Welsh and Atholl Hay: A Model Implementation of Standard Pascal?
I have found this book recently (wanting it for years, bookfinder helped me find it in Germany, which is fine since I live in the Netherlands :) Jim Welsh and Atholl Hay: A Model Implementation of Standard Pascal, Prentice_Hall, 1986 Very interesting, a full Pascal compiler! Since the book in fact is the text of two programs: the ModelCompiler and the Pmachine, it would be nice to have this also as a file. Did anyone ever got this as a text file? (also asked in comp.lang.pascal.ansi-iso) Hans, http://www.hansotten.com Le 14/07/2004 04:31, Hans Otten a ecrit : > I have found this book recently (wanting it for years, bookfinder > helped me find it in Germany, which is fine since I live in the > Netherlands :) > > Jim Welsh and Atholl Hay: A Model Implementation of Standard Pascal, > Prentice_Hall, 1986 > > Very interesting, a full Pascal compiler! on my site a lot of links about pascal compilers with full source and a lot more without. > Since the book in fact is the text of two programs: the > ModelCompiler and the Pmachine, it would be nice to have this also > as a file. Did anyone ever got this as a text file? a friend and i typed

Z Word Tools now Support ISO Standard Z
I'm pleased to announce the release of Version 2.0 of the Z Word Tools. The main new feature in this release is that you can write ISO Standard Z and typecheck your specification using a built in interface to the Community Z Tools (http://czt.sourceforge.net/) typechecker. I'm very grateful to Tim Miller, of the CZT project, for help with this. Of course Z Word Tools continues to support Spivey Z using fuzz and there need be no change to existing documents. In addition there are other improvements especially for large specifications. The new version is available at http://sourceforge.net/projects/zwordtools/ where there are full release notes. I hope you find the new version useful. Please do let me know of any problems or comments Anthony On 21/03/2011 7:36 AM, AnthonyHall wrote: > I'm pleased to announce the release of Version 2.0 of the Z Word > Tools. Do you know of anyone working on any similar tools for OpenOffice.org Writer? On Mar 21, 9:44=A0pm, David Lamb <dal...@cs.queensu.ca> wrote: > On 21/03/2011 7:36 AM, AnthonyHall wrote: > > > I'm pleased to announce the release of Version 2.0 of the Z

Backing up data between SQL Express 2005 and SQL Server 2008 Standard Edition
Hi, I am developing an application which needs to backup data between SQL Express 2005 and SQL Server 2008. My client runs with an installation of SQL express 2005 and needs to periodically back up data to a server database running on SQL Server 2008. The client db also receives some new data from server and needs to update itself. The question is HOW. You can create a backup on SQL Server 2005 and restore on SQL Server 2008. But you cannot restore SQL Server 2008 backup to SQL Server 2005 (as the format is not backward compatible). The standard technique is to script table structure (if there are changes) and to export the data, then re-import on SQL Server 2005. You can also consider replication if only specific changes need to be replicated. -- Plamen Ratchev http://www.SQLStudio.com