Class: BlandAltman
- Inherits:
-
Object
- Object
- BlandAltman
- Defined in:
- lib/bland_altman/bland_altman.rb
Instance Method Summary collapse
- #check_par(params) ⇒ Object
- #getGroup ⇒ Object
- #getParams ⇒ Object
- #getValue ⇒ Object
-
#initialize(x_1, x_2, params) ⇒ BlandAltman
constructor
-
x_1
- a vector of Float numeric value *x_2
- a vector of Float numeric value *parms
- an Hash whit parametrs value ==== Parms This Hash contain parmas .
-
- #save ⇒ Object
- #view ⇒ Object
Constructor Details
#initialize(x_1, x_2, params) ⇒ BlandAltman
-
x_1
- a vector of Float numeric value -
x_2
- a vector of Float numeric value -
parms
- an Hash whit parametrs value
Parms
This Hash contain parmas . List of key permitted .
-
:title
- (default “A sample Graph”) Graph main title -
:legend
- (default false) Prints legend -
:vertical
- (default true) The orientation of the plot -
:height
- (default 1500) Graph height -
:width
- (default 800) Graph width -
:file_name
- (default sample.jpg) Graph File Name/Path to save plot. You can chose jpg or pdf
Examples
Class Usage:
values_1= [6.0,2.0,8.4]
values_2 = [1.0,2.0,3.0]
params = {"title" => "My_PLot"}
plot = BlandAltman.new(values_1,values_2,params)
#To view
plot.view
#to save
plot.save
35 36 37 38 39 |
# File 'lib/bland_altman/bland_altman.rb', line 35 def initialize(x_1,x_2,params) @group=check_val(x_1) @value=check_val(x_2) @params=self.check_par(params) end |
Instance Method Details
#check_par(params) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/bland_altman/bland_altman.rb', line 41 def check_par(params) hash = Hash.new permitted = ["title","vertical","legend","width","height","file_name"] keys = params.keys keys.each{ |key| if permitted.include?(key)==false raise "Error : Permitted key are title,vertical,legend,width,height" end } if params["title"]==nil hash["title"]="A sample Graph" else hash["title"]=params["title"] end if params["vertical"]==nil hash["vertical"]=false else hash["vertical"]=params["vertical"] end if params["legend"]==nil hash["legend"]=false else hash["legend"]=params["legend"] end if params["width"]==nil hash["width"]=1500 else hash["width"]=params["width"] end if params["height"]==nil hash["height"]=800 else hash["height"]=params["height"] end if params["file_name"]==nil hash["file_name"]="sample.jpg" else hash["file_name"]=params["file_name"] end params_map = HashMap.new(hash) return params_map end |
#getGroup ⇒ Object
91 92 93 |
# File 'lib/bland_altman/bland_altman.rb', line 91 def getGroup @group end |
#getParams ⇒ Object
99 100 101 |
# File 'lib/bland_altman/bland_altman.rb', line 99 def getParams @params end |
#getValue ⇒ Object
95 96 97 |
# File 'lib/bland_altman/bland_altman.rb', line 95 def getValue @value end |
#save ⇒ Object
104 105 106 107 108 109 110 |
# File 'lib/bland_altman/bland_altman.rb', line 104 def save begin a = Java::ComDomain::clocomics a.save_altman(self.getGroup,self.getValue,self.getParams) rescue Exception => ex end end |
#view ⇒ Object
111 112 113 114 115 116 117 |
# File 'lib/bland_altman/bland_altman.rb', line 111 def view begin a = Java::ComDomain::clocomics a.view_altman(self.getGroup,self.getValue,self.getParams) rescue Exception => ex end end |