Changeset 3db96b0 in sasmodels
- Timestamp:
- Feb 23, 2018 11:46:44 AM (7 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 58a1be9
- Parents:
- aa90015
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
explore/realspace.py
r032646d r3db96b0 423 423 424 424 # -------------- plotters ---------------- 425 def plot_calc(r, Pr, q, Iq, theory=None ):425 def plot_calc(r, Pr, q, Iq, theory=None, title=None): 426 426 import matplotlib.pyplot as plt 427 427 plt.subplot(211) … … 429 429 plt.xlabel('r (A)') 430 430 plt.ylabel('Pr (1/A^2)') 431 if title is not None: 432 plt.title(title) 431 433 plt.subplot(212) 432 434 plt.loglog(q, Iq, '-', label='from Pr') … … 437 439 plt.legend() 438 440 439 def plot_calc_2d(qx, qy, Iqxy, theory=None ):441 def plot_calc_2d(qx, qy, Iqxy, theory=None, title=None): 440 442 import matplotlib.pyplot as plt 441 443 qx, qy = bin_edges(qx), bin_edges(qy) … … 443 445 if theory is not None: 444 446 plt.subplot(121) 445 plt.pcolormesh(qx, qy, np.log10(Iqxy)) 447 #plt.pcolor(qx, qy, np.log10(Iqxy)) 448 extent = [qx[0], qx[-1], qy[0], qy[-1]] 449 plt.imshow(np.log10(Iqxy), extent=extent, interpolation="nearest", 450 origin='lower') 446 451 plt.xlabel('qx (1/A)') 447 452 plt.ylabel('qy (1/A)') 453 plt.axis('equal') 454 plt.axis(extent) 455 #plt.grid(True) 456 if title is not None: 457 plt.title(title) 448 458 if theory is not None: 449 459 plt.subplot(122) 450 plt.pcolormesh(qx, qy, np.log10(theory)) 460 plt.imshow(np.log10(theory), extent=extent, interpolation="nearest", 461 origin='lower') 462 plt.axis('equal') 463 plt.axis(extent) 451 464 plt.xlabel('qx (1/A)') 452 465 … … 663 676 if show_points: 664 677 plot_points(rho, points); pylab.figure() 665 plot_calc(r, Pr, q, Iq, theory=theory )678 plot_calc(r, Pr, q, Iq, theory=theory, title=title) 666 679 pylab.gcf().canvas.set_window_title(title) 667 680 pylab.show() … … 688 701 if show_points: 689 702 plot_points(rho, points); pylab.figure() 690 plot_calc_2d(qx, qy, Iqxy, theory=theory )703 plot_calc_2d(qx, qy, Iqxy, theory=theory, title=title) 691 704 pylab.gcf().canvas.set_window_title(title) 692 705 pylab.show()
Note: See TracChangeset
for help on using the changeset viewer.