Hi MICRESS Forum,
Is it possible to change the scales of this plot to more realistic sizes. How do i change the concentration bar to be smaller so that the image isn't too small?
please see image of plot attached as well as an image of the python code used.
Thanks,
Matthew
MicPy image generation
-
matt_hughes
- Posts: 9
- Joined: Fri Jan 31, 2025 4:21 pm
- anti_bot: 333
MicPy image generation
You do not have the required permissions to view the files attached to this post.
Re: MicPy image generation
Hi Matthew,
if you have the newest version of MicPy. It is possible to output the colorbar by bin.plot() function. You can remove the original one, and define you own colorbar as you wish. I have here an example code.
![Image]()
I hope that it hopes you.
Best Regards
Bei Zhou
if you have the newest version of MicPy. It is possible to output the colorbar by bin.plot() function. You can remove the original one, and define you own colorbar as you wish. I have here an example code.
from micpy import bin
import matplotlib.pyplot as plt
path = "B003_1Grain_GrowthFromLiquid_0.frac"
file = bin.File(path)
file.open()
series = file.read()
field = series.get_field(-1)
# output fig, ax, and colorbar objects
fig, ax, cbar=bin.plot(field=field)
cbar.remove() # remove the original colorbar
# define a new colorbar (https://matplotlib.org/stable/api/_as_g ... orbar.html)
im = ax.images[0]
cbar1 = fig.colorbar(im, ax=ax, shrink = 0.5, pad = 0.1)
# define a new colorbar horizontally
cbar2 = fig.colorbar(im, ax=ax, orientation = "horizontal", pad = 0.15)
I hope that it hopes you.
Best Regards
Bei Zhou
You do not have the required permissions to view the files attached to this post.