[Thread Prev][Thread Next][Index]

[ferret_users] Re: Violin plotting



hi again,

So I managed to do something, but I still need one extra step to get the good plot.

So for instance I have a list like that:

let list1 = {0,40,24,15,10,0,0,57,63,14,16,80,10,20,0,0,0,0,0}

!!Compute pdf stats:
LET hsort =  SAMPLEI(XSEQUENCE((list1)), SORTI(XSEQUENCE((list1)) ))
LET ns = `hsort[i=@ngd]`
LET hval = hsort[i=1:`ns`]
LET hcount = i[gx=hval,i=1:`ns`]
LET hpdf = 2/((hval[i=@shf:+1]-hval[i=@shf:-1])*hcount[x=@max])
let pdfstat=if hpdf then hpdf else 0  !!!!change masked values to 0


Then I can do a violin plot-type simply with that:

plot/vs/line=1/hlim=-0.04:0.04/vlim=-1:80 pdfstat,hval
plot/vs/line=1/hlim=-0.04:0.04/vlim=-1:80 pdfstat*-1,hval

Now the problem is I'd like to fill the space between the 2 curves.
I tried to use the fill_between function but it seems that the axes are wrong, probably because it's a versus plot.

GO fill_between POLY/Pattern=lite_vertical/OVER/NOLABEL/PALETTE=blue pdfstat*-1 pdfstat*-1 pdfstat

But I have the error "dimensions improperly specified"



Nicolas




2017-05-17 17:54 GMT+01:00 Nicolas Freychet <nicolas.freychet@xxxxxxxxx>:
Hello,

Did anyone ever plotted a violin diagram using Ferret?

I have 20 categories on the X-axis, and an intensity on the Y-axis.  Because I have 40 different models, I'd like to represent for each category how the ensemble of the model is distributed in terms of intensity.

If anyone ever did something similar, it would be great.

Nicolas



--
----------------------------------------------------
Nicolas Freychet
PDRA, School of Geosciences
University of Edinburgh
----------------------------------------------------



--
----------------------------------------------------
Nicolas Freychet
PDRA, School of Geosciences
University of Edinburgh
----------------------------------------------------

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement