Skip to content

Commit ec60247

Browse files
committed
fixed bug with headtail option for show_e_beam
1 parent 5afdfee commit ec60247

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

demos/ebeam/csr_ex.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,9 @@
106106
plt.xlabel("s, mm")
107107
plt.ylabel("I, A")
108108
plt.grid(True)
109+
plt.show()
110+
111+
show_e_beam(p_array)
112+
plt.show()
113+
show_e_beam(p_array, inverse_tau=True, headtail=False)
109114
plt.show()

ocelot/gui/accelerator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,8 +1032,8 @@ def show_e_beam(p_array, nparts_in_slice=5000, smooth_param=0.05, nbins_x=200, n
10321032
# label = r"$I_{max}=$" + str(np.round(np.max(slice_params.I), 1))
10331033
if headtail:
10341034
leg = ax_c.legend([label], handlelength=0, handletextpad=0, fancybox=True, loc=location)
1035-
for item in leg.legendHandles:
1036-
item.set_visible(False)
1035+
for item in leg.legendHandles:
1036+
item.set_visible(False)
10371037
plt.setp(ax_c.get_xticklabels(), visible=False)
10381038
plt.ylabel("I [A]")
10391039
plt.grid(grid)

0 commit comments

Comments
 (0)