Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
NJU Geophy
MGPro
Commits
acdd0b9b
Commit
acdd0b9b
authored
Jul 02, 2019
by
Mijian Xu
😷
Browse files
add map axis
parent
fde130ae
Pipeline
#742
passed with stage
in 2 minutes and 36 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
mgpro/mgpro.py
View file @
acdd0b9b
import
numpy
as
np
from
mgpro
import
expand
#
import expand
from
mgpro.proj
import
*
#
from proj import *
#
from mgpro import expand
import
expand
#
from mgpro.proj import *
from
proj
import
*
import
matplotlib.pyplot
as
plt
import
matplotlib.colors
as
colors
from
scipy.fftpack
import
fft2
,
fftshift
,
ifft2
,
ifftshift
...
...
@@ -17,6 +17,11 @@ def msg():
'''
def
tick2label
(
ticks
,
lim
):
labels
=
[
'{:.0f}'
.
format
(
tick
)
for
tick
in
np
.
linspace
(
lim
[
0
],
lim
[
1
],
len
(
ticks
))]
return
labels
def
cal_pos
(
max_len
,
len_x
,
len_y
):
if
max_len
>
1
or
max_len
<
0
:
raise
ValueError
(
'Input arg of max_len must be in the range of 0 to 1'
)
...
...
@@ -168,8 +173,13 @@ class mgmat(object):
real_width
*=
frac_w
fig
.
clf
()
ax_raw
=
fig
.
gca
()
pcm
=
ax_raw
.
imshow
(
data
,
cmap
=
'jet'
,
extent
=
[
self
.
x
[
0
],
self
.
x
[
-
1
],
self
.
y
[
0
],
self
.
y
[
-
1
]])
# ax_raw.figure.canvas.draw()
divnorm
=
colors
.
DivergingNorm
(
vcenter
=
0
)
pcm
=
ax_raw
.
pcolor
(
data
,
cmap
=
'jet'
,
norm
=
divnorm
)
xticklabels
=
tick2label
(
ax_raw
.
get_xticks
(),
[
self
.
x
[
0
],
self
.
x
[
-
1
]])
yticklabels
=
tick2label
(
ax_raw
.
get_yticks
(),
[
self
.
y
[
0
],
self
.
y
[
-
1
]])
ax_raw
.
set_xticklabels
(
xticklabels
)
ax_raw
.
set_yticklabels
(
yticklabels
)
plt
.
setp
(
ax_raw
.
get_xticklabels
(),
rotation
=-
45
,
ha
=
"left"
)
cb
=
fig
.
colorbar
(
pcm
,
extend
=
'both'
)
# ax_raw.set_position([.1, .125, real_width, real_height], which='original')
# cb.ax.set_position([.8, .1, real_height/6.27, real_height])
...
...
setup.py
View file @
acdd0b9b
...
...
@@ -5,7 +5,7 @@ packages = find_packages()
with
open
(
"README.md"
,
"r"
)
as
fh
:
long_description
=
fh
.
read
()
VERSION
=
"0.1.
6
"
VERSION
=
"0.1.
7
"
setup
(
name
=
'mgpro'
,
version
=
VERSION
,
author
=
'Mijian Xu'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment