Git Product home page Git Product logo

gmt-plotting's People

Contributors

michaelgrund avatar yvonnefroehlich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gmt-plotting's Issues

Projection issue

Hi,

reproducing the code at least in the first two examples the same error arise:

mapproject [ERROR]: Cannot specify -J option with selected form of -G

Thank you

009_paper_GR2020/Figure S10: Wrong colormap set up in colorwheel

In Figure S10 (009_paper_GR2020), the colormap represented by the colorwheel does not match the color-coding used for the bars of the splits. The plots in the Supplementary Material of Grund & Ritter (2020) shown up on page 28 look correct.
compare_SuppMat_JN_GR2020_FigS10

Suggestions to fix this issue
This Jupyter Notebook seems not completely finished. However, maybe the code snippets below can serve as an orientations, in case further work on this JN is planed.

(1) Adjust colormap used for plotting the data points

  • limitation: Not the same color-coding as used for the maps in the Supp Material
  • cell 11, line 4: reverse=True (not False)
# generate colormap for values between 0 and 360 degrees
pygmt.makecpt(
    cmap="romaO", 
    series=[0 ,360 , 1], 
    reverse=True,   # not False
    output="cmapmod.cpt",
)

(2) Adjust creation of colorwheel via Matplotlib

  • limitation: Problem to save the new colorwheel as (eps) file via matplotlib.pyplot.savefig. Error message FigureCanvasPS._print_figure() got an unexpected keyword argument 'figsize'
# define plotting range
theta = np.linspace(0, 2*pi, 360)  # no shift by 0.5*pi anymore
rho = ([1.22, 2])
	
# plot in polar projection, loop over the whole range 0 to 360 degrees
for ii in range(360):
	# backazimuth in seismology
	# from North (0 deg)
	ax.set_theta_offset(pi/2)
	# clockwise, i.e. to East (90 deg)
	ax.set_theta_direction(-1)
	plt.polar(
	    [theta[ii], theta[ii]], 
	    rho, 
	    color=[cmapa[0][ii], cmapa[1][ii], cmapa[2][ii]], 
	    linewidth=2,
	)

(3) Use PyGMT instead of Matplotlib to create colorwheel

  • limitation: Running time of the code
import pygmt

cmap_colorwheel = "romaO"
rho_min = 1.22
rho_max = 2

fig = pygmt.Figure()

pygmt.config(
    # make area outside of plot transparent
    PS_PAGE_COLOR="white@1",
    # make frame outline white
    MAP_FRAME_PEN="white",
)

fig.basemap(
    region=[0, 360, rho_min, rho_max],
    # geographic azimuth instead of standard angle
    # clockwise from North instead of counter-clockwise from East
    projection="P5c+a",
    frame="rltb",
)

pygmt.makecpt(
    cmap=cmap_colorwheel,
    cyclic=True,
    series=[0, 360, 1],
)

# takes some time
for i_ang in range(0,360,1):  # min, max], step
    rho = [rho_min, rho_max]
    fig.plot(
        x=[i_ang, i_ang],
        y=rho,
        zvalue=i_ang,
        pen="2p+z",
        cmap=True,
)

fig.show()

# fig.savefig(fname="colorwheel_N_cw_pygmt" + cmap_colorwheel + ".png")
# fig.savefig(fname="colorwheel_N_cw_pygmt" + cmap_colorwheel + ".eps")
# fig.savefig(fname="colorwheel_N_cw_pygmt" + cmap_colorwheel + ".pdf")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.