Giter Club home page Giter Club logo

Comments (10)

marcharper avatar marcharper commented on August 16, 2024

I think the example you want to follow is the colored scatter plot. It looks to me like the scatter plot colors are being set by the cmap parameter (which is the viridis color map by default). To make the points circles the marker parameter should be marker='o'.

So it's possible that there is a bug with the colormap parameters / precedence. If that is the case, let me know and I'll fix it.

from python-ternary.

halilSozen avatar halilSozen commented on August 16, 2024

Dear Marc,

Thanks a lot for quick response. I believe colorbar_kwargs.py is best for me. Because it has labels in 3 edges of the triangle (namely element x,y anz z compositions). So my compound can be understood easily. Also in later I may try to write the label next to my circles (such as X_(2)Y_(5)Z_(2)), so the reader can understand better.

I have only the problem that c values that I entered are not plotted correctly according to the color bar scale. Do you think it is because viridis ?

Making markers circles are completely fine :)

from python-ternary.

marcharper avatar marcharper commented on August 16, 2024

Try using the cmap argument instead.

from python-ternary.

halilSozen avatar halilSozen commented on August 16, 2024

Great ! That works, thanks a lot 👍

from python-ternary.

marcharper avatar marcharper commented on August 16, 2024

Great, thanks for the report. I'll update the functions to remove the duplicate colormap parameter.

from python-ternary.

halilSozen avatar halilSozen commented on August 16, 2024

btw, short question: how can I change the fontsize and ticks in colorbar in colorbar_kwargs.py ?

from python-ternary.

marcharper avatar marcharper commented on August 16, 2024

The kwargs simply get passed through to matplotlib so you have to use the parameters as expected by those functions. If you need examples, search for e.g. "changing matplotlib colorbar ticks" and you should get several examples from stack overflow and other sites.

from python-ternary.

halilSozen avatar halilSozen commented on August 16, 2024

Dear Marc,

I was trying hard but could not really figure out. I did the corresponding changes in the colorbar_kwargs.py code:

cb=tax.scatter(points,marker='o',c=c,cmap=plt.cm.jet,edgecolor='k',s=80,linewidths=0.5,
vmax=0.04,vmin=-1.95,colorbar=True,colormap=plt.cm.jet, cbarlabel=' Free Energy per atom (eV)',
cb_kwargs=cb_kwargs, zorder=3)

ticklabels=cb.get_yticklabels()
cb.set_yticklabels(ticklabels, fontsize=100)
cb.tick_params(labelsize=100)

but still it is not working. Could you please give me further advices ?

from python-ternary.

marcharper avatar marcharper commented on August 16, 2024

The colorbar arguments need to go in the cb_kwargs dictionary, e.g. take the existing cb_kwargs and add fontsize:

cb_kwargs["fontsize"] = 100

Then pass cb_kwargs to tax.scatter as above. Note that 100 is a very large fontsize...

from python-ternary.

marcharper avatar marcharper commented on August 16, 2024

Colorbar arguments clarified in the master branch, closing as fixed.

from python-ternary.

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.