Hi Everyone

I am using the plotyy command to create a graph with two y axes. Since there is no error bar command using this function I attempted to put hold on and plot overtop using the errorbar command and specifying which axes I wanted. It works fine for the first (left axis) but then on the second I get an error message.

??? Error using ==> get

Invalid handle object.

Error in ==> nextstyle at 23

co = get(ax,'ColorOrder');

Error in ==> errorbar at 101

[ls,c,m] = nextstyle(cax,autoColor,autoStyle,k==1);

Error in ==> gammapowergammacountcorr at 95

errorbar(Axis3(2),xaxisarray,meancounton(:),serr_counton(:),'go')

We traced this back to the fact that errorbar itself is not supposed to take axes commands as its first argument. Does anyone out there know how I could go about plotting error bars on my YY graph? Thanks in advance for any help that can be offered.

> I am using the plotyy command to create a graph with two y axes.

It's possible to get plotyy to plot error bars in the manner you want,

however in my opinion you have to be a graphics expert to coerce

plotyy to do anything more than the most basic plots. An alternative

to plotyy that I would like to recommend - you can find on the file

exchange by searching for "plt". One of the main advantages to plt

is the consistent interface, exhaustively documented with dozens of

examples.

The example that you should look at is called "pltvbar.m" (in the demo

folder) and it shows how to plot vertical bars of several types including

error bars. Any trace or combination of traces may be placed on either

the right or left hand axis (specified via the 'Right' parameter).

If you have any questions or problems with plt, feel free to contact the

author (me) at: paul (at) mennen (dot) org.

~Paul

It's possible to get plotyy to plot error bars in the manner you want,

however in my opinion you have to be a graphics expert to coerce

plotyy to do anything more than the most basic plots. An alternative

to plotyy that I would like to recommend - you can find on the file

exchange by searching for "plt". One of the main advantages to plt

is the consistent interface, exhaustively documented with dozens of

examples.

The example that you should look at is called "pltvbar.m" (in the demo

folder) and it shows how to plot vertical bars of several types including

error bars. Any trace or combination of traces may be placed on either

the right or left hand axis (specified via the 'Right' parameter).

If you have any questions or problems with plt, feel free to contact the

author (me) at: paul (at) mennen (dot) org.

~Paul

I used the following sequence to generate a polt you are looking for:

fig = figure;

[AX,H1,H2] = plotyy(Wopen, MeanAbsNoise, Wopen, WopenOverE);

set(fig, 'CurrentAxes', AX(1));

hold on;

errorbar(Wopen, MeanAbsNoise, Err, 'r.');

set(fig, 'CurrentAxes', AX(2));

hold on;

errorbar(Wopen, WopenOverE, Err2, 'r.');

grid on;

Best Regards

HoWil

1. two tendencies plot for the left Y axis and one bar plot for the right axis ?

2. 2-4 stacked bar graphs, two variables each, Y's vary same chart

3. how can i plot two different y-axis graph with same x-axis

4. Plotting a graph with one X-axis and two Y-axes

5. Want graph with 2 axis, but bars overlap when second axis added

6. I want to plot (+,-) data in bar graph style with only positive Y axis

7. 3D columns with depth graph that also plots lines on second axis?

8. Plotting two y axis in one graph with different scales

9. How do I plot an XY (scatter) graph with two Y axes?

10. Reversing X axis flips Primary Y axis plot but not Secondary Y axis plot

11. Plotting Graphs on Same Plot With Axes Rescaled To Include Largest Range

12. create bar graph with two series and secondary y axis

13. Excel bar graph with two axes

14. best way to graph stacked bar with line on two axes

15. Plotting Categories on Two Different Y Axes (Bar Charts)

3 post • Page:**1** of **1**