New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incompatible bar label #74
Comments
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. |
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 :) |
Try using the cmap argument instead. |
Great ! That works, thanks a lot 👍 |
Great, thanks for the report. I'll update the functions to remove the duplicate colormap parameter. |
btw, short question: how can I change the fontsize and ticks in colorbar in colorbar_kwargs.py ? |
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. |
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, ticklabels=cb.get_yticklabels() but still it is not working. Could you please give me further advices ? |
The colorbar arguments need to go in the
Then pass |
Colorbar arguments clarified in the master branch, closing as fixed. |
Dear Marc,
I am trying your example code colorbar_kwargs.py for my system. I am willing to plot my ternary phase diagram with calculated free energies. I have tried for some test case and realized that the free energy (i.e scatter points c values) are not really compatible with bar label. For instance, I have selected 3 points with 0, -5 and -9.5 values (in vmin=-10, vmax=0 range ).
`# Scatter some points
points = [(2,3,5),(2,1,7),(2,5,2)]
c = [0, -5, -9.5]
cb_kwargs = {"shrink" : 0.6,
"orientation" : "horizontal",
"fraction" : 0.1,
"pad" : 0.05,
"aspect" : 30}
tax.scatter(points,marker='s',c=c,edgecolor='k',s=80,linewidths=0.5,
vmin=-10, vmax=0, colorbar=True,colormap='jet',cbarlabel='Free Energy (eV)',
cb_kwargs=cb_kwargs,zorder=3)`
Under that circumstances I suppose to have blue, green and red circles in the phase diagram, but this is not the case as seen in the image attached.
If you can give me a feedback, I will be appreciated.
Thanks,
Halil
The text was updated successfully, but these errors were encountered: