File tree Expand file tree Collapse file tree 3 files changed +18
-10
lines changed
lib/matplotlib/sphinxext/tests Expand file tree Collapse file tree 3 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -84,8 +84,7 @@ def plot_file(num):
84
84
html_contents = fobj .read ()
85
85
assert_true ('# Only a comment' in html_contents )
86
86
# check plot defined in external file.
87
- assert_true (file_same (range_4 , plot_file (15 )))
88
- assert_true (file_same (range_6 , plot_file (16 )))
89
- assert_true (file_same (range_4 , plot_file (17 )))
87
+ assert_true (file_same (range_4 , pjoin (self .html_dir , 'range4.png' ))
88
+ assert_true (file_same (range_6 , pjoin (self .html_dir , 'range6.png' ))
90
89
# check if figure caption made it into html file
91
- assert_true ('This is the caption for plot 17 .' )
90
+ assert_true ('This is the caption for plot 15 .' )
Original file line number Diff line number Diff line change
1
+ from matplotlib import pyplot as plt
2
+
3
+ def range4 ():
4
+ '''This function should never be called if the plot_diective works as expected.'''
5
+ raise NotImplementedError
6
+
7
+ def range6 ():
8
+ plt .figure ()
9
+ plt .plot (range (6 ))
10
+ plt .show ()
Original file line number Diff line number Diff line change @@ -115,16 +115,15 @@ Plot 14 uses ``include-source``:
115
115
116
116
# Only a comment
117
117
118
- Plot 15 uses an external file with the plot commands:
118
+ Plot 15 uses an external file with the plot commands and a caption :
119
119
120
120
.. plot :: range4.py
121
121
122
+ This is the caption for plot 15.
123
+
124
+
122
125
Plot 16 uses a specific function in a file with plot commands:
123
126
124
- .. plot :: range4.py range6
125
-
126
- Plot 17 uses an external file and a caption:
127
+ .. plot :: range6.py range6
127
128
128
- .. plot :: range4.py
129
129
130
- This is the caption for plot 17.
You can’t perform that action at this time.
0 commit comments