CoCalc Shared Fileslegend_plot.sagewsOpen in CoCalc with one click!
Authors: harald @schil.ly, Testing CoCalc, John Jeng, Harald Schilly, Harald Schilly, ℏal Snyder, William A. Stein
Views : 12
RealNumber=float; Integer=int O=Graphics() c=pi*1E8;h=pi*2E-34;k=pi/2*1E-23 k1=N(8*pi*h*c);k2=(h*c)/k E(l,T)=k1*((l*1e-9)^-5)/1000*(1/(exp(k2/((l*1e-9)*T))- 1)) params=dict(figsize=(4,3),axes=False,fontsize=8,frame=True,gridlines=True,gridlinesstyle={"color":(0.3,0.3,0.3)},axes_labels=(r"$\Lambda[nm]$",r"$E(\Lambda)[KJ/nm$")) f1=0;f2=E(l,3500);f3=E(l,4000);f4=E(l,4500);f5=E(l,5000);f6 = E(l,5500) a=plot([f1,f2],l,100,2000,fill = {0: [1]}, fillcolor=hue(0.2),fillalpha=0.01, figsize=(3,2),frame=True,rgbcolor=hue(0.2),legend_label="3500"); b=plot([f2,f3],l,10,2000,fill = {0: [1]}, fillcolor=hue(0.4), figsize=(3,2),frame=True,rgbcolor=hue(0.4),legend_label="4000"); d=plot([f3,f4],l,10,2000,fill = {0: [1]}, fillcolor=hue(0.6), figsize=(3,2),frame=True,rgbcolor=hue(0.6),legend_label="4500"); j=plot([f4,f5],l,10,2000,fill = {0: [1]}, fillcolor=hue(0.8), figsize=(3,2),frame=True,rgbcolor=hue(0.8),legend_label="5000"); m=plot([f5,f6],l,10,2000,fill = {0: [1]}, fillcolor=hue(1.0), figsize=(3,2),frame=True,rgbcolor=hue(1.0),legend_label="5500"); O=plot(a+b+d+j+m,**params);O.axes_width(1/4); lopts = { "back_color": "salmon", 'shadow': False, 'fancybox': 'True', 'font_size': '8', 'loc': 'best', 'borderaxespad': 1 } O.set_legend_options(**lopts); #O.set_legend_options(font_size=8); #O.set_legend_options(back_color=(0.9,0.9,0.9)); #O.set_legend_options(loc="best"); #O.set_legend_options(shadow=False); #O.set_legend_options(borderaxespad=1); O.axes_color((0.2,0.5,0.5)); O.tick_label_color('brown') O