- This topic has 4개 답변, 3명 참여, and was last updated 6 years, 8 months 전에 by Sangwoo.
-
글쓴이글
-
-
JAEHEE회원
; Draw the plot
graph = plot(UT, density,yrange=[0.1,10^4],/ylog,TITLE=’DENSITY’, $
XTITLE=’UT’, YTITLE=’Density’, $
thick=1, color=’black’)graph.Save, (+fname1+’.jpg’), BORDER=10,RESOLUTION=300, /TRANSPARENT
이런식으로 플롯을 했습니다만 그래프를 보면 y축이 그냥 0.1 10 100 1000 이런식으로 나옵니다
이것을 10^-1,1,10,10^2 이런식으로 표기되게 하고싶은데 어떻게 하면 좋을까요? -
ChoiYoun회원
plot 함수의 TICKUNITS 키워드를 활용하시면 해결될 듯합니다. 즉, 아래와 같이 사용하시면 됩니다.
p = PLOT(xx, yy, /YLOG, YTICKUNITS = ‘Scientific’)
이 경우 축이 1.0 X 10^n 로 나타납니다.
축을 10^n 으로 표현하고 싶으시다면 아래 코드를 사용해보세요. 다만 이 경우 logticks_exp.pro 파일이 컴파일 되어야 합니다. 구글로 검색해서 찾으셔도 되고 아래 코드를 복사하셔도 됩니다.
p = PLOT(xx, yy, /YLOG, YTICKFORMAT = ‘logticks_exp’)
12345678910111213141516171819202122232425262728293031323334353637383940414243;+;; (C) Cooperative Institute for Meteorological Satellite Studies, 2000;; NAME:; logticks_exp;; PURPOSE:; Function to print logarithmic axis tickmarks with exponential; output.;; CATEGORY:; Graphics;; LANGUAGE:; IDL v5;; CALLING SEQUENCE:; PLOT, x, y, /YLOG, YICKFORMAT = 'logticks_exp';; INPUTS:; axis: the axis number. 0 for X axis, 1 for Y axis, 2 for Z axis.; index: the tick mark index which starts at 0.; value: the default tick mark value (a floating-point number);;; OUTPUTS:; Function returns a string containing the tick mark labels.;; CREATION HISTORY:; Written by: Paul van Delst, CIMSS/SSEC, 08-Nov-2000; paul.v...@ssec.wisc.edu;;-FUNCTION logticks_exp, axis, index, value; Determine the base-10 exponentexponent = LONG( ALOG10( value ) ); Construct the tickmark string based on the exponenttickmark = '10!E' + STRTRIM( STRING( exponent ), 2 ) + '!N'; Return the formatted tickmark stringRETURN, tickmarkEND-
JAEHEE회원
tickmark = '10!E' + STRTRIM( STRING( exponent ), 2 ) + '!N'
이부분의 코드가 이상한거 같은데 한번 다시 봐주시겠어요?
-
-
ChoiYoun회원
위의 답변에 작성한 코드는 웹페이지 편집기의 인코딩 문제로 tickmark 변수가 이상하게 표기되는 듯합니다. 원문은 아래와 같습니다. 아래와 같은 코드를 사용하였을 때 지수형태로 나타내는 것을 확인하였습니다. 혹여나 문제가 발생할 경우 에러 메세지를 알려주시면 도움이 될 것 같습니다.
;+
;
; (C) Cooperative Institute for Meteorological Satellite Studies, 2000
;
; NAME:
; logticks_exp
;
; PURPOSE:
; Function to print logarithmic axis tickmarks with exponential
; output.
;
; CATEGORY:
; Graphics
;
; LANGUAGE:
; IDL v5
;
; CALLING SEQUENCE:
; PLOT, x, y, /YLOG, YICKFORMAT = ‘logticks_exp’
;
; INPUTS:
; axis: the axis number. 0 for X axis, 1 for Y axis, 2 for Z axis.
; index: the tick mark index which starts at 0.
; value: the default tick mark value (a floating-point number);
;
; OUTPUTS:
; Function returns a string containing the tick mark labels.
;
; CREATION HISTORY:
; Written by: Paul van Delst, CIMSS/SSEC, 08-Nov-2000
; paul.vande…@ssec.wisc.edu
;
;-
FUNCTION logticks_exp, axis, index, value
; Determine the base-10 exponent
exponent = LONG( ALOG10( value ) )
; Construct the tickmark string based on the exponent
tickmark = ’10!E’ + STRTRIM( STRING( exponent ), 2 ) + ‘!N’
; Return the formatted tickmark string
RETURN, tickmark
END -
Sangwoo회원
아래 링크의 내용도 한번 참조해보시면 어떨까 합니다.
-
-
글쓴이글