|
9 | 9 | %-SURFACE DATA STRUCTURE- %
|
10 | 10 | image_data = get(obj.State.Plot(surfaceIndex).Handle);
|
11 | 11 | figure_data = get(obj.State.Figure.Handle);
|
| 12 | + |
12 | 13 | %-AXIS DATA-%
|
13 | 14 | eval(['xaxis = obj.layout.xaxis' num2str(xsource) ';']);
|
14 | 15 | eval(['yaxis = obj.layout.yaxis' num2str(ysource) ';']);
|
|
35 | 36 |
|
36 | 37 | %-surface x-%
|
37 | 38 | obj.data{surfaceIndex}.x = image_data.XData;
|
38 |
| - |
| 39 | + |
39 | 40 | %---------------------------------------------------------------------%
|
40 | 41 |
|
41 | 42 | %-surface y-%
|
|
46 | 47 | %-surface z-%
|
47 | 48 | obj.data{surfaceIndex}.z = image_data.ZData;
|
48 | 49 |
|
| 50 | + %---------------------------------------------------------------------% |
| 51 | + |
| 52 | + %- setting grid mesh by default -% |
| 53 | + % x-direction |
| 54 | + xmin = min(image_data.XData(:)); |
| 55 | + xmax = max(image_data.XData(:)); |
| 56 | + xsize = (xmax - xmin) / (size(image_data.XData, 2) - 1); |
| 57 | + obj.data{surfaceIndex}.contours.x.start = xmin; |
| 58 | + obj.data{surfaceIndex}.contours.x.end = xmax; |
| 59 | + obj.data{surfaceIndex}.contours.x.size = xsize; |
| 60 | + obj.data{surfaceIndex}.contours.x.show = true; |
| 61 | + obj.data{surfaceIndex}.contours.x.color = 'black'; |
| 62 | + % y-direction |
| 63 | + ymin = min(image_data.YData(:)); |
| 64 | + ymax = max(image_data.YData(:)); |
| 65 | + ysize = (ymax - ymin) / (size(image_data.YData, 2)); |
| 66 | + obj.data{surfaceIndex}.contours.y.start = ymin; |
| 67 | + obj.data{surfaceIndex}.contours.y.end = ymax; |
| 68 | + obj.data{surfaceIndex}.contours.y.size = ysize; |
| 69 | + obj.data{surfaceIndex}.contours.y.show = true; |
| 70 | + obj.data{surfaceIndex}.contours.y.color = 'black'; |
| 71 | + |
49 | 72 |
|
50 | 73 | else
|
51 | 74 |
|
|
61 | 84 |
|
62 | 85 | %-------------------------------------------------------------------------%
|
63 | 86 |
|
64 |
| - |
65 | 87 | %-image colorscale-%
|
66 | 88 |
|
67 | 89 | cmap = figure_data.Colormap;
|
| 90 | +len = length(cmap)-1; |
68 | 91 |
|
69 | 92 | for c = 1: length(cmap)
|
70 |
| - x1=(c-1)/length(cmap); |
71 |
| - if x1 > 0.99 |
72 |
| - x=round(x1); |
73 |
| - else |
74 |
| - x=x1; |
75 |
| - end |
76 |
| - obj.data{surfaceIndex}.colorscale{c} = { x , ['rgb(' num2str(255*cmap(c,1)) ',' num2str(255*cmap(c,2)) ',' num2str(255*cmap(c,3)) ',' ')' ] }; |
| 93 | + col = 255 * cmap(c, :); |
| 94 | + obj.data{surfaceIndex}.colorscale{c} = { (c-1)/len , ['rgb(' num2str(col(1)) ',' num2str(col(2)) ',' num2str(col(3)) ')' ] }; |
77 | 95 | end
|
78 | 96 |
|
79 | 97 | obj.data{surfaceIndex}.surfacecolor = image_data.CData;
|
| 98 | + |
80 | 99 | %-------------------------------------------------------------------------%
|
81 | 100 |
|
82 | 101 | %-surface name-%
|
|
0 commit comments