Skip to content

Commit d67c83a

Browse files
authored
Merge pull request #300 from UV-CDAT/issue_298_markers_default_size
Issue 298 markers default size
2 parents 30a3c98 + 399650e commit d67c83a

14 files changed

+144
-87
lines changed

docs/Jupyter/1D_Multi_line_Plots.ipynb

Lines changed: 44 additions & 39 deletions
Large diffs are not rendered by default.
79.3 KB
Loading

tests/basetaylortest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def setUp(self):
1313
self.data.id = "My Taylor Diagram Data"
1414
# Markers attributes for later
1515
self.ids = ["A1", "A2", "A3", "B", "C1", "C2", "C3"]
16-
self.sizes = [25., 5., 20., 20., 20., 20., 20., ]
16+
self.sizes = [2.5, 5, 2., 2., 2., 2., 2., ]
1717
self.symbols = [
1818
"square",
1919
"dot",

tests/test_vcs_1D_mintics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def testMintics(self):
1111
line.linecolor = "red" # Red color obviously
1212
line.linewidth = 2. # A bit thicker
1313
line.marker = "circle" #
14-
line.markersize = 10 # A bit bigger
14+
line.markersize = 1
1515
s = MV2.array(s)
1616
s.id = "sine"
1717
xaxis = s.getAxis(0)

tests/test_vcs_drawLinesAndMarkersLegend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def testDrawMarkerLegend(self):
88
["red", "blue", "green"], [
99
"solid", "dash", "dot"], [1, 4, 8],
1010
["blue", "green", "red"], [
11-
"cross", "square", "dot"], [3, 4, 5],
11+
"cross", "square", "dot"], [.2, .6, 5],
1212
["sample A", "type B", "thing C"], render=True, bg=self.bg)
1313

1414
fnm = "test_drawLinesAndMarkersLegend.png"
@@ -21,7 +21,7 @@ def testDrawMarkerLegend(self):
2121
t.legend.y2 = .65
2222
ids = ["Sea Level Pressure (ERA-Interim)","SW Cloud Forcing (CERES-EBAF 4.0)","LW Cloud Forcing (CERES-EBAF 4.0)","Land Precipitation (GPCP 2.2)","Ocean Precipitation (GPCP 2.2)","2-m temperature","More"]
2323
#ids = ["SLP(ERA-Interim)","A2","A3","B1","C1","C2","C3"]
24-
id_sizes = [15., 15., 15., 15., 15., 15., 15.,]
24+
id_sizes = [1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5,]
2525
id_colors = ["red","orange","green","cyan","blue","purple","black"]
2626
symbols = ["diamond","square_fill","circle","triangle_right_fill","triangle_left_fill","triangle_up_fill","triangle_down_fill"]
2727
colors = ["red","orange","green","cyan","blue","purple","black"]

tests/test_vcs_drawLinesAndMarkersLegend_2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def testDrawMarkerLegend(self):
1010
t.legend.y2 = .65
1111
ids = ["Sea Level Pressure (ERA-Interim)","SW Cloud Forcing (CERES-EBAF 4.0)","LW Cloud Forcing (CERES-EBAF 4.0)","Land Precipitation (GPCP 2.2)","Ocean Precipitation (GPCP 2.2)","2-m temperature","More"]
1212
#ids = ["SLP(ERA-Interim)","A2","A3","B1","C1","C2","C3"]
13-
id_sizes = [15., 15., 15., 15., 15., 15., 15.,]
13+
id_sizes = [1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5,]
1414
id_colors = ["red","orange","green","cyan","blue","purple","black"]
1515
symbols = ["diamond","square_fill","circle","triangle_right_fill","triangle_left_fill","triangle_up_fill","triangle_down_fill"]
1616
colors = ["red","orange","green","cyan","blue","purple","black"]

tests/test_vcs_markers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ def testVCSMarkers(self):
1212
# m.worldcoordinate=[-10,10,0,10]
1313
m.type = ['plus', 'diamond', 'square_fill', "hurricane"]
1414
m.color = [242, 243, 244, 242]
15-
m.size = [20, 20, 20, 5]
15+
m.size = [2, 2, 2, 150]
1616
self.x.plot(m, bg=self.bg)
1717
self.checkImage("test_vcs_markers.png")
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import basevcstest
2+
3+
4+
class TestVCSMarkers(basevcstest.VCSBaseTest):
5+
def testVCSMarkersUniform(self):
6+
names = ['dot', 'plus', 'star', 'circle', 'cross', 'diamond', 'triangle_up', 'triangle_down', 'triangle_down', 'triangle_left', 'triangle_right', 'square', 'diamond_fill', 'triangle_up_fill', 'triangle_down_fill', 'triangle_left_fill', 'triangle_right_fill', 'square_fill', 'hurricane', 'w00', 'w01', 'w02', 'w03', 'w04', 'w05', 'w06', 'w07', 'w08', 'w09', 'w10', 'w11', 'w12', 'w13', 'w14', 'w15', 'w16', 'w17', 'w18', 'w19', 'w20', 'w21', 'w22', 'w23', 'w24', 'w25', 'w26', 'w27', 'w28', 'w29', 'w30', 'w31', 'w32', 'w33', 'w34', 'w35', 'w36', 'w37', 'w38', 'w39', 'w40', 'w41', 'w42', 'w43', 'w44', 'w45', 'w46', 'w47', 'w48', 'w49', 'w50', 'w51', 'w52', 'w53', 'w54', 'w55', 'w56', 'w57', 'w58', 'w59', 'w60', 'w61', 'w62', 'w63', 'w64', 'w65', 'w66', 'w67', 'w68', 'w69', 'w70', 'w71', 'w72', 'w73', 'w74', 'w75', 'w76', 'w77', 'w78', 'w79', 'w80', 'w81', 'w82', 'w83', 'w84', 'w85', 'w86', 'w87', 'w88', 'w89', 'w90', 'w91', 'w92', 'w93', 'w94', 'w95', 'w96', 'w97', 'w98', 'w99', 'w100', 'w101', 'w102']
7+
8+
tmpl = self.x.createtemplate()
9+
10+
11+
tmpl.legend.x1 = .05
12+
tmpl.legend.x2 = .95
13+
14+
tmpl.legend.y1 = .05
15+
tmpl.legend.y2 = .95
16+
n = len(names)
17+
sizes = [1,]*18
18+
for i in range(len(names)-len(sizes)):
19+
sizes.append(1.)
20+
tmpl.drawLinesAndMarkersLegend(self.x, [[0,0,0,0]]*n,
21+
["solid",]*n,
22+
[1,]*n,
23+
["black",]*n,
24+
names,
25+
sizes,
26+
names
27+
)
28+
29+
self.checkImage("test_vcs_markers_uniform.png")
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import basevcstest
2+
3+
4+
class TestVCSMarkers(basevcstest.VCSBaseTest):
5+
def testVCSMarkersUniform(self):
6+
names = ['dot', 'plus', 'star', 'circle', 'cross', 'diamond', 'triangle_up', 'square', 'square_fill', 'hurricane', 'w00', 'w01']
7+
8+
tmpl = self.x.createtemplate()
9+
10+
11+
tmpl.legend.x1 = .05
12+
tmpl.legend.x2 = .95
13+
14+
tmpl.legend.y1 = .05
15+
tmpl.legend.y2 = .95
16+
n = len(names)
17+
size = 10.
18+
sizes = [size,]*n
19+
tmpl.drawLinesAndMarkersLegend(self.x, [[0,0,0,0]]*n,
20+
["solid",]*n,
21+
[size,]*n,
22+
["black",]*n,
23+
names,
24+
sizes,
25+
names
26+
)
27+
28+
self.checkImage("test_vcs_markers_uniform_2.png")

tests/test_vcs_star_triangle_markers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ def testStarTriangleMarker(self):
1414
m.x = [[.1], [.3], [.5], [.7], [.9]]
1515
m.y = [[.1], [.3], [.5], [.7], [.9]]
1616
m.color = [200, 150, 160, 175, 125]
17-
m.size = [50, 50, 50, 50, 50]
17+
m.size = [5, 5, 5, 5, 5]
1818
self.x.plot(m, bg=self.bg)
1919
self.checkImage("test_vcs_star_triangle_markers.png")

0 commit comments

Comments
 (0)