Help! How do I do a BOX PLOT??

Hello, 

I am trying to make a box plot for my data and although I have looked at the demos I just don't manage. 

I have a data series Y that I want to represent against X (attached databoxplotinputXY).

I would like to bin X in 0.1 size bins (from 0 to 1) and represent the Y data (as a box and whisker plot) as a function of each of these size bins. See attached graph (averaged_dataXY).

Thanking you all in advance  

I would like to generate a similar plot but as a box and whisker (25.44 KB) Data X and Y (14.2 KB)

Hi,

Here is How I created the graph.

1. Create a text wave with the labels 0-0.9 in 0.1 increments.

•Make/N=10/T GroupLabel
•groupLabel = num2str(x/10)
I then split the Y data into separate waves based on the corresponding x data
function SplitData(Xin,Yin)
    wave Xin,Yin
   
    variable index
    For(index=0;index<1;index+=.1)
        Extract /O Yin, $("G"+num2str((index)*10)), Xin>index && Xin<(Index+0.1)
    endfor
end

 

I then created a box plot using the now split waves (10 of them) and with GroupLabel as the label wave.

 

Andy

boxplot.png (25.89 KB)

Hello Andy, 

Thank you for getting back to me so quickly. So the final boxplot that you showed is EXACTLY what I want to do, however the problem I am having is going trom the step where the data is split over the different bins to generating the boxplot. 

When I use the boxplot function, it only creates the data with one point.

?? Can you explain how you plotted the binned data as a box/whisker. ??

Thanks again. 

Hi,

 

I am using IP 8 and there is a built in box plot functionality.  In the dialog box you select the waves which represent each box and the labels.

Andy

 

Blot Plot Dialog Box.png (126.26 KB)

Ah OK. I am in IP 6!! Is there something similar that can be used? 

Thanks

Hi,

"IP6 - now that is a name I have not heard in long time"

A couple of steps.

first in the procedure window add:

#include <Percentile and Box Plot>

Then I rename Grouplabel to some thing that does not with "G" - you will see why in a moment.

Then under window select Box Plot.

I then select waves by name and Use "G*" to select the split waves -this is why I needed to rename.

Select replicates are "columns" which indicates that each wave is a single group.

And the X label is the renamed wave.

If you need to add the data points, that is a bit more complex.

Andy

Box plot IP6.png (266.16 KB) BoxIP6.png (5.13 KB)

Hi, 

Yes we have some software that was only compatible (until recently) with 6!! We should be moving on soon :)

I just want to thank you for your help. I managed to do the BOX plots in time!! I can try modifying them by adding the data points or having several BOXPLOT in the same plot.. but it is less urgent!!

 

Forum

Support

Gallery

Igor Pro 9

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More