Geant4 Cross Reference |
1 // Copyright (C) 2010, Guy Barrand. All rights 1 // Copyright (C) 2010, Guy Barrand. All rights reserved. 2 // See the file tools.license for terms. 2 // See the file tools.license for terms. 3 3 4 #ifndef tools_sg_plotter_some_styles 4 #ifndef tools_sg_plotter_some_styles 5 #define tools_sg_plotter_some_styles 5 #define tools_sg_plotter_some_styles 6 6 7 // Functions to set some common styles. 7 // Functions to set some common styles. 8 // Typically ROOT_default (the default style o 8 // Typically ROOT_default (the default style of ROOT), hippodraw 9 // or return/reset to the default inlib style. 9 // or return/reset to the default inlib style. 10 10 11 #include "plotter" 11 #include "plotter" 12 #include "style_colormap" 12 #include "style_colormap" 13 13 14 namespace tools { 14 namespace tools { 15 namespace sg { 15 namespace sg { 16 16 17 inline bool set_style_color(std::ostream& a_ou 17 inline bool set_style_color(std::ostream& a_out,const cmaps_t& a_cmaps,const std::string& a_s,colorf& a_col){ 18 if(!find_color(a_cmaps,a_s,a_col)) { 18 if(!find_color(a_cmaps,a_s,a_col)) { 19 a_out << "tools::sg::set_style_color: colo 19 a_out << "tools::sg::set_style_color: color " << sout(a_s) << " not found." << std::endl; 20 return false; 20 return false; 21 } 21 } 22 return true; 22 return true; 23 } 23 } 24 24 25 // a_font = font_arialbd_ttf(); //idem ROO 25 // a_font = font_arialbd_ttf(); //idem ROOT 62. 26 // a_font = font_roboto_bold_ttf(); //open sou 26 // a_font = font_roboto_bold_ttf(); //open source replacement for arialbd. 27 27 28 inline void set_style_font(text_style& a_style 28 inline void set_style_font(text_style& a_style,const std::string& a_font){ 29 a_style.font = a_font; 29 a_style.font = a_font; 30 a_style.front_face = winding_cw; 30 a_style.front_face = winding_cw; 31 a_style.smoothing = true; 31 a_style.smoothing = true; 32 } 32 } 33 33 34 inline void set_ROOT_default_style(std::ostrea 34 inline void set_ROOT_default_style(std::ostream& a_out,const cmaps_t& a_cmaps,plotter& a_plotter,const std::string& a_font) { 35 a_plotter.value_top_margin = 0.05f; 35 a_plotter.value_top_margin = 0.05f; 36 a_plotter.bottom_margin = 0.1f; 36 a_plotter.bottom_margin = 0.1f; 37 a_plotter.top_margin = 0.1f; 37 a_plotter.top_margin = 0.1f; 38 a_plotter.left_margin = 0.1f; 38 a_plotter.left_margin = 0.1f; 39 a_plotter.right_margin = 0.1f; 39 a_plotter.right_margin = 0.1f; 40 40 41 {style& _style = a_plotter.background_style() 41 {style& _style = a_plotter.background_style(); 42 _style.visible = true; 42 _style.visible = true; 43 //if(!set_style_color(a_out,a_cmaps,"ROOT/grey 43 //if(!set_style_color(a_out,a_cmaps,"ROOT/grey19",_style.back_color.value())) {} 44 //border: 44 //border: 45 if(!set_style_color(a_out,a_cmaps,"black",_s 45 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 46 _style.line_width = 0.003; // 0 = no border 46 _style.line_width = 0.003; // 0 = no border. In % of width. 47 } 47 } 48 48 49 // <!-- <style name="wall_style"><visible>fals 49 // <!-- <style name="wall_style"><visible>false</visible></style> --> 50 50 51 {style& _style = a_plotter.grid_style(); 51 {style& _style = a_plotter.grid_style(); 52 _style.visible = false; 52 _style.visible = false; 53 //if(!set_style_color(a_out,a_cmaps,"white",_s 53 //if(!set_style_color(a_out,a_cmaps,"white",_style.color.value())) {} 54 } 54 } 55 55 56 // plot title done with the title_box (and n 56 // plot title done with the title_box (and not plotter title): 57 {text_style& _style = a_plotter.title_style() 57 {text_style& _style = a_plotter.title_style(); 58 _style.visible = false; 58 _style.visible = false; 59 } 59 } 60 {text_style& _style = a_plotter.title_box_sty 60 {text_style& _style = a_plotter.title_box_style(); 61 _style.visible = true; 61 _style.visible = true; 62 if(!set_style_color(a_out,a_cmaps,"ROOT/grey 62 if(!set_style_color(a_out,a_cmaps,"ROOT/grey19",_style.back_color.value())) {} 63 _style.back_shadow = 0.015f; //% of width. 63 _style.back_shadow = 0.015f; //% of width. 64 if(!set_style_color(a_out,a_cmaps,"black",_s 64 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 65 set_style_font(_style,a_font);} 65 set_style_font(_style,a_font);} 66 66 67 a_plotter.infos_width = 0.35f; 67 a_plotter.infos_width = 0.35f; 68 a_plotter.infos_x_margin = 0.01f; //from ri 68 a_plotter.infos_x_margin = 0.01f; //from right border. 69 a_plotter.infos_y_margin = 0.005f; //from t 69 a_plotter.infos_y_margin = 0.005f; //from top border. 70 {text_style& _style = a_plotter.infos_style() 70 {text_style& _style = a_plotter.infos_style(); 71 _style.visible = true; 71 _style.visible = true; 72 if(!set_style_color(a_out,a_cmaps,"ROOT/grey 72 if(!set_style_color(a_out,a_cmaps,"ROOT/grey19",_style.back_color.value())) {} 73 _style.back_shadow = 0.015f; //% of width. 73 _style.back_shadow = 0.015f; //% of width. 74 if(!set_style_color(a_out,a_cmaps,"black",_s 74 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 75 _style.modeling = infos_modeling_ROOT(); // 75 _style.modeling = infos_modeling_ROOT(); //to have histo name as info title. 76 set_style_font(_style,a_font);} 76 set_style_font(_style,a_font);} 77 77 78 {style& _style = a_plotter.inner_frame_style( 78 {style& _style = a_plotter.inner_frame_style(); 79 _style.visible = true; 79 _style.visible = true; 80 if(!set_style_color(a_out,a_cmaps,"black",_s 80 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 81 _style.line_width = 1.0f; 81 _style.line_width = 1.0f; 82 //_style.line_pattern = line_solid; 82 //_style.line_pattern = line_solid; 83 } 83 } 84 84 85 //////////////////////////////////////////// 85 ////////////////////////////////////////////////////////// 86 /// x axis: //////////////////////////////// 86 /// x axis: ////////////////////////////////////////////// 87 //////////////////////////////////////////// 87 ////////////////////////////////////////////////////////// 88 {axis& _axis = a_plotter.x_axis(); 88 {axis& _axis = a_plotter.x_axis(); 89 _axis.modeling = tick_modeling_hplot(); 89 _axis.modeling = tick_modeling_hplot(); 90 _axis.divisions = 510; 90 _axis.divisions = 510; 91 _axis.title_hjust = right; 91 _axis.title_hjust = right; 92 _axis.label_to_axis = 0.005f; 92 _axis.label_to_axis = 0.005f; 93 _axis.label_height = 0.04f; 93 _axis.label_height = 0.04f; 94 _axis.tick_length = 0.03f; 94 _axis.tick_length = 0.03f; 95 _axis.title_to_axis = 0.05f; //YLAB = 0.05 95 _axis.title_to_axis = 0.05f; //YLAB = 0.05 96 _axis.title_height = 0.04f; 96 _axis.title_height = 0.04f; 97 _axis.is_log = false; 97 _axis.is_log = false; 98 98 99 {line_style& _style = _axis.line_style(); 99 {line_style& _style = _axis.line_style(); 100 if(!set_style_color(a_out,a_cmaps,"black",_s 100 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 101 _style.width = 1.0f;} 101 _style.width = 1.0f;} 102 102 103 {line_style& _style = _axis.ticks_style(); 103 {line_style& _style = _axis.ticks_style(); 104 if(!set_style_color(a_out,a_cmaps,"black",_s 104 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 105 _style.width = 1.0f;} 105 _style.width = 1.0f;} 106 106 107 {text_style& _style = _axis.labels_style(); 107 {text_style& _style = _axis.labels_style(); 108 if(!set_style_color(a_out,a_cmaps,"black",_s 108 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 109 _style.scale = 0.6; //To have a good matchi 109 _style.scale = 0.6; //To have a good matching with ROOT text size. 110 set_style_font(_style,a_font);} 110 set_style_font(_style,a_font);} 111 111 112 {text_style& _style = _axis.title_style(); 112 {text_style& _style = _axis.title_style(); 113 _style.visible = true; 113 _style.visible = true; 114 if(!set_style_color(a_out,a_cmaps,"black",_s 114 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 115 _style.scale = 0.6; //To have a good matchi 115 _style.scale = 0.6; //To have a good matching with ROOT text size. 116 set_style_font(_style,a_font);} 116 set_style_font(_style,a_font);} 117 117 118 {text_style& _style = _axis.mag_style(); 118 {text_style& _style = _axis.mag_style(); 119 if(!set_style_color(a_out,a_cmaps,"black",_s 119 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 120 _style.scale = 0.6; //To have a good matchi 120 _style.scale = 0.6; //To have a good matching with ROOT text size. 121 set_style_font(_style,a_font);} 121 set_style_font(_style,a_font);} 122 122 123 } 123 } 124 124 125 //////////////////////////////////////////// 125 ////////////////////////////////////////////////////////// 126 /// y axis: //////////////////////////////// 126 /// y axis: ////////////////////////////////////////////// 127 //////////////////////////////////////////// 127 ////////////////////////////////////////////////////////// 128 {axis& _axis = a_plotter.y_axis(); 128 {axis& _axis = a_plotter.y_axis(); 129 _axis.modeling = tick_modeling_hplot(); 129 _axis.modeling = tick_modeling_hplot(); 130 _axis.divisions = 510; 130 _axis.divisions = 510; 131 _axis.title_hjust = right; 131 _axis.title_hjust = right; 132 _axis.label_to_axis = 0.005f; 132 _axis.label_to_axis = 0.005f; 133 _axis.label_height = 0.04f; 133 _axis.label_height = 0.04f; 134 _axis.tick_length = 0.03f; 134 _axis.tick_length = 0.03f; 135 _axis.title_to_axis = 0.07f; //XLAB = 0.07 135 _axis.title_to_axis = 0.07f; //XLAB = 0.07 136 _axis.title_height = 0.04f; 136 _axis.title_height = 0.04f; 137 _axis.is_log = false; 137 _axis.is_log = false; 138 138 139 {line_style& _style = _axis.line_style(); 139 {line_style& _style = _axis.line_style(); 140 if(!set_style_color(a_out,a_cmaps,"black",_s 140 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 141 _style.width = 1.0f;} 141 _style.width = 1.0f;} 142 142 143 {line_style& _style = _axis.ticks_style(); 143 {line_style& _style = _axis.ticks_style(); 144 if(!set_style_color(a_out,a_cmaps,"black",_s 144 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 145 _style.width = 1.0f;} 145 _style.width = 1.0f;} 146 146 147 {text_style& _style = _axis.labels_style(); 147 {text_style& _style = _axis.labels_style(); 148 if(!set_style_color(a_out,a_cmaps,"black",_s 148 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 149 _style.scale = 0.6; 149 _style.scale = 0.6; 150 set_style_font(_style,a_font);} 150 set_style_font(_style,a_font);} 151 151 152 {text_style& _style = _axis.title_style(); 152 {text_style& _style = _axis.title_style(); 153 _style.visible = true; 153 _style.visible = true; 154 if(!set_style_color(a_out,a_cmaps,"black",_s 154 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 155 _style.scale = 0.6; //To have a good matchi 155 _style.scale = 0.6; //To have a good matching with ROOT text size. 156 set_style_font(_style,a_font);} 156 set_style_font(_style,a_font);} 157 157 158 {text_style& _style = _axis.mag_style(); 158 {text_style& _style = _axis.mag_style(); 159 if(!set_style_color(a_out,a_cmaps,"black",_s 159 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 160 _style.scale = 0.6; //To have a good matchi 160 _style.scale = 0.6; //To have a good matching with ROOT text size. 161 set_style_font(_style,a_font);} 161 set_style_font(_style,a_font);} 162 162 163 } 163 } 164 164 165 //////////////////////////////////////////// 165 ////////////////////////////////////////////////////////// 166 /// z axis: //////////////////////////////// 166 /// z axis: ////////////////////////////////////////////// 167 //////////////////////////////////////////// 167 ////////////////////////////////////////////////////////// 168 {axis& _axis = a_plotter.z_axis(); 168 {axis& _axis = a_plotter.z_axis(); 169 _axis.modeling = tick_modeling_hplot(); 169 _axis.modeling = tick_modeling_hplot(); 170 _axis.is_log = false; 170 _axis.is_log = false; 171 171 172 {line_style& _style = _axis.line_style(); 172 {line_style& _style = _axis.line_style(); 173 if(!set_style_color(a_out,a_cmaps,"black",_s 173 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 174 _style.width = 1.0f;} 174 _style.width = 1.0f;} 175 175 176 {line_style& _style = _axis.ticks_style(); 176 {line_style& _style = _axis.ticks_style(); 177 if(!set_style_color(a_out,a_cmaps,"black",_s 177 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 178 _style.width = 1.0f;} 178 _style.width = 1.0f;} 179 179 180 {text_style& _style = _axis.labels_style(); 180 {text_style& _style = _axis.labels_style(); 181 if(!set_style_color(a_out,a_cmaps,"black",_s 181 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 182 _style.scale = 0.6;} 182 _style.scale = 0.6;} 183 183 184 {text_style& _style = _axis.title_style(); 184 {text_style& _style = _axis.title_style(); 185 if(!set_style_color(a_out,a_cmaps,"black",_s 185 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 186 _style.scale = 0.6;} 186 _style.scale = 0.6;} 187 187 188 {text_style& _style = _axis.mag_style(); 188 {text_style& _style = _axis.mag_style(); 189 if(!set_style_color(a_out,a_cmaps,"black",_s 189 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 190 _style.scale = 0.6;} 190 _style.scale = 0.6;} 191 191 192 } 192 } 193 193 194 //////////////////////////////////////////// 194 ////////////////////////////////////////////////////////// 195 /// colormap axis: ///////////////////////// 195 /// colormap axis: /////////////////////////////////////// 196 //////////////////////////////////////////// 196 ////////////////////////////////////////////////////////// 197 {axis& _axis = a_plotter.colormap_axis(); 197 {axis& _axis = a_plotter.colormap_axis(); 198 _axis.modeling = tick_modeling_hplot(); 198 _axis.modeling = tick_modeling_hplot(); 199 _axis.divisions = 510; 199 _axis.divisions = 510; 200 _axis.title_hjust = right; 200 _axis.title_hjust = right; 201 _axis.label_to_axis = 0.005f; 201 _axis.label_to_axis = 0.005f; 202 _axis.label_height = 0.04f; 202 _axis.label_height = 0.04f; 203 _axis.tick_length = 0.03f; 203 _axis.tick_length = 0.03f; 204 _axis.title_to_axis = 0.07f; //XLAB = 0.07 204 _axis.title_to_axis = 0.07f; //XLAB = 0.07 205 _axis.title_height = 0.04f; 205 _axis.title_height = 0.04f; 206 _axis.is_log = false; 206 _axis.is_log = false; 207 207 208 {line_style& _style = _axis.line_style(); 208 {line_style& _style = _axis.line_style(); 209 if(!set_style_color(a_out,a_cmaps,"black",_s 209 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 210 _style.width = 1.0f;} 210 _style.width = 1.0f;} 211 211 212 {line_style& _style = _axis.ticks_style(); 212 {line_style& _style = _axis.ticks_style(); 213 if(!set_style_color(a_out,a_cmaps,"black",_s 213 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 214 _style.width = 1.0f;} 214 _style.width = 1.0f;} 215 215 216 {text_style& _style = _axis.labels_style(); 216 {text_style& _style = _axis.labels_style(); 217 if(!set_style_color(a_out,a_cmaps,"black",_s 217 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 218 _style.scale = 0.6; //To have a good matchi 218 _style.scale = 0.6; //To have a good matching with ROOT text size. 219 set_style_font(_style,a_font);} 219 set_style_font(_style,a_font);} 220 220 221 {text_style& _style = _axis.title_style(); 221 {text_style& _style = _axis.title_style(); 222 _style.visible = true; 222 _style.visible = true; 223 if(!set_style_color(a_out,a_cmaps,"black",_s 223 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 224 _style.scale = 0.6; //To have a good matchi 224 _style.scale = 0.6; //To have a good matching with ROOT text size. 225 set_style_font(_style,a_font);} 225 set_style_font(_style,a_font);} 226 226 227 {text_style& _style = _axis.mag_style(); 227 {text_style& _style = _axis.mag_style(); 228 if(!set_style_color(a_out,a_cmaps,"black",_s 228 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 229 _style.scale = 0.6; //To have a good matchi 229 _style.scale = 0.6; //To have a good matching with ROOT text size. 230 set_style_font(_style,a_font);} 230 set_style_font(_style,a_font);} 231 231 232 } 232 } 233 233 234 {style& _style = a_plotter.bins_style(0); 234 {style& _style = a_plotter.bins_style(0); 235 _style.modeling = modeling_top_lines(); 235 _style.modeling = modeling_top_lines(); 236 if(!set_style_color(a_out,a_cmaps,"black",_s 236 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 237 _style.line_width = 1.0f; 237 _style.line_width = 1.0f; 238 //_style.line_pattern = line_solid; 238 //_style.line_pattern = line_solid; 239 } 239 } 240 240 241 {style& _style = a_plotter.func_style(0); 241 {style& _style = a_plotter.func_style(0); 242 _style.modeling = modeling_top_lines(); 242 _style.modeling = modeling_top_lines(); 243 if(!set_style_color(a_out,a_cmaps,"black",_s 243 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 244 _style.line_width = 3.0f; 244 _style.line_width = 3.0f; 245 //_style.line_pattern = line_solid; 245 //_style.line_pattern = line_solid; 246 } 246 } 247 247 248 } 248 } 249 249 250 // a_font = font_helvetica_ttf(); 250 // a_font = font_helvetica_ttf(); 251 // a_font = font_lato_regular_ttf(); //open so 251 // a_font = font_lato_regular_ttf(); //open source replacement for helvetica 252 252 253 inline void set_hippodraw_style(std::ostream& 253 inline void set_hippodraw_style(std::ostream& a_out,const cmaps_t& a_cmaps,plotter& a_plotter,const std::string& a_font) { 254 // In memory of P.Kunz. 254 // In memory of P.Kunz. 255 255 256 a_plotter.value_top_margin = 0.05f; 256 a_plotter.value_top_margin = 0.05f; 257 a_plotter.bottom_margin = 0.12f; 257 a_plotter.bottom_margin = 0.12f; 258 a_plotter.top_margin = 0.16f; 258 a_plotter.top_margin = 0.16f; 259 a_plotter.left_margin = 0.16f; 259 a_plotter.left_margin = 0.16f; 260 a_plotter.right_margin = 0.16f; 260 a_plotter.right_margin = 0.16f; 261 a_plotter.title_to_axis = 0.1f; 261 a_plotter.title_to_axis = 0.1f; 262 a_plotter.title_height = 0.03f; 262 a_plotter.title_height = 0.03f; 263 263 264 // <!-- <style name="wall_style"><visible>fals 264 // <!-- <style name="wall_style"><visible>false</visible></style> --> 265 265 266 {style& _style = a_plotter.grid_style(); 266 {style& _style = a_plotter.grid_style(); 267 _style.visible = false;} 267 _style.visible = false;} 268 {style& _style = a_plotter.inner_frame_style( 268 {style& _style = a_plotter.inner_frame_style(); 269 _style.visible = true;} 269 _style.visible = true;} 270 {text_style& _style = a_plotter.infos_style() 270 {text_style& _style = a_plotter.infos_style(); 271 _style.visible = false;} 271 _style.visible = false;} 272 272 273 {text_style& _style = a_plotter.title_style() 273 {text_style& _style = a_plotter.title_style(); 274 set_style_font(_style,a_font); 274 set_style_font(_style,a_font); 275 _style.visible = true;} 275 _style.visible = true;} 276 276 277 //////////////////////////////////////////// 277 ////////////////////////////////////////////////////////// 278 /// x axis: //////////////////////////////// 278 /// x axis: ////////////////////////////////////////////// 279 //////////////////////////////////////////// 279 ////////////////////////////////////////////////////////// 280 {axis& _axis = a_plotter.x_axis(); 280 {axis& _axis = a_plotter.x_axis(); 281 _axis.modeling = tick_modeling_hippo(); 281 _axis.modeling = tick_modeling_hippo(); 282 _axis.title_hjust = center; 282 _axis.title_hjust = center; 283 _axis.label_to_axis = 0.015f; 283 _axis.label_to_axis = 0.015f; 284 _axis.title_to_axis = 0.07f; 284 _axis.title_to_axis = 0.07f; 285 _axis.title_height = 0.035f; 285 _axis.title_height = 0.035f; 286 _axis.label_height = 0.02625f; //0.0175F * 286 _axis.label_height = 0.02625f; //0.0175F * 1.5F 287 287 288 {text_style& _style = _axis.title_style(); 288 {text_style& _style = _axis.title_style(); 289 _style.visible = true; 289 _style.visible = true; 290 set_style_font(_style,a_font);} 290 set_style_font(_style,a_font);} 291 291 292 {text_style& _style = _axis.labels_style(); 292 {text_style& _style = _axis.labels_style(); 293 if(!set_style_color(a_out,a_cmaps,"black",_s 293 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 294 set_style_font(_style,a_font);} 294 set_style_font(_style,a_font);} 295 295 296 } 296 } 297 297 298 //////////////////////////////////////////// 298 ////////////////////////////////////////////////////////// 299 /// y axis: //////////////////////////////// 299 /// y axis: ////////////////////////////////////////////// 300 //////////////////////////////////////////// 300 ////////////////////////////////////////////////////////// 301 {axis& _axis = a_plotter.y_axis(); 301 {axis& _axis = a_plotter.y_axis(); 302 _axis.modeling = tick_modeling_hippo(); 302 _axis.modeling = tick_modeling_hippo(); 303 _axis.title_hjust = center; 303 _axis.title_hjust = center; 304 _axis.title_to_axis = 0.2f; 304 _axis.title_to_axis = 0.2f; 305 _axis.title_height = 0.035f; 305 _axis.title_height = 0.035f; 306 _axis.label_height = 0.02625f; //0.0175F * 306 _axis.label_height = 0.02625f; //0.0175F * 1.5F 307 307 308 {text_style& _style = _axis.title_style(); 308 {text_style& _style = _axis.title_style(); 309 _style.visible = true; 309 _style.visible = true; 310 set_style_font(_style,a_font);} 310 set_style_font(_style,a_font);} 311 311 312 {text_style& _style = _axis.labels_style(); 312 {text_style& _style = _axis.labels_style(); 313 if(!set_style_color(a_out,a_cmaps,"black",_s 313 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 314 set_style_font(_style,a_font);} 314 set_style_font(_style,a_font);} 315 315 316 } 316 } 317 317 318 //////////////////////////////////////////// 318 ////////////////////////////////////////////////////////// 319 /// z axis: //////////////////////////////// 319 /// z axis: ////////////////////////////////////////////// 320 //////////////////////////////////////////// 320 ////////////////////////////////////////////////////////// 321 {axis& _axis = a_plotter.z_axis(); 321 {axis& _axis = a_plotter.z_axis(); 322 322 323 {text_style& _style = _axis.title_style(); 323 {text_style& _style = _axis.title_style(); 324 _style.visible = true; 324 _style.visible = true; 325 set_style_font(_style,a_font);} 325 set_style_font(_style,a_font);} 326 326 327 {text_style& _style = _axis.labels_style(); 327 {text_style& _style = _axis.labels_style(); 328 if(!set_style_color(a_out,a_cmaps,"black",_s 328 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 329 set_style_font(_style,a_font);} 329 set_style_font(_style,a_font);} 330 330 331 } 331 } 332 332 333 {style& _style = a_plotter.bins_style(0); 333 {style& _style = a_plotter.bins_style(0); 334 _style.modeling = modeling_top_lines(); 334 _style.modeling = modeling_top_lines(); 335 if(!set_style_color(a_out,a_cmaps,"black",_s 335 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 336 _style.line_width = 1.0f; 336 _style.line_width = 1.0f; 337 //_style.line_pattern = line_solid; 337 //_style.line_pattern = line_solid; 338 } 338 } 339 339 340 {style& _style = a_plotter.func_style(0); 340 {style& _style = a_plotter.func_style(0); 341 _style.modeling = modeling_top_lines(); 341 _style.modeling = modeling_top_lines(); 342 if(!set_style_color(a_out,a_cmaps,"black",_s 342 if(!set_style_color(a_out,a_cmaps,"black",_style.color.value())) {} 343 _style.line_width = 1.0f; 343 _style.line_width = 1.0f; 344 //_style.line_pattern = line_solid; 344 //_style.line_pattern = line_solid; 345 } 345 } 346 346 347 {style& _style = a_plotter.errors_style(0); 347 {style& _style = a_plotter.errors_style(0); 348 _style.visible = false; 348 _style.visible = false; 349 } 349 } 350 350 351 } 351 } 352 352 353 inline void set_inlib_default_style(std::ostre 353 inline void set_inlib_default_style(std::ostream&,const cmaps_t&,plotter& a_plotter,const std::string&) { 354 {axis& _axis = a_plotter.colormap_axis(); 354 {axis& _axis = a_plotter.colormap_axis(); 355 _axis.label_to_axis = 0.01f;} 355 _axis.label_to_axis = 0.01f;} 356 } 356 } 357 357 358 }} 358 }} 359 359 360 #endif 360 #endif