Giter VIP home page Giter VIP logo

Comments (3)

welcome avatar welcome commented on August 12, 2024

👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. We appreciate that you took the time to contribute!

Please make sure you read our Contributing Guide and abide by our Code of Conduct.

from gmt.

PaulWessel avatar PaulWessel commented on August 12, 2024

Would you be able to provide an actual example where this is used? If we were to add the transformation y = sign(x)*log10(abs(x)), I suppose x = 0 should give y = 0?

from gmt.

phalucy avatar phalucy commented on August 12, 2024

What I want is something like the Symlog plots in Matplotlib.
For example: https://matplotlib.org/stable/gallery/scales/symlog_demo.html
They actually did something tricky that making the values near zero display linearlly.

I wish such a function could work in GMT.

Currently, what I've done is:
I got X for x and A for y.
`
#positive and negative values (but reversed) in one plot
region=[-10,10,-5, 5] # for 10^-5 ~10^5
fig.shift_origin(yshift=1.4)
fig.basemap(region=region,projection='X2.8/1.4', frame=['x20f10g100', 'y1+l"A"', 'Wne'])
for i in range(0,len(A)):
if A[i]*1.44 > 0:
fig.plot(x=X[i], y=np.log10(A[i]), pen='0.1', fill=color[i], style='c0.1')

fig.shift_origin(yshift=-1.4)
fig.basemap(region=region,projection='X2.8/-1.4', frame=['x20f10g100+l"A"', 'y1', 'WSe'])
for i in range(0,len(A)):
if A[i] < 0:
fig.plot(x=X[i], y=np.log10(abs(A[i])), pen='0.1', fill=color[i], style='c0.1')
`

After that I just modified the figure to change the labels on y-axis to 10^-510^5 & -10^-5-10^5 manually

from gmt.

Related Issues (20)

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.