changing vertical scale of log plot

asked 10 years ago

Nownuri gravatar image

updated 10 years ago

calc314 gravatar image

Could you please tell me how to change vertical scale in logarithmic plot?

In the following code I didn't set size of the vertical scale. So the result looks bad. How can I change the interval?

var('q1, q2, q3, q4, q5, o1, o2, o3, o4, o5, Lo1, Lo2, Lo3, Lo4, Lo5')

q1=1/20^2*exp(-20/L_s);
q2=2.4/20^2*exp(-20/L_s);
q3=4/20^2*exp(-20/L_s);
q4=5/20^2*exp(-20/L_s);
q5=15/20^2*exp(-20/L_s);

o1=plot(q1, (x, 0, 90), ymin=0, ymax=0.03, axes_labels=['Scattering length [m]','Illuminace on camera sensor[lux]'],axes=True, legend_label='I=1 cd', frame=True, color='yellow', title='r(distance)=20m');
o2=plot(q2, (x, 0, 90), ymin=0, ymax=0.03, axes_labels=['Scattering length [m]','Illuminace on camera sensor[lux]'],axes=False, legend_label='I=2.4 cd', frame=True, color='red');
o3=plot(q3, (x, 0, 90), ymin=0, ymax=0.03, axes_labels=['Scattering length [m]','Illuminace on camera sensor[lux]'],axes=False, legend_label='I=4 cd', frame=True, color='blue'); 
o4=plot(q4, (x, 0, 90), ymin=0, ymax=0.03, axes_labels=['Scattering length [m]','Illuminace on camera sensor[lux]'],axes=False, legend_label='I=5 cd', frame=True, color='black'); 
o5=plot(q5, (x, 0, 90), ymin=0, ymax=0.03, axes_labels=['Scattering length [m]','Illuminace on camera sensor[lux]'],axes=False, legend_label='I=15 cd', frame=True, color='green'); 
o5.set_legend_options(loc=2);

show (o1 + o2 + o3 + o4 + o5)

Lo1=plot(q1, (x, 0, 90), scale='semilogy', ymin=0, ymax=0.1, axes_labels=['Scattering length [m]','Illuminace on camera sensor[lux]'],axes=True, legend_label='I=1 cd', frame=True, color='yellow', title='r(distance)=20m');
Lo2=plot(q2, (x, 0, 90), ymin=0, ymax=0.1, axes_labels=['Scattering length [m]','Illuminace on camera sensor[lux]'],axes=False, legend_label='I=2.4 cd', frame=True, color='red');
Lo3=plot(q3, (x, 0, 90), ymin=0, ymax=0.1, axes_labels=['Scattering length [m]','Illuminace on camera sensor[lux]'],axes=False, legend_label='I=4 cd', frame=True, color='blue'); 
Lo4=plot(q4, (x, 0, 90), ymin=0, ymax=0.1, axes_labels=['Scattering length [m]','Illuminace on camera sensor[lux]'],axes=False, legend_label='I=5 cd', frame=True, color='black'); 
Lo5=plot(q5, (x, 0, 90), ymin=0, ymax=0.1, axes_labels=['Scattering length [m]','Illuminace on camera sensor[lux]'],axes=False, legend_label='I=15 cd', frame=True, color='green'); 
Lo1.set_legend_options(loc=4);

show (Lo1 + Lo2 + Lo3 + Lo4 + Lo5)
Preview: (hide)