2013-04-29 5 views
1

matplotlib의 축이 대수/선형인지 쉽게 확인 할 수 있습니까? 나는이 방법을 쓸 수 matplotlib의 축 눈금 확인

{'_a': TransformWrapper(BlendedGenericTransform(IdentityTransform(),<matplotlib.scale.Log10Transform object at 0x10ffb3650>)), 
'_b': CompositeGenericTransform(BboxTransformFrom(TransformedBbox(Bbox('array([[ 0.00000000e+00, 1.00000000e+00],\n  [ 2.00000000e+03, 1.00000000e+08]])'), TransformWrapper(BlendedGenericTransform(IdentityTransform(),<matplotlib.scale.Log10Transform object at 0x10ffb3650>)))), BboxTransformTo(TransformedBbox(Bbox('array([[ 0.05482517, 0.05046296],\n  [ 0.96250543, 0.95810185]])'), BboxTransformTo(TransformedBbox(Bbox('array([[ 0., 0.],\n  [ 8., 6.]])'), Affine2D(array([[ 80., 0., 0.], 
     [ 0., 80., 0.], 
     [ 0., 0., 1.]]))))))), 
'_invalid': 2, 
'_parents': <WeakValueDictionary at 4572332904>, 
'_shorthand_name': '', 
'input_dims': 2, 
'output_dims': 2} 

가 subtransforms ax.transData._a._child 로그 스케일의 경우 확인하지만 난 그게 private 변수에 액세스하는 좋아하지 않는다 : 나는 입력하면

ax.transData.__dict__은 (도끼 semilogy이다), 내가 얻을 변수 이름이 바뀔 수 있기 때문에 오히려 유지할 수없는 것처럼 보입니다.

답변

4

도 (제대로 문서화) 함수 문자열을 반환 axis.get_scale()

scale_str = ax.get_yaxis().get_scale() 

있습니다.

+0

+1 개인 var에 의존하지 않기 때문에 +1. – fgb

1

은 규모가 ax.yaxis._scale에 숨겨져 밝혀 : 이것은 내가 필요 정확히 무엇 인 True을 반환

import matplotlib as mpl 
type(ax.yaxis._scale) == mpl.scale.LogScale 

.