Skip to content

Commit 0ff2dc4

Browse files
committed
cover contour edge cases with contourcarpet
1 parent e1caa9e commit 0ff2dc4

File tree

2 files changed

+114
-4
lines changed

2 files changed

+114
-4
lines changed
112 KB
Loading

test/image/mocks/cheater_contour.json

+114-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
},
1616
"colorbar": {
1717
"len": 0.4,
18-
"y": 0.25
18+
"y": 0.25,
19+
"x": 0.45
1920
},
2021
"z":[1, 1.96, 2.56, 3.0625, 4, 5.0625, 1, 7.5625, 9, 12.25, 15.21, 14.0625],
2122
"a":[0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3],
@@ -52,14 +53,16 @@
5253
"contours":{
5354
"start":1,
5455
"end":14,
55-
"size":1
56+
"size":1,
57+
"coloring": "lines"
5658
},
5759
"line":{
5860
"width":2
5961
},
6062
"colorbar": {
6163
"len": 0.4,
62-
"y": 0.75
64+
"y": 0.75,
65+
"x": 0.45
6366
},
6467
"z":[1, 1.96, 2.56, 3.0625, 4, 5.0625, 1, 7.5625, 9, 12.25, 15.21, 14.0625],
6568
"a":[0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3],
@@ -91,10 +94,103 @@
9194
},
9295
"xaxis":"x",
9396
"yaxis":"y2"
97+
},
98+
{
99+
"carpet":"c3",
100+
"type":"contourcarpet",
101+
"autocontour":false,
102+
"contours":{
103+
"start":-5,
104+
"end":20,
105+
"size":1,
106+
"coloring": "lines"
107+
},
108+
"line":{
109+
"width":2,
110+
"smoothing":0
111+
},
112+
"colorbar": {
113+
"len": 0.4,
114+
"y": 0.25
115+
},
116+
"z":[1, 1.96, 2.56, 3.0625, 4, 5.0625, 1, 7.5625, 9, 12.25, 15.21, 14.0625],
117+
"a":[0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3],
118+
"b":[4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6],
119+
"xaxis":"x2",
120+
"yaxis":"y"
121+
},
122+
{
123+
"carpet":"c3",
124+
"a":[0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3],
125+
"b":[4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6],
126+
"y":[1, 1.4, 1.6, 1.75, 2, 2.5, 2.7, 2.75, 3, 3.5, 3.7, 3.75],
127+
"x":[2, 3, 4, 5, 2.2, 3.1, 4.1, 5.1, 1.5, 2.5, 3.5, 4.5],
128+
"type":"carpet",
129+
"aaxis":{
130+
"tickprefix":"a = ",
131+
"smoothing":0,
132+
"minorgridcount":9,
133+
"type":"linear"
134+
},
135+
"baxis":{
136+
"tickprefix":"b = ",
137+
"smoothing":0,
138+
"minorgridcount":9,
139+
"type":"linear"
140+
},
141+
"xaxis":"x2",
142+
"yaxis":"y"
143+
},
144+
{
145+
"carpet":"c4",
146+
"type":"contourcarpet",
147+
"autocontour":false,
148+
"contours":{
149+
"start":-5,
150+
"end":20,
151+
"size":1
152+
},
153+
"line":{
154+
"width":2
155+
},
156+
"colorbar": {
157+
"len": 0.4,
158+
"y": 0.75
159+
},
160+
"z":[1, 1.96, 2.56, 3.0625, 4, 5.0625, 1, 7.5625, 9, 12.25, 15.21, 14.0625],
161+
"a":[0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3],
162+
"b":[4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6],
163+
"xaxis":"x2",
164+
"yaxis":"y2",
165+
"zmin":1,
166+
"zmax":15.21,
167+
"zauto":true
168+
},
169+
{
170+
"carpet":"c4",
171+
"a":[0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3],
172+
"b":[4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6],
173+
"y":[1, 1.4, 1.6, 1.75, 2, 2.5, 2.7, 2.75, 3, 3.5, 3.7, 3.75],
174+
"x":[2, 3, 4, 5, 2.2, 3.1, 4.1, 5.1, 1.5, 2.5, 3.5, 4.5],
175+
"type":"carpet",
176+
"aaxis":{
177+
"tickprefix":"a = ",
178+
"smoothing":1,
179+
"minorgridcount":9,
180+
"type":"linear"
181+
},
182+
"baxis":{
183+
"tickprefix":"b = ",
184+
"smoothing":1,
185+
"minorgridcount":9,
186+
"type":"linear"
187+
},
188+
"xaxis":"x2",
189+
"yaxis":"y2"
94190
}
95191
],
96192
"layout": {
97-
"width": 600,
193+
"width": 1000,
98194
"height": 600,
99195
"title": "Cheater plot with 1D input",
100196
"margin":{
@@ -125,6 +221,20 @@
125221
]
126222
},
127223
"xaxis":{
224+
"domain": [
225+
0,
226+
0.48
227+
],
228+
"range":[
229+
0.6676731793960924,
230+
5.932326820603907
231+
]
232+
},
233+
"xaxis2":{
234+
"domain": [
235+
0.52,
236+
1
237+
],
128238
"range":[
129239
0.6676731793960924,
130240
5.932326820603907

0 commit comments

Comments
 (0)