ubermag / help

Repository for raising issues and requesting help on Ubermag
BSD 2-Clause "Simplified" License
11 stars 3 forks source link

Visualizing magnetization at a particular time-step #156

Closed DebanjanPolley closed 3 years ago

DebanjanPolley commented 3 years ago

Hi, I am driving a system for 1000 ps with the following code:

T = 1000e-12
N = 1000
system.dynamics = mm.Precession(gamma0=gamma0) + mm.Damping(alpha=alpha)
td = oc.TimeDriver()
td.drive(system, t=T, n=N)

Then I need to plot the z component of magnetization (Mz) of the system and I am doing it in the following way:

import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(20, 5))
system.m.plane('z', n=(20, 20)).mpl_vector(ax=ax)

Now, after the end of the simulation, is there a simple way to visualize Mz at some intermediate time-step: let's say T = 250, 500 and 750 ps?

DebanjanPolley commented 3 years ago

Got it using some help from these two links.

https://github.com/ubermag/workshop/blob/master/tutorials/mpl-visualisation.ipynb

https://github.com/ubermag/help/issues/144

fangohr commented 3 years ago

Thank you for providing the links that help answer the question. This is really useful to build up a knowledge data base here, and will help other users as well.

Milad-spinwave commented 1 year ago

Why I can not open the link you shared about visualization? I mean this : https://github.com/ubermag/workshop/blob/master/tutorials/mpl-visualisation.ipynb it shows : 404 : page not found. from where I can see the context of this link?

lang-m commented 1 year ago

Hi @Milad-spinwave, the documentation has been re-organised a while ago. Please refer to this page for visualisation with matplotlib: https://ubermag.github.io/documentation/notebooks/discretisedfield/field-matplotlib-visualisation.html

There is also a new type of interactive visualisation based on HoloViews, documentation is available here: https://ubermag.github.io/documentation/notebooks/discretisedfield/field-holoviews-visualisation.html (interactivity is not available on the website, only in a running notebook)