File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33from matplotlib .testing .decorators import image_comparison
44import matplotlib .pyplot as plt
5+ from matplotlib .scale import Log10Transform , InvertedLog10Transform
56import numpy as np
67import io
78import pytest
@@ -80,12 +81,19 @@ def test_logscale_invert_transform():
8081 # get transformation from data to axes
8182 tform = (ax .transAxes + ax .transData .inverted ()).inverted ()
8283
84+ # direct test of log transform inversion
85+ assert isinstance (Log10Transform ().inverted (), InvertedLog10Transform )
8386
8487def test_logscale_transform_repr ():
88+ # check that repr of log transform succeeds
8589 fig , ax = plt .subplots ()
8690 ax .set_yscale ('log' )
8791 s = repr (ax .transData )
8892
93+ # check that repr of log transform returns correct string
94+ s = repr (Log10Transform (nonpos = 'clip' ))
95+ assert s == "Log10Transform('clip')"
96+
8997
9098@image_comparison (baseline_images = ['logscale_nonpos_values' ], remove_text = True ,
9199 extensions = ['png' ], style = 'mpl20' )
You can’t perform that action at this time.
0 commit comments