Skip to content

Commit

Permalink
Merge branch 'development_fabian' of https://github.com/cgre-aachen/g…
Browse files Browse the repository at this point in the history
…empy into development_fabian
  • Loading branch information
fastamo committed May 15, 2018
2 parents 7d24d1d + dfd4947 commit 42624dd
Show file tree
Hide file tree
Showing 6 changed files with 1,172 additions and 5 deletions.
4 changes: 3 additions & 1 deletion gempy/plotting/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ def plot_data(geo_data, direction="y", data_type = 'all', series="all", legend_f
Args:
direction(str): xyz. Caartesian direction to be plotted
series(str): series to plot
ve(float): Vertical exageration
**kwargs: seaborn lmplot key arguments. (TODO: adding the link to them)
Returns:
Expand All @@ -601,7 +602,8 @@ def plot_section(geo_data, block, cell_number, direction="y", **kwargs):
'spline16', 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser',
'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc',
'lanczos'
**kwargs: imshow keywargs
ve(float): Vertical exageration
**kwargs: imshow keywargs
Returns:
None
Expand Down
23 changes: 19 additions & 4 deletions gempy/plotting/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _set_style(self):
plt.style.use(['seaborn-white', 'seaborn-talk'])
sns.set_context("talk")

def plot_data(self, direction="y", data_type='all', series="all", legend_font_size=10, **kwargs):
def plot_data(self, direction="y", data_type='all', series="all", legend_font_size=10, ve=1, **kwargs):
"""
Plot the projecton of the raw data (interfaces and orientations) in 2D following a
specific directions
Expand All @@ -99,6 +99,7 @@ def plot_data(self, direction="y", data_type='all', series="all", legend_font_si
direction(str): xyz. Caartesian direction to be plotted
data_type (str): type of data to plot. 'all', 'interfaces' or 'orientations'
series(str): series to plot
ve(float): Vertical exageration
**kwargs: seaborn lmplot key arguments. (TODO: adding the link to them)
Returns:
Expand All @@ -114,6 +115,11 @@ def plot_data(self, direction="y", data_type='all', series="all", legend_font_si
x, y, Gx, Gy = self._slice(direction)[4:]
extent = self._slice(direction)[3]
aspect = (extent[1] - extent[0])/(extent[3] - extent[2])

# apply vertical exageration
if direction == 'x' or direction == 'y':
aspect /= ve

if aspect < 1:
min_axis = 'width'
else:
Expand Down Expand Up @@ -216,7 +222,7 @@ def _slice(self, direction, cell_number=25):
return _a, _b, _c, extent_val, x, y, Gx, Gy

def plot_block_section(self, cell_number=13, block=None, direction="y", interpolation='none',
plot_data=False, **kwargs):
plot_data=False, ve=1, **kwargs):
"""
Plot a section of the block model
Expand All @@ -228,6 +234,7 @@ def plot_block_section(self, cell_number=13, block=None, direction="y", interpol
'spline16', 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser',
'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc',
'lanczos'
ve(float): Vertical exageration
**kwargs: imshow keywargs
Returns:
Expand Down Expand Up @@ -256,14 +263,22 @@ def plot_block_section(self, cell_number=13, block=None, direction="y", interpol
self.plot_data(direction, 'all')
# TODO: plot_topo option - need fault_block for that

# apply vertical exageration
if direction == 'x' or direction == 'y':
aspect = ve
else:
aspect = 1

if 'cmap' not in kwargs:
kwargs['cmap'] = self._cmap #
if 'norm' not in kwargs:
kwargs['norm'] = self._norm
# print(plot_block[_a, _b, _c].T, type(plot_block[_a, _b, _c].T))
im = plt.imshow(plot_block[_a, _b, _c].T, origin="bottom",
extent=extent_val,
interpolation=interpolation, **kwargs)
extent=extent_val,
interpolation=interpolation,
aspect=aspect,
**kwargs)

import matplotlib.patches as mpatches
colors = [im.cmap(im.norm(value)) for value in self.formation_numbers]
Expand Down
Loading

0 comments on commit 42624dd

Please sign in to comment.