⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 l_crossplot.m

📁 地震、测井方面matlab代码,解释的比较详细
💻 M
字号:
function l_crossplot(wlog,mnem1,mnem2,varargin)
% Function makes crossplot of curve with mnemonic "mnem1" (x-axis) vs curve with
% mnemonic "mnem2" (y-axis)
% Written by; E. R., March 19, 2001.
% Last updated: April 27, 2001: linear, semi-log and log-log axes added
%
%         l_crossplot(wlog,mnem1,mnem2,varargin)
% INPUT
% wlog    log structure
% mnem1   mnemonic of curve with values plotted along the x-axis
% mnem2   mnemonic of curve whose values are plotted along the y-axis
% varargin one or more cell arrays; the first element of each cell array is a keyword string,
%         the following arguments contains a parameter(s). Accepted keywords are         
%         'color'   Color of symbols. Default: {'color','r'}
%         'depths'  first and last depth to use
%                   Default: {'depths',wlog.first,wlog.last}
%         'figure'  Possible values are 'new' (create new figure) and 'old' (plot onto
%                   existing figure)
%                   Default: {'figure','new'}
%         'rows'    used to select specific rows in the matrix of curve values on the basis
%                   of a logical conditions (see "l_select")
%                   Example: {'rows','Vclay < 0.25'} selects all row of the matrix of curve
%                      values for which the clay volume is less than 25 %
%                   Default: all rows
%         'linewith' Line width for plotting.
%                   Default: {'linewidth',1.5}
%         'linestyle' Style of line to use
%                   Default: {'linestyle','none'}  i.e. no connecting lines between markers
%         'marker', Marker to plot. Default: {'marker','*'}
%         'markersize' Size of Marker. Default: {'markersize',5}
%         'xaxis'   Possible values are "linear' and 'log' (linear or logarithmic x-axis)
%                   Default: {'xaxis','linear'}
%         'yaxis'   Possible values are "linear' and 'log' (linear or logarithmic y-axis)
%                   Default: {'yaxis','linear'}

%       Defaults of input arguments
param.color='r';
param.depths=[];
param.figure='new';
param.rows=[];
param.linewidth=1.5;
param.linestyle='none';     % No connecting lines
param.marker='*';
param.markersize=5;
param.xaxis='linear';
param.yaxis='linear';

%       Use input parameters to change defaults
param=assign_input(param,varargin);

if ~isstruct(wlog)
  error(' First input argument must be a log structure')
end

%       Select log samples based on depth range and row restrictions
if ~isempty(param.depths)
  if iscell(param.depths)
    wlog=l_select(wlog,{'depths',cat(2,param.depths{:})});
  else
    wlog=l_select(wlog,{'depths',param.depths});
  end
end
if ~isempty(param.rows)
  wlog=l_select(wlog,{'rows',param.rows});
end

index1=curve_index1(wlog,mnem1,-1);
index2=curve_index1(wlog,mnem2,-1);

c1=wlog.curves(:,index1);
c2=wlog.curves(:,index2);
u1=wlog.curve_info{index1,2};
u2=wlog.curve_info{index2,2};
d1=wlog.curve_info{index1,3};
d2=wlog.curve_info{index2,3};

if strcmpi(param.figure,'new')
  lfigure
  time_stamp
end

if strcmpi(param.xaxis,'linear') & strcmpi(param.yaxis,'linear')
  line(c1,c2,'Color',param.color,'Marker',param.marker,'MarkerSize',param.markersize, ...
      'LineWidth',param.linewidth,'LineStyle',param.linestyle)
elseif strcmpi(param.xaxis,'log') & strcmpi(param.yaxis,'linear')
  semilogx(c1,c2,'Color',param.color,'Marker',param.marker,'MarkerSize',param.markersize, ...
      'LineWidth',param.linewidth,'LineStyle',param.linestyle)  
elseif strcmpi(param.xaxis,'linear') & strcmpi(param.yaxis,'log')
  semilogy(c1,c2,'Color',param.color,'Marker',param.marker,'MarkerSize',param.markersize, ...
      'LineWidth',param.linewidth,'LineStyle',param.linestyle)
elseif strcmpi(param.xaxis,'log') & strcmpi(param.yaxis,'log')
  loglog(c1,c2,'Color',param.color,'Marker',param.marker,'MarkerSize',param.markersize, ...
      'LineWidth',param.linewidth,'LineStyle',param.linestyle)  
else
  error([' At least one of the axis parameters ("',param.xaxis,'", "',param.yaxis,'") is wrong'])
end

if ~isempty(inputname(1))
  mytitle(strrep(inputname(1),'_','\_'))
end

if ~strcmpi(u1,'n/a')
  xlabel([strrep(d1,'_','\_'),' (',units2tex(u1),')'])
else
  xlabel(strrep(d1,'_','\_'));
end
if ~strcmpi(u1,'n/a')
  ylabel([strrep(d2,'_','\_'),' (',units2tex(u2),')'])
else
  ylabel(strrep(d2,'_','\_'));
end

grid on, zoom on



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -