-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathmocha_simple_plot.html
147 lines (127 loc) · 6.03 KB
/
mocha_simple_plot.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>mocha_simple_plot.md - Grip</title>
<link rel="icon" href="/__/grip/static/favicon.ico" />
<link rel="stylesheet" href="/__/grip/asset/github-ff8802b1c626720c9ee3a0a4cb7cf3b2.css" />
<link rel="stylesheet" href="/__/grip/asset/site-fb6f4a56fa12a642004cb7c08bdc8f02.css" />
<link rel="stylesheet" href="/__/grip/asset/frameworks-c4d3a737ed86a598505e48f9c81adb77.css" />
<link rel="stylesheet" href="/__/grip/static/octicons/octicons.css" />
<style>
/* Page tweaks */
.preview-page {
margin-top: 64px;
}
/* User-content tweaks */
.timeline-comment-wrapper > .timeline-comment:after,
.timeline-comment-wrapper > .timeline-comment:before {
content: none;
}
/* User-content overrides */
.discussion-timeline.wide {
width: 920px;
}
</style>
</head>
<body>
<div class="page">
<div id="preview-page" class="preview-page" data-autorefresh-url="/__/grip/refresh/">
<div role="main" class="main-content">
<div class="container new-discussion-timeline experiment-repo-nav">
<div class="repository-content">
<div id="readme" class="readme boxed-group clearfix announce instapaper_body md">
<h3>
<span class="octicon octicon-book"></span>
</h3>
<article class="markdown-body entry-content" itemprop="text" id="grip-content">
<h3>
<a id="user-content-mocha_simple_plot" class="anchor" href="#mocha_simple_plot" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>mocha_simple_plot</h3>
<h4>
<a id="user-content-syntax" class="anchor" href="#syntax" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Syntax</h4>
<div class="highlight highlight-source-matlab"><pre>mocha_simple_plot(month,depth,variable,region)</pre></div>
<h4>
<a id="user-content-description" class="anchor" href="#description" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Description</h4>
<p><code>mocha_simple_plot(month,depth,variable,region)</code> plots the nearest available depth-level to <code>depth</code>. <code>variable</code> specifies the parameter to be plotted and <code>region</code> is the rectangular region to be plotted. The calendar month is specified by <code>month</code>.</p>
<p><code>month</code> is an integer between 1 (January) and 12 (December).</p>
<p><code>depth</code> is (a single, double, integer) indicates negative meters below the surface.</p>
<p><code>variable</code> is a string or character array and is the name of the parameter to be plotted</p>
<p><code>region</code> is a vector containing the bounds [S N W E] of the region to be plotted, -180/180 or 0/360 longtitude format is fine. Limits may cross the dateline e.g. [35 45 170 -130] but this is a Mid-Atlantic product so there is no reason to try that.</p>
<h4>
<a id="user-content-example-1" class="anchor" href="#example-1" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Example 1</h4>
<div class="highlight highlight-source-matlab"><pre>
<span class="pl-c"><span class="pl-c">%</span> Setup nctoolbox:</span>
setup_nctoolbox
<span class="pl-c"><span class="pl-c">%</span> Plot surface temperature:</span>
month = <span class="pl-c1">10</span>; <span class="pl-c"><span class="pl-c">%</span> Month (1 through 12).</span>
depth = <span class="pl-c1">0</span>;
variable = <span class="pl-s"><span class="pl-pds">'</span>temperature<span class="pl-pds">'</span></span>; <span class="pl-c"><span class="pl-c">%</span> 'temperature' 'salinity'</span>
region = [<span class="pl-c1">34</span> <span class="pl-c1">42</span> -<span class="pl-c1">80</span> -<span class="pl-c1">70</span>]; <span class="pl-c"><span class="pl-c">%</span> [30 48 -80 -58]</span>
mocha_simple_plot(month,depth,variable,region)</pre></div>
<p><a href="png/mocha_simple_plot1.png" target="_blank" rel="nofollow"><img src="png/mocha_simple_plot1.png" width="600" style="max-width:100%;"></a></p>
</article>
</div>
</div>
</div>
</div>
</div>
<div> </div>
</div><script>
function showCanonicalImages() {
var images = document.getElementsByTagName('img');
if (!images) {
return;
}
for (var index = 0; index < images.length; index++) {
var image = images[index];
if (image.getAttribute('data-canonical-src') && image.src !== image.getAttribute('data-canonical-src')) {
image.src = image.getAttribute('data-canonical-src');
}
}
}
function scrollToHash() {
if (location.hash && !document.querySelector(':target')) {
var element = document.getElementById('user-content-' + location.hash.slice(1));
if (element) {
element.scrollIntoView();
}
}
}
function autorefreshContent(eventSourceUrl) {
var initialTitle = document.title;
var contentElement = document.getElementById('grip-content');
var source = new EventSource(eventSourceUrl);
var isRendering = false;
source.onmessage = function(ev) {
var msg = JSON.parse(ev.data);
if (msg.updating) {
isRendering = true;
document.title = '(Rendering) ' + document.title;
} else {
isRendering = false;
document.title = initialTitle;
contentElement.innerHTML = msg.content;
showCanonicalImages();
}
}
source.onerror = function(e) {
if (e.readyState === EventSource.CLOSED && isRendering) {
isRendering = false;
document.title = initialTitle;
}
}
}
window.onhashchange = function() {
scrollToHash();
}
window.onload = function() {
scrollToHash();
}
showCanonicalImages();
var autorefreshUrl = document.getElementById('preview-page').getAttribute('data-autorefresh-url');
if (autorefreshUrl) {
autorefreshContent(autorefreshUrl);
}
</script>
</body>
</html>