X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 19 Jan 2012 06:59 AM by  anon
Errorplot on grouped barplot
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:20
New Member


--
19 Jan 2012 06:59 AM
    Hi All, I'm trying to get the errorplot function to work on a grouped barplot. So I made a grouped barplot with the barplot function and the keywords 'nbars' and 'index'. Now I want every bar to have an error bar. The problem is that the barplot function uses 'index' to separate the bars, but i can't refer to this 'index' in the errorplot function. How to do this? Thanks in advance! Cheers, Wouter

    Deleted User



    New Member


    Posts:
    New Member


    --
    23 Jan 2012 10:06 AM
    Hi Wouter, I think the following example is what you want, though it could be difficult to program is you have many many bars: pro barplot_errorplot_ex nBars = 3 colors = ['red','yellow','blue'] data = RANDOMU(s,10,nBars) data_error = [0.2, 0.1, 0.1, 0.2, 0.2, 0.1, 0.2, 0.2, 0.1, 0.1] loc1 = INDGEN(10)-.25 b = BARPLOT(loc1, data[*,0], FILL_COLOR=colors[0], WIDTH = 0.25, /overplot) p = errorplot(loc1, data[*,0], data_error, /OVERPLOT, LINESTYLE = 6) loc2 = INDGEN(10) b = BARPLOT(loc2, data[*,1], FILL_COLOR=colors[1], WIDTH = 0.25, /overplot) p = errorplot(loc2, data[*,1], data_error, /OVERPLOT, LINESTYLE = 6) loc3 = INDGEN(10)+.25 b = BARPLOT(loc3, data[*,2], FILL_COLOR=colors[2], WIDTH = 0.25, /overplot) p = errorplot(loc3, data[*,2], data_error, /OVERPLOT, LINESTYLE = 6) end Cheers, Fernando

    Deleted User



    New Member


    Posts:20
    New Member


    --
    25 Jan 2012 07:24 AM
    Hi Fernando, That is indeed what I want. Thanks for the reply! However, I would prefer not to have to define the location of the bar and rather use the keywords that are available within a function. I guess that errorplot() simply lacks the appropriate functionality to do this... Well hopefully in a later version it will be possible. Thanks again. Cheers, Wouter

    Deleted User



    New Member


    Posts:
    New Member


    --
    25 Jan 2012 09:04 AM
    Hi Wouter, Yes, this can be a nice feature request. I will be creating a feature request on this issue, and hopefully in the near future this will be part of errorplot(). Cheers!, Fernando
    You are not authorized to post a reply.