Closed charlesweijun closed 4 years ago
I set the figure size to be 8 by 6 inches: fig_size=(8,6)
n ploting phase tensor pseudosection for a AMT profile, I failed to do it. I do not know how to set xstretch and ystretch, and how to set fig_size? Could you hel me how to tweak these parameters?
one AMT profles contain 42 stations. normal station spacing is 80 m, while it is 40 m in special segment about 10 stations.
Hi @charlesweijun There are two points: 1- Be careful about your profile direction and set 'ew' (if a profile direction is closer to east-west) or 'sn'(if a profile direction is closer to south-north). 2- you should adjust the stretch according to your station spacing. I put my script that I plotted the 41 stations. Change the directory of data and path of save as well as the parameter(phimin, skew and so on) that you like to plot. ` from mtpy.imaging.phase_tensor_pseudosection import PlotPhaseTensorPseudoSection import os.path as op import os
edi_path = r'/home/mkash/Desktop/Dimensionality/L5'
savepath = r'/home/mkash/Desktop/Dimensionality/'
elst=[op.join(edi_path,edi) for edi in os.listdir(edi_path) if ((edi.endswith('.edi')))]# and edi.startswith('GB')
plotObj = PlotPhaseTensorPseudoSection(fn_list = elst, linedir='ew', # 'ns' if the line is closer to north-south, 'ew' if line is closer to east-west stretch=(600,12), # determines (x,y) aspect ratio of plot
stationlist=[],
#plot_tipper = 'yr', # plot tipper ('y') + 'ri' means real+imag
arrow_size = 60,
arrow_head_length= 0.3,
arrow_direction = -1,
font_size=3.5,
#cb_dict= {'orientation':'horizontal',
# 'position':[0.4,0.1,0.25,0.025]},
lw=0.5,
ellipse_dict = {'ellipse_colorby':'skew_seg',# option to colour by phimin, phimax, skew, skew_seg
'ellipse_range':[-10,10,2.5]} # set color limits - default 0,90 for phimin or max,
# [-12,12] for skew. If plotting skew_seg need to provide
# 3 numbers, the 3rd indicates interval, e.g. [-12,12,3]
)
plotObj.ellipse_size = 2
plotObj.plot() plotObj.save_figure(save_fn = os.path.join(savepath,'skew_n2.png'), fig_dpi=1000)
`
from mtpy.imaging.phase_tensor_pseudosection import PlotPhaseTensorPseudoSection import os
edi_path='D:/HeiheAMT2015/MM' savepath='D:/HeiheAMT2015/MM/processed' edi_list=[os.path.join(edi_path,ff) for ff in os.listdir(edi_path)\ if ((ff.endswith('.edi')))]
ellipse_dict={'ellipse_colorby':'skew', 'ellipse_range':[-10,10,2]}
ptsection=PlotPhaseTensorPseudoSection(fn_list=edi_list,
ellipse_dict=ellipse_dict,
linedir='ew',
fig_size=(8,6),
strech=(17,8),
station_id=(0,4),
plot_tipper='n',
font_size=6,
ellipse_size=3,
lw=0.6,
cb_dict={'orientation':'vertical',
'position':[1.0,0.1,0.25,0.005]}
)
ptsection.plot()
ptsection.save_figure(save_fn=os.path.join(savepath,
'PhaseTensorPseoudoSection1.png'),
fig_dpi=350)
The code above was run several time, it faild to produce desired figure. Thank kashkoulimohammad for you showing code and give soem information.
Hi @charlesweijun The attribute for figure size is figsize. You can see all of the attributes in the phase_tensor_pseudosection.py in this path: C:\mtpywin\mtpy\mtpy\imaging
Hi @kashkoulimohammad yes, i have looked at them, it is fig_size .
Hi @charlesweijun In the phase_tensor_pseudosection.py that is : -figsize size of figure in inches
Hi, @kashkoulimohammad in the Attributes: I can see -fig_size size of figure in inches. Possibly, I downloaded MTpy package 2 months ago.
Expected Behavior
Current Behavior
Possible Solution
Steps to Reproduce (for bugs)
1. 2. 3. 4.
Context
Your Environment
print(matplotlib.get_backend())
):Installed Python Packages: use
pip freeze
orconda list [-n ENVIRONMENT_NAME]
to list all the installed libraries.On ploting phase tensor pseudosection for a AMT profile, I failed to do it. I do not know how to set xstretch and ystretch, and how to set fig_size? Could you hel me how to tweak these parameters?