On Jan 20, 1:40 pm, kisCA <ki...@hotmail.com> wrote:
> Hi there,
>
> I am trying to make a plot with xaxis from -0.6 to 0.6. On the xaxis
> it gaves me a -0.0 ? I tried xtickformat='(F4.1)' and '(F0.1)' but no
> success...
>
> pcit= -.6+indgen(13)*.1
>
> !p.font=0 ;use postscript fonts
> set_plot, 'ps'
> ext='.eps'
> cs=0 ;charcter size
> !p.thick=3 ;data
> !x.thick=2 ;x axis
> !y.thick=2 ;y axis
> device, filename='Response Solar Cycle - Annual Mean'+ext,
> encapsulated=eps, $
> /helvetica,/isolatin1, xsize=8, ysize=12,font_size=8, landscape=0,
> decomposed=0, color=1
> plot,pcit,Zproxy,/nodata,ystyle=1,yrange=[15,50],xtickformat ='(F4.1)'
> oplot,Solarcoef*100,Zproxy,color=0,linestyle=0
> oplot,(Solarcoef+Solarstd)*100,Zproxy,color=204,linestyle=1
> oplot,(Solarcoef-Solarstd)*100,Zproxy,color=204,linestyle=1
> oplot,limiteY,Zproxy,color=0,linestyle=2
> for z=0,n_elements(Zproxy)-1 do begin
> oplot,[(Solarcoef(z)-Solarvar(z))*100,(Solarcoef(z)
> +Solarvar(z))*100],[Zproxy(z),Zproxy(z)],color=226,linestyle =0
> endfor
> oplot,[-.500,-.400],[48,48],color=0,linestyle=0
> xyouts,-.350,48,'Mean'
> oplot,[-.500,-.400],[47,47],color=204,linestyle=1
> xyouts,-.350,47,'Std'
> oplot,[-.500,-.400],[46,46],color=226,linestyle=0
> xyouts,-.350,46,'Error'
> device,/close
>
> Do you have an idea ?
>
> Cheers
This falls into the "sky is falling" category, although with
a slight different twist.
http://www.dfanning.com/math_tips/sky_is_falling.html
Signed zeros are allowed in the IEEE 754 standard for floating point
arithmetic.
IDL> print,-2.0*0
-0.00000
IDL> print,2.0*0
0.00000
If you don't like that in the plot (and I agree that it looks ugly),
you should
manually change that tick label using the xtickname keyword.
However, that is painful to do, so you could try the following hack:
xrange=[-0.6,0.6]
plot,[0,0],/nodata,/xstyle,xrange=xrange,title='this looks bad'
;workaround
epsilon=1e-6
xrange=[-0.6,0.6]
xrange=xrange+epsilon*[-1,2]
plot,[0,0],/nodata,/xstyle,xrange=xrange,title='better now'
You see what happened there? Care to guess why it worked?
Ciao,
Paolo
|