File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
from matplotlib .testing .decorators import image_comparison
4
4
import matplotlib .pyplot as plt
5
+ from matplotlib .scale import Log10Transform , InvertedLog10Transform
5
6
import numpy as np
6
7
import io
7
8
import pytest
@@ -80,12 +81,19 @@ def test_logscale_invert_transform():
80
81
# get transformation from data to axes
81
82
tform = (ax .transAxes + ax .transData .inverted ()).inverted ()
82
83
84
+ # direct test of log transform inversion
85
+ assert isinstance (Log10Transform ().inverted (), InvertedLog10Transform )
83
86
84
87
def test_logscale_transform_repr ():
88
+ # check that repr of log transform succeeds
85
89
fig , ax = plt .subplots ()
86
90
ax .set_yscale ('log' )
87
91
s = repr (ax .transData )
88
92
93
+ # check that repr of log transform returns correct string
94
+ s = repr (Log10Transform (nonpos = 'clip' ))
95
+ assert s == "Log10Transform('clip')"
96
+
89
97
90
98
@image_comparison (baseline_images = ['logscale_nonpos_values' ], remove_text = True ,
91
99
extensions = ['png' ], style = 'mpl20' )
You can’t perform that action at this time.
0 commit comments