| ... | @@ -132,4 +132,32 @@ fig.savefig("velocity.png") | ... | @@ -132,4 +132,32 @@ fig.savefig("velocity.png") | 
|  | plt.show() |  | plt.show() | 
|  | ``` |  | ``` | 
|  | Output |  | Output | 
|  |  |  |  | 
|  | \ No newline at end of file |  |  | 
|  |  |  | # Density and order parameter on the same plot - 1D case | 
|  |  |  | ```python | 
|  |  |  | import numpy as np | 
|  |  |  | import matplotlib.pyplot as plt | 
|  |  |  | from wdata.io import WData, Var | 
|  |  |  |  | 
|  |  |  | # I read data directly from dwarf, | 
|  |  |  | # Before running the script I mounted file system: | 
|  |  |  | # sshfs gabrielw@dwarf.if.pw.edu.pl:/home2/ /home/gabrielw/home2-dwarf/ | 
|  |  |  |  | 
|  |  |  | fwtxt="/home/gabrielw/home2-dwarf/scratch/loff-vortex/cold-atoms/st-two-vortices/DyK_120.wtxt" | 
|  |  |  | data = WData.load(fwtxt) | 
|  |  |  |  | 
|  |  |  | fig, ax = plt.subplots() | 
|  |  |  | ax.plot(data.xyz[0], data.rho_a[-1], color='red', label=r'$n_a$', lw=3.0) # plot last frame [-1] | 
|  |  |  | ax.plot(data.xyz[0], data.rho_b[-1], color='blue', label=r'$n_b$', lw=3.0) # plot last frame [-1] | 
|  |  |  | ax.set(xlabel='x', ylabel=r'$n(x)$') | 
|  |  |  |  | 
|  |  |  | ax2 = ax.twinx()  # instantiate a second axes that shares the same x-axis | 
|  |  |  | ax2.plot(data.xyz[0], np.abs(data.delta)[-1], color='black', label=r'$\Delta$', lw=2.0, ls="--") # plot last frame [-1] | 
|  |  |  | ax2.set(ylabel=r'$\Delta(x)$') | 
|  |  |  |  | 
|  |  |  | fig.legend(loc="upper right", bbox_to_anchor=(1,1), bbox_transform=ax.transAxes) | 
|  |  |  |  | 
|  |  |  | fig.savefig("plot.png") | 
|  |  |  | ``` | 
|  |  |  |  | 
|  |  |  | \ No newline at end of file |