Skip to content
This repository

Fix suptitle #1663

Merged
merged 3 commits into from about 1 year ago

5 participants

Damon McDougall Varoquaux Phil Elson Benjamin Root Michael Droettboom
Damon McDougall
Collaborator

New version of #1276 but which targets v1.2.x and includes a test.

If there's no feedback I'll merge this in a day or two. I'd at least like @NelleV to check PEP8-ness, if you wouldn't mind :)

Varoquaux NelleV commented on the diff January 15, 2013
lib/matplotlib/tests/test_figure.py
... ...
@@ -65,6 +65,13 @@ def test_gca():
65 65
     assert_true(fig.gca(projection='rectilinear') is ax1)
66 66
     assert_true(fig.gca() is ax1)
67 67
 
1
Varoquaux Collaborator
NelleV added a note January 15, 2013

PEP8 compliance: you need two blank lines here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Varoquaux NelleV commented on the diff January 15, 2013
lib/matplotlib/tests/test_figure.py
... ...
@@ -65,6 +65,13 @@ def test_gca():
65 65
     assert_true(fig.gca(projection='rectilinear') is ax1)
66 66
     assert_true(fig.gca() is ax1)
67 67
 
  68
+@image_comparison(baseline_images=['figure_suptitle'])
  69
+def test_suptitle():
  70
+    fig = plt.figure()
  71
+    ax = fig.add_subplot(1, 1, 1)
  72
+    fig.suptitle('hello', color='r')
  73
+    fig.suptitle('title', color='g', rotation='30')
  74
+
1
Varoquaux Collaborator
NelleV added a note January 15, 2013

And here too !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Varoquaux
Collaborator

I've underlined the two PEP8 problem. Else, the code looks good to me.

Damon McDougall
Collaborator

Wooo! A legitimate test failure!

@pelson Do you have any idea why that pickle test is failing? Looks like that title in the pickle baseline image is a suptitle, but the kwargs are still being set just as they were before this change. Perhaps the addition of a self._suptitle variable affects how the figure object gets pickled.

Phil Elson
Collaborator

@dmcdougall - I'll have a butchers tomorrow at this for you. Has the result image gained a suptitle that wasn't there before?

Damon McDougall
Collaborator

@pelson Another travis downside: I can't access the failing image. I'll run the test locally and report back.

Damon McDougall
Collaborator

@pelson The produced image doesn't have a suptitle. Will look into it.

Damon McDougall
Collaborator

I've found the issue. Since the suptitle (a Text object) now persists in the Figure class, having remove_text=True in the image_comparison decorator for the test_pickle test removes the text when producing the resulting image.

There are a couple of ways to proceed:

1) Remove remove_text=True, resulting in a persisting suptitle but potentially causing further failures because of text issues.

2) Keep remove_text=True and remove the suptitle. There is an additional check inside test_pickle to ensure that figure labels are preserved on unpickling. Downside is a new baseline image has to be committed.

3) Don't merge this pull request.

I think 3) is overly harsh. I'd prefer to execute option 2), but if there is a consensus for 1), then I'm fine with that too.

Benjamin Root
Collaborator
Michael Droettboom
Owner

Ditto for option 2.

Damon McDougall
Collaborator

Done.

lib/matplotlib/figure.py
... ...
@@ -491,8 +492,10 @@ def suptitle(self, t, **kwargs):
491 492
         if ('verticalalignment' not in kwargs) and ('va' not in kwargs):
492 493
             kwargs['verticalalignment'] = 'top'
493 494
 
494  
-        t = self.text(x, y, t, **kwargs)
495  
-        return t
  495
+        if self._suptitle is not None:
  496
+            self._suptitle.set_text('')
3
Phil Elson Collaborator
pelson added a note January 17, 2013

I think this should call the .remove() method, rather than just making it a null Text object.

Damon McDougall Collaborator

Or perhaps .update, and put the line below inside an else:?

Phil Elson Collaborator
pelson added a note January 17, 2013

Either way works. :wink:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Damon McDougall
Collaborator

@pelson Better?

Phil Elson
Collaborator

Yep. :+1: from me. @NelleV - are you happy with it?

Varoquaux
Collaborator

LGTM: :+1: for merging

Damon McDougall
Collaborator

Ok. I'll clean up the commit history and merge this (py31 failure is a dud). Thanks.

Damon McDougall dmcdougall merged commit 527fd07 into from January 18, 2013
Damon McDougall dmcdougall closed this January 18, 2013
Thomas A Caswell tacaswell referenced this pull request from a commit January 22, 2013
Commit has since been removed from the repository and is no longer available.
Thomas A Caswell tacaswell referenced this pull request from a commit in tacaswell/matplotlib January 22, 2013
Thomas A Caswell Fixed code added in 0c20b5c
(PR #1505).

Tests added is #1663 pass with this patch.
17fa943
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
11  lib/matplotlib/figure.py
@@ -319,6 +319,7 @@ def __init__(self,
319 319
 
320 320
         self._hold = rcParams['axes.hold']
321 321
         self.canvas = None
  322
+        self._suptitle = None
322 323
 
323 324
         if subplotpars is None:
324 325
             subplotpars = SubplotParams()
@@ -491,8 +492,14 @@ def suptitle(self, t, **kwargs):
491 492
         if ('verticalalignment' not in kwargs) and ('va' not in kwargs):
492 493
             kwargs['verticalalignment'] = 'top'
493 494
 
494  
-        t = self.text(x, y, t, **kwargs)
495  
-        return t
  495
+        sup = self.text(x, y, t, **kwargs)
  496
+        if self._suptitle is not None:
  497
+            self._suptitle.set_text(t)
  498
+            self._suptitle.set_position((x, y))
  499
+            self._suptitle.update_from(sup)
  500
+        else:
  501
+            self._suptitle = sup
  502
+        return self._suptitle
496 503
 
497 504
     def set_canvas(self, canvas):
498 505
         """
BIN  lib/matplotlib/tests/baseline_images/test_figure/figure_suptitle.pdf
Binary file not shown
BIN  lib/matplotlib/tests/baseline_images/test_figure/figure_suptitle.png
552  lib/matplotlib/tests/baseline_images/test_figure/figure_suptitle.svg
... ...
@@ -0,0 +1,552 @@
  1
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
  2
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
  3
+  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
  4
+<!-- Created with matplotlib (http://matplotlib.org/) -->
  5
+<svg height="432pt" version="1.1" viewBox="0 0 576 432" width="576pt" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  6
+ <defs>
  7
+  <style type="text/css">
  8
+*{stroke-linecap:square;stroke-linejoin:round;}
  9
+  </style>
  10
+ </defs>
  11
+ <g id="figure_1">
  12
+  <g id="patch_1">
  13
+   <path d="
  14
+M0 432
  15
+L576 432
  16
+L576 0
  17
+L0 0
  18
+z
  19
+" style="fill:#ffffff;"/>
  20
+  </g>
  21
+  <g id="axes_1">
  22
+   <g id="patch_2">
  23
+    <path d="
  24
+M72 388.8
  25
+L518.4 388.8
  26
+L518.4 43.2
  27
+L72 43.2
  28
+z
  29
+" style="fill:#ffffff;"/>
  30
+   </g>
  31
+   <g id="matplotlib.axis_1">
  32
+    <g id="xtick_1">
  33
+     <g id="line2d_1">
  34
+      <defs>
  35
+       <path d="
  36
+M0 0
  37
+L0 -4" id="mcb557df647" style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;"/>
  38
+      </defs>
  39
+      <g>
  40
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="72.0" xlink:href="#mcb557df647" y="388.8"/>
  41
+      </g>
  42
+     </g>
  43
+     <g id="line2d_2">
  44
+      <defs>
  45
+       <path d="
  46
+M0 0
  47
+L0 4" id="mdad270ee8e" style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;"/>
  48
+      </defs>
  49
+      <g>
  50
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="72.0" xlink:href="#mdad270ee8e" y="43.2"/>
  51
+      </g>
  52
+     </g>
  53
+     <g id="text_1">
  54
+      <!-- 0.0 -->
  55
+      <defs>
  56
+       <path d="
  57
+M31.7812 66.4062
  58
+Q24.1719 66.4062 20.3281 58.9062
  59
+Q16.5 51.4219 16.5 36.375
  60
+Q16.5 21.3906 20.3281 13.8906
  61
+Q24.1719 6.39062 31.7812 6.39062
  62
+Q39.4531 6.39062 43.2812 13.8906
  63
+Q47.125 21.3906 47.125 36.375
  64
+Q47.125 51.4219 43.2812 58.9062
  65
+Q39.4531 66.4062 31.7812 66.4062
  66
+M31.7812 74.2188
  67
+Q44.0469 74.2188 50.5156 64.5156
  68
+Q56.9844 54.8281 56.9844 36.375
  69
+Q56.9844 17.9688 50.5156 8.26562
  70
+Q44.0469 -1.42188 31.7812 -1.42188
  71
+Q19.5312 -1.42188 13.0625 8.26562
  72
+Q6.59375 17.9688 6.59375 36.375
  73
+Q6.59375 54.8281 13.0625 64.5156
  74
+Q19.5312 74.2188 31.7812 74.2188" id="BitstreamVeraSans-Roman-30"/>
  75
+       <path d="
  76
+M10.6875 12.4062
  77
+L21 12.4062
  78
+L21 0
  79
+L10.6875 0
  80
+z
  81
+" id="BitstreamVeraSans-Roman-2e"/>
  82
+      </defs>
  83
+      <g transform="translate(63.2521875 401.70625)scale(0.12 -0.12)">
  84
+       <use xlink:href="#BitstreamVeraSans-Roman-30"/>
  85
+       <use x="63.623046875" xlink:href="#BitstreamVeraSans-Roman-2e"/>
  86
+       <use x="95.41015625" xlink:href="#BitstreamVeraSans-Roman-30"/>
  87
+      </g>
  88
+     </g>
  89
+    </g>
  90
+    <g id="xtick_2">
  91
+     <g id="line2d_3">
  92
+      <g>
  93
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="161.28" xlink:href="#mcb557df647" y="388.8"/>
  94
+      </g>
  95
+     </g>
  96
+     <g id="line2d_4">
  97
+      <g>
  98
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="161.28" xlink:href="#mdad270ee8e" y="43.2"/>
  99
+      </g>
  100
+     </g>
  101
+     <g id="text_2">
  102
+      <!-- 0.2 -->
  103
+      <defs>
  104
+       <path d="
  105
+M19.1875 8.29688
  106
+L53.6094 8.29688
  107
+L53.6094 0
  108
+L7.32812 0
  109
+L7.32812 8.29688
  110
+Q12.9375 14.1094 22.625 23.8906
  111
+Q32.3281 33.6875 34.8125 36.5312
  112
+Q39.5469 41.8438 41.4219 45.5312
  113
+Q43.3125 49.2188 43.3125 52.7812
  114
+Q43.3125 58.5938 39.2344 62.25
  115
+Q35.1562 65.9219 28.6094 65.9219
  116
+Q23.9688 65.9219 18.8125 64.3125
  117
+Q13.6719 62.7031 7.8125 59.4219
  118
+L7.8125 69.3906
  119
+Q13.7656 71.7812 18.9375 73
  120
+Q24.125 74.2188 28.4219 74.2188
  121
+Q39.75 74.2188 46.4844 68.5469
  122
+Q53.2188 62.8906 53.2188 53.4219
  123
+Q53.2188 48.9219 51.5312 44.8906
  124
+Q49.8594 40.875 45.4062 35.4062
  125
+Q44.1875 33.9844 37.6406 27.2188
  126
+Q31.1094 20.4531 19.1875 8.29688" id="BitstreamVeraSans-Roman-32"/>
  127
+      </defs>
  128
+      <g transform="translate(152.7346875 401.70625)scale(0.12 -0.12)">
  129
+       <use xlink:href="#BitstreamVeraSans-Roman-30"/>
  130
+       <use x="63.623046875" xlink:href="#BitstreamVeraSans-Roman-2e"/>
  131
+       <use x="95.41015625" xlink:href="#BitstreamVeraSans-Roman-32"/>
  132
+      </g>
  133
+     </g>
  134
+    </g>
  135
+    <g id="xtick_3">
  136
+     <g id="line2d_5">
  137
+      <g>
  138
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="250.56" xlink:href="#mcb557df647" y="388.8"/>
  139
+      </g>
  140
+     </g>
  141
+     <g id="line2d_6">
  142
+      <g>
  143
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="250.56" xlink:href="#mdad270ee8e" y="43.2"/>
  144
+      </g>
  145
+     </g>
  146
+     <g id="text_3">
  147
+      <!-- 0.4 -->
  148
+      <defs>
  149
+       <path d="
  150
+M37.7969 64.3125
  151
+L12.8906 25.3906
  152
+L37.7969 25.3906
  153
+z
  154
+
  155
+M35.2031 72.9062
  156
+L47.6094 72.9062
  157
+L47.6094 25.3906
  158
+L58.0156 25.3906
  159
+L58.0156 17.1875
  160
+L47.6094 17.1875
  161
+L47.6094 0
  162
+L37.7969 0
  163
+L37.7969 17.1875
  164
+L4.89062 17.1875
  165
+L4.89062 26.7031
  166
+z
  167
+" id="BitstreamVeraSans-Roman-34"/>
  168
+      </defs>
  169
+      <g transform="translate(241.7503125 401.70625)scale(0.12 -0.12)">
  170
+       <use xlink:href="#BitstreamVeraSans-Roman-30"/>
  171
+       <use x="63.623046875" xlink:href="#BitstreamVeraSans-Roman-2e"/>
  172
+       <use x="95.41015625" xlink:href="#BitstreamVeraSans-Roman-34"/>
  173
+      </g>
  174
+     </g>
  175
+    </g>
  176
+    <g id="xtick_4">
  177
+     <g id="line2d_7">
  178
+      <g>
  179
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="339.84" xlink:href="#mcb557df647" y="388.8"/>
  180
+      </g>
  181
+     </g>
  182
+     <g id="line2d_8">
  183
+      <g>
  184
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="339.84" xlink:href="#mdad270ee8e" y="43.2"/>
  185
+      </g>
  186
+     </g>
  187
+     <g id="text_4">
  188
+      <!-- 0.6 -->
  189
+      <defs>
  190
+       <path d="
  191
+M33.0156 40.375
  192
+Q26.375 40.375 22.4844 35.8281
  193
+Q18.6094 31.2969 18.6094 23.3906
  194
+Q18.6094 15.5312 22.4844 10.9531
  195
+Q26.375 6.39062 33.0156 6.39062
  196
+Q39.6562 6.39062 43.5312 10.9531
  197
+Q47.4062 15.5312 47.4062 23.3906
  198
+Q47.4062 31.2969 43.5312 35.8281
  199
+Q39.6562 40.375 33.0156 40.375
  200
+M52.5938 71.2969
  201
+L52.5938 62.3125
  202
+Q48.875 64.0625 45.0938 64.9844
  203
+Q41.3125 65.9219 37.5938 65.9219
  204
+Q27.8281 65.9219 22.6719 59.3281
  205
+Q17.5312 52.7344 16.7969 39.4062
  206
+Q19.6719 43.6562 24.0156 45.9219
  207
+Q28.375 48.1875 33.5938 48.1875
  208
+Q44.5781 48.1875 50.9531 41.5156
  209
+Q57.3281 34.8594 57.3281 23.3906
  210
+Q57.3281 12.1562 50.6875 5.35938
  211
+Q44.0469 -1.42188 33.0156 -1.42188
  212
+Q20.3594 -1.42188 13.6719 8.26562
  213
+Q6.98438 17.9688 6.98438 36.375
  214
+Q6.98438 53.6562 15.1875 63.9375
  215
+Q23.3906 74.2188 37.2031 74.2188
  216
+Q40.9219 74.2188 44.7031 73.4844
  217
+Q48.4844 72.75 52.5938 71.2969" id="BitstreamVeraSans-Roman-36"/>
  218
+      </defs>
  219
+      <g transform="translate(331.0715625 401.70625)scale(0.12 -0.12)">
  220
+       <use xlink:href="#BitstreamVeraSans-Roman-30"/>
  221
+       <use x="63.623046875" xlink:href="#BitstreamVeraSans-Roman-2e"/>
  222
+       <use x="95.41015625" xlink:href="#BitstreamVeraSans-Roman-36"/>
  223
+      </g>
  224
+     </g>
  225
+    </g>
  226
+    <g id="xtick_5">
  227
+     <g id="line2d_9">
  228
+      <g>
  229
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="429.12" xlink:href="#mcb557df647" y="388.8"/>
  230
+      </g>
  231
+     </g>
  232
+     <g id="line2d_10">
  233
+      <g>
  234
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="429.12" xlink:href="#mdad270ee8e" y="43.2"/>
  235
+      </g>
  236
+     </g>
  237
+     <g id="text_5">
  238
+      <!-- 0.8 -->
  239
+      <defs>
  240
+       <path d="
  241
+M31.7812 34.625
  242
+Q24.75 34.625 20.7188 30.8594
  243
+Q16.7031 27.0938 16.7031 20.5156
  244
+Q16.7031 13.9219 20.7188 10.1562
  245
+Q24.75 6.39062 31.7812 6.39062
  246
+Q38.8125 6.39062 42.8594 10.1719
  247
+Q46.9219 13.9688 46.9219 20.5156
  248
+Q46.9219 27.0938 42.8906 30.8594
  249
+Q38.875 34.625 31.7812 34.625
  250
+M21.9219 38.8125
  251
+Q15.5781 40.375 12.0312 44.7188
  252
+Q8.5 49.0781 8.5 55.3281
  253
+Q8.5 64.0625 14.7188 69.1406
  254
+Q20.9531 74.2188 31.7812 74.2188
  255
+Q42.6719 74.2188 48.875 69.1406
  256
+Q55.0781 64.0625 55.0781 55.3281
  257
+Q55.0781 49.0781 51.5312 44.7188
  258
+Q48 40.375 41.7031 38.8125
  259
+Q48.8281 37.1562 52.7969 32.3125
  260
+Q56.7812 27.4844 56.7812 20.5156
  261
+Q56.7812 9.90625 50.3125 4.23438
  262
+Q43.8438 -1.42188 31.7812 -1.42188
  263
+Q19.7344 -1.42188 13.25 4.23438
  264
+Q6.78125 9.90625 6.78125 20.5156
  265
+Q6.78125 27.4844 10.7812 32.3125
  266
+Q14.7969 37.1562 21.9219 38.8125
  267
+M18.3125 54.3906
  268
+Q18.3125 48.7344 21.8438 45.5625
  269
+Q25.3906 42.3906 31.7812 42.3906
  270
+Q38.1406 42.3906 41.7188 45.5625
  271
+Q45.3125 48.7344 45.3125 54.3906
  272
+Q45.3125 60.0625 41.7188 63.2344
  273
+Q38.1406 66.4062 31.7812 66.4062
  274
+Q25.3906 66.4062 21.8438 63.2344
  275
+Q18.3125 60.0625 18.3125 54.3906" id="BitstreamVeraSans-Roman-38"/>
  276
+      </defs>
  277
+      <g transform="translate(420.384375 401.70625)scale(0.12 -0.12)">
  278
+       <use xlink:href="#BitstreamVeraSans-Roman-30"/>
  279
+       <use x="63.623046875" xlink:href="#BitstreamVeraSans-Roman-2e"/>
  280
+       <use x="95.41015625" xlink:href="#BitstreamVeraSans-Roman-38"/>
  281
+      </g>
  282
+     </g>
  283
+    </g>
  284
+    <g id="xtick_6">
  285
+     <g id="line2d_11">
  286
+      <g>
  287
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="518.4" xlink:href="#mcb557df647" y="388.8"/>
  288
+      </g>
  289
+     </g>
  290
+     <g id="line2d_12">
  291
+      <g>
  292
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="518.4" xlink:href="#mdad270ee8e" y="43.2"/>
  293
+      </g>
  294
+     </g>
  295
+     <g id="text_6">
  296
+      <!-- 1.0 -->
  297
+      <defs>
  298
+       <path d="
  299
+M12.4062 8.29688
  300
+L28.5156 8.29688
  301
+L28.5156 63.9219
  302
+L10.9844 60.4062
  303
+L10.9844 69.3906
  304
+L28.4219 72.9062
  305
+L38.2812 72.9062
  306
+L38.2812 8.29688
  307
+L54.3906 8.29688
  308
+L54.3906 0
  309
+L12.4062 0
  310
+z
  311
+" id="BitstreamVeraSans-Roman-31"/>
  312
+      </defs>
  313
+      <g transform="translate(509.915625 401.70625)scale(0.12 -0.12)">
  314
+       <use xlink:href="#BitstreamVeraSans-Roman-31"/>
  315
+       <use x="63.623046875" xlink:href="#BitstreamVeraSans-Roman-2e"/>
  316
+       <use x="95.41015625" xlink:href="#BitstreamVeraSans-Roman-30"/>
  317
+      </g>
  318
+     </g>
  319
+    </g>
  320
+   </g>
  321
+   <g id="matplotlib.axis_2">
  322
+    <g id="ytick_1">
  323
+     <g id="line2d_13">
  324
+      <defs>
  325
+       <path d="
  326
+M0 0
  327
+L4 0" id="mc8fcea1516" style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;"/>
  328
+      </defs>
  329
+      <g>
  330
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="72.0" xlink:href="#mc8fcea1516" y="388.8"/>
  331
+      </g>
  332
+     </g>
  333
+     <g id="line2d_14">
  334
+      <defs>
  335
+       <path d="
  336
+M0 0
  337
+L-4 0" id="m0d5b0a6425" style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;"/>
  338
+      </defs>
  339
+      <g>
  340
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="518.4" xlink:href="#m0d5b0a6425" y="388.8"/>
  341
+      </g>
  342
+     </g>
  343
+     <g id="text_7">
  344
+      <!-- 0.0 -->
  345
+      <g transform="translate(50.504375 393.1678125)scale(0.12 -0.12)">
  346
+       <use xlink:href="#BitstreamVeraSans-Roman-30"/>
  347
+       <use x="63.623046875" xlink:href="#BitstreamVeraSans-Roman-2e"/>
  348
+       <use x="95.41015625" xlink:href="#BitstreamVeraSans-Roman-30"/>
  349
+      </g>
  350
+     </g>
  351
+    </g>
  352
+    <g id="ytick_2">
  353
+     <g id="line2d_15">
  354
+      <g>
  355
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="72.0" xlink:href="#mc8fcea1516" y="319.68"/>
  356
+      </g>
  357
+     </g>
  358
+     <g id="line2d_16">
  359
+      <g>
  360
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="518.4" xlink:href="#m0d5b0a6425" y="319.68"/>
  361
+      </g>
  362
+     </g>
  363
+     <g id="text_8">
  364
+      <!-- 0.2 -->
  365
+      <g transform="translate(50.909375 324.0478125)scale(0.12 -0.12)">
  366
+       <use xlink:href="#BitstreamVeraSans-Roman-30"/>
  367
+       <use x="63.623046875" xlink:href="#BitstreamVeraSans-Roman-2e"/>
  368
+       <use x="95.41015625" xlink:href="#BitstreamVeraSans-Roman-32"/>
  369
+      </g>
  370
+     </g>
  371
+    </g>
  372
+    <g id="ytick_3">
  373
+     <g id="line2d_17">
  374
+      <g>
  375
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="72.0" xlink:href="#mc8fcea1516" y="250.56"/>
  376
+      </g>
  377
+     </g>
  378
+     <g id="line2d_18">
  379
+      <g>
  380
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="518.4" xlink:href="#m0d5b0a6425" y="250.56"/>
  381
+      </g>
  382
+     </g>
  383
+     <g id="text_9">
  384
+      <!-- 0.4 -->
  385
+      <g transform="translate(50.380625 254.9278125)scale(0.12 -0.12)">
  386
+       <use xlink:href="#BitstreamVeraSans-Roman-30"/>
  387
+       <use x="63.623046875" xlink:href="#BitstreamVeraSans-Roman-2e"/>
  388
+       <use x="95.41015625" xlink:href="#BitstreamVeraSans-Roman-34"/>
  389
+      </g>
  390
+     </g>
  391
+    </g>
  392
+    <g id="ytick_4">
  393
+     <g id="line2d_19">
  394
+      <g>
  395
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="72.0" xlink:href="#mc8fcea1516" y="181.44"/>
  396
+      </g>
  397
+     </g>
  398
+     <g id="line2d_20">
  399
+      <g>
  400
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="518.4" xlink:href="#m0d5b0a6425" y="181.44"/>
  401
+      </g>
  402
+     </g>
  403
+     <g id="text_10">
  404
+      <!-- 0.6 -->
  405
+      <g transform="translate(50.463125 185.8078125)scale(0.12 -0.12)">
  406
+       <use xlink:href="#BitstreamVeraSans-Roman-30"/>
  407
+       <use x="63.623046875" xlink:href="#BitstreamVeraSans-Roman-2e"/>
  408
+       <use x="95.41015625" xlink:href="#BitstreamVeraSans-Roman-36"/>
  409
+      </g>
  410
+     </g>
  411
+    </g>
  412
+    <g id="ytick_5">
  413
+     <g id="line2d_21">
  414
+      <g>
  415
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="72.0" xlink:href="#mc8fcea1516" y="112.32"/>
  416
+      </g>
  417
+     </g>
  418
+     <g id="line2d_22">
  419
+      <g>
  420
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="518.4" xlink:href="#m0d5b0a6425" y="112.32"/>
  421
+      </g>
  422
+     </g>
  423
+     <g id="text_11">
  424
+      <!-- 0.8 -->
  425
+      <g transform="translate(50.52875 116.6878125)scale(0.12 -0.12)">
  426
+       <use xlink:href="#BitstreamVeraSans-Roman-30"/>
  427
+       <use x="63.623046875" xlink:href="#BitstreamVeraSans-Roman-2e"/>
  428
+       <use x="95.41015625" xlink:href="#BitstreamVeraSans-Roman-38"/>
  429
+      </g>
  430
+     </g>
  431
+    </g>
  432
+    <g id="ytick_6">
  433
+     <g id="line2d_23">
  434
+      <g>
  435
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="72.0" xlink:href="#mc8fcea1516" y="43.2"/>
  436
+      </g>
  437
+     </g>
  438
+     <g id="line2d_24">
  439
+      <g>
  440
+       <use style="stroke:#000000;stroke-linecap:butt;stroke-width:0.5;" x="518.4" xlink:href="#m0d5b0a6425" y="43.2"/>
  441
+      </g>
  442
+     </g>
  443
+     <g id="text_12">
  444
+      <!-- 1.0 -->
  445
+      <g transform="translate(51.03125 47.5678125)scale(0.12 -0.12)">
  446
+       <use xlink:href="#BitstreamVeraSans-Roman-31"/>
  447
+       <use x="63.623046875" xlink:href="#BitstreamVeraSans-Roman-2e"/>
  448
+       <use x="95.41015625" xlink:href="#BitstreamVeraSans-Roman-30"/>
  449
+      </g>
  450
+     </g>
  451
+    </g>
  452
+   </g>
  453
+   <g id="patch_3">
  454
+    <path d="
  455
+M72 43.2
  456
+L518.4 43.2" style="fill:none;stroke:#000000;"/>
  457
+   </g>
  458
+   <g id="patch_4">
  459
+    <path d="
  460
+M518.4 388.8
  461
+L518.4 43.2" style="fill:none;stroke:#000000;"/>
  462
+   </g>
  463
+   <g id="patch_5">
  464
+    <path d="
  465
+M72 388.8
  466
+L518.4 388.8" style="fill:none;stroke:#000000;"/>
  467
+   </g>
  468
+   <g id="patch_6">
  469
+    <path d="
  470
+M72 388.8
  471
+L72 43.2" style="fill:none;stroke:#000000;"/>
  472
+   </g>
  473
+  </g>
  474
+  <g id="text_13">
  475
+   <!-- title -->
  476
+   <defs>
  477
+    <path d="
  478
+M56.2031 29.5938
  479
+L56.2031 25.2031
  480
+L14.8906 25.2031
  481
+Q15.4844 15.9219 20.4844 11.0625
  482
+Q25.4844 6.20312 34.4219 6.20312
  483
+Q39.5938 6.20312 44.4531 7.46875
  484
+Q49.3125 8.73438 54.1094 11.2812
  485
+L54.1094 2.78125
  486
+Q49.2656 0.734375 44.1875 -0.34375
  487
+Q39.1094 -1.42188 33.8906 -1.42188
  488
+Q20.7969 -1.42188 13.1562 6.1875
  489
+Q5.51562 13.8125 5.51562 26.8125
  490
+Q5.51562 40.2344 12.7656 48.1094
  491
+Q20.0156 56 32.3281 56
  492
+Q43.3594 56 49.7812 48.8906
  493
+Q56.2031 41.7969 56.2031 29.5938
  494
+M47.2188 32.2344
  495
+Q47.125 39.5938 43.0938 43.9844
  496
+Q39.0625 48.3906 32.4219 48.3906
  497
+Q24.9062 48.3906 20.3906 44.1406
  498
+Q15.875 39.8906 15.1875 32.1719
  499
+z
  500
+" id="BitstreamVeraSans-Roman-65"/>
  501
+    <path d="
  502
+M18.3125 70.2188
  503
+L18.3125 54.6875
  504
+L36.8125 54.6875
  505
+L36.8125 47.7031
  506
+L18.3125 47.7031
  507
+L18.3125 18.0156
  508
+Q18.3125 11.3281 20.1406 9.42188
  509
+Q21.9688 7.51562 27.5938 7.51562
  510
+L36.8125 7.51562
  511
+L36.8125 0
  512
+L27.5938 0
  513
+Q17.1875 0 13.2344 3.875
  514
+Q9.28125 7.76562 9.28125 18.0156
  515
+L9.28125 47.7031
  516
+L2.6875 47.7031
  517
+L2.6875 54.6875
  518
+L9.28125 54.6875
  519
+L9.28125 70.2188
  520
+z
  521
+" id="BitstreamVeraSans-Roman-74"/>
  522
+    <path d="
  523
+M9.42188 54.6875
  524
+L18.4062 54.6875
  525
+L18.4062 0
  526
+L9.42188 0
  527
+z
  528
+
  529
+M9.42188 75.9844
  530
+L18.4062 75.9844
  531
+L18.4062 64.5938
  532
+L9.42188 64.5938
  533
+z
  534
+" id="BitstreamVeraSans-Roman-69"/>
  535
+    <path d="
  536
+M9.42188 75.9844
  537
+L18.4062 75.9844
  538
+L18.4062 0
  539
+L9.42188 0
  540
+z
  541
+" id="BitstreamVeraSans-Roman-6c"/>
  542
+   </defs>
  543
+   <g style="fill:#008000;" transform="translate(280.580213606 27.7627309694)rotate(-30.0)scale(0.12 -0.12)">
  544
+    <use xlink:href="#BitstreamVeraSans-Roman-74"/>
  545
+    <use x="39.208984375" xlink:href="#BitstreamVeraSans-Roman-69"/>
  546
+    <use x="66.9921875" xlink:href="#BitstreamVeraSans-Roman-74"/>
  547
+    <use x="106.201171875" xlink:href="#BitstreamVeraSans-Roman-6c"/>
  548
+    <use x="133.984375" xlink:href="#BitstreamVeraSans-Roman-65"/>
  549
+   </g>
  550
+  </g>
  551
+ </g>
  552
+</svg>
BIN  lib/matplotlib/tests/baseline_images/test_pickle/multi_pickle.png
9  lib/matplotlib/tests/test_figure.py
@@ -65,6 +65,15 @@ def test_gca():
65 65
     assert_true(fig.gca(projection='rectilinear') is ax1)
66 66
     assert_true(fig.gca() is ax1)
67 67
 
  68
+
  69
+@image_comparison(baseline_images=['figure_suptitle'])
  70
+def test_suptitle():
  71
+    fig = plt.figure()
  72
+    ax = fig.add_subplot(1, 1, 1)
  73
+    fig.suptitle('hello', color='r')
  74
+    fig.suptitle('title', color='g', rotation='30')
  75
+
  76
+
68 77
 if __name__ == "__main__":
69 78
     import nose
70 79
     nose.runmodule(argv=['-s', '--with-doctest'], exit=False)
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.