Search code examples
matlabrose-plot

Length scaling orientation data in MATLAB


Problem

I have a data set of describing geological structures. Each structure has a row with two attributes - its length and orientation (0-360 degrees).

Within this data set, there are two types of structure.

  • Type 1: less data points, but the structures are physically larger (large length, and so more significant).
  • Type 2: more data points, but the structures are physically smaller (small length, and so less significant).

I want to create a rose plot to show the spread of the structures' orientations. However, I want this plot to also represent the significance of the structures in combination with the direction they face - taking into account the lengths.

Is it possible to scale this by length in MATLAB somehow so that the subset which is less numerous is not under represented, when the structures are large?


Example

A data set might contain:

  • 10 structures orientated North-South, 50km long.
  • 100 structures orientated East-West, 0.5km long.

In this situation the East-West population would look to be more significant than the North-South population based on absolute numbers. However, in reality the length of the members contributing to this population are much smaller and so the structures are less significant.


Code

This is the code I have so far:

load('WG_rose_data.xy') 
azimuth = WG_rose_data(:,2); 
length = WG_rose_data(:,1); 
rose(azimuth,20); 

Where WG_rose_data.xy is a data file with 2 columns containing the length and azimuth (orientation) data for the geological structures.


Solution

  • For each row in your data, you could duplicate it a given number of times, according to its length value. Therefore, if you had a structure with length 50, it counts for 50 data points, whereas a structure with length 1 only counts as 1 data point. Of course you have to round your lengths since you can only have integer numbers of rows.

    This could be achieved like so, with your example data in the matrix d

    % Set up example data: 10 large vertical structures, 100 small ones perpendicular
    d = [repmat([0, 50], 10, 1); repmat([90, .5], 100, 1)];
    % For each row, duplicate the data in column 1, according to the length in column 2
    d1 = [];
    for ii = 1:size(d,1)
        % make d(ii,2) = length copies of d(ii,1) = orientation
        d1(end+1:end+ceil(d(ii,2))) = d(ii,1); 
    end
    

    Output rose plot:

    rose plot

    You could fine tune how to duplicate the data to achieve the desired balance of actual data and length weighting.