MERCATOR MercatorProjection for Axes or Data --------------------------------------------------------------- Axes Transformation MERCATOR( Axe , EXT_New , EXT_Old , NTickInt ) Axe AxesHandle for Projection, default: GCA EXT_New Scale for new Projection, default: 1 EXT_Old Scale for old Projection, default: 0 (no Projection) NTickInt Number of TickIntervalls on Axis, default: 5 NOTE: If NTickInt has an NonZero imaginary Part, the AxesLimits will rounded to even parts of the selected TickIntervall. EXT_New, EXT_Old, NTickInt must be single finite numerics, EXT_New, EXT_Old with Values between 0 and 1. [ BorderHandle , EXT_New , EXT_Old , NTickInt ] = MERCATOR( Axe , ... ) returns the Handle of the Mercator-Border-Patch which is a Patch for White and one for Black Colors: [ 1 by 2 ] The Patches have the tags: 'MERCATOR_BORDER' The Black Patches starts at the lower-left Corner. Use a single Character-Argument to start with a White Patch: MERCATOR( Axe , ... , C , ... ) where C is: 'x' Start White at X-Axis 'y' Start White at Y-Axis 'z' Start White at X-Axis and Y-Axis NOTE: A nonzero imaginary Part of EXT_New defines the BorderWidth in Pixel. If the imaginary Part is negative or less then 5 No Black Patches are drawn. --------------------------------------------------------------- Axes Information about MERCATOR-Settings [ EXT , NTickInt , AxesHandle , BorderHandle ] = MERCATOR( Axe , 'Info' ) Note: In all cases the first Input 'Axe' can be an AxesHandle or a Handle of an AxesChildren. --------------------------------------------------------------- Data Transformation, give a Single-Element-CellArray 1) YMercator = MERCATOR( {YData} , EXT_New , EXT_Old ) Transforms the Values Y for MercatorProjection. 2) YMercator = MERCATOR( Axe , {YData} , EXT_Old ) Transforms the Values Y for MercatorProjection of Axe, use EXT_New from Axe. 3) YMercator = MERCATOR( Axe , EXT_New , {YData} ) Transforms the Values Y from MercatorProjection of Axe into new, use EXT_Old from Axe --------------------------------------------------------------- Example for usage with AXE_ZOOM: figure('toolbar','none') axis([-180 180 -90 90]) grid on mercator(gca,1,0,10), x = linspace(-120,120,100), y = linspace( -60, 60,100), plot( x , mercator(gca,{y}) , 'k-' ), axe_zoom('new',gca,'mercator'), axe_zoom('on',gca), ------------------------------------------------------------ MERCATOR changes the !!! ydata !!! of Axes Children and following AxesProperties: ylim ytick yticklabels xtick xticklabels 'dataaspectratio' , [1 1 1] MANUAL AxesTicks will not be changed, if the Input 'NTickInt' is NOT given !!! WARNING: MERCATOR didn't work correctly for TYPE IMAGE Scale YData of the Image to an equal spaced Vector in the new Projection BEFORE. Example for using IMAGE: xc = ( 1 : 2 : 65 ), yc = ( 1 : 2 : 65 )', cc = rand(size(yc,1),size(xc,2)), ym = deg2merc(yc([1 end]),1), % Mercator ym = linspace(ym(1),ym(2),size(yc,1))', % Equal spaced ym = merc2deg(ym,1), % Back ym([1 end]) = yc([1 end]), cm = interp1(yc,cc,ym), % Now use: image(xc,ym,cm) ************************************************** The Calculation for the Projection of the Y-Data: %@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ function y = deg2merc(y,ext) y = 180/pi * log(abs(tan(pi/4 + y*ext*pi/180/2))) / ext, %@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ function y = merc2deg(y,ext) y = 2*180/pi * ( atan(exp(y*ext*pi/180)) - pi/4 ) / ext, %@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Source.


Яндекс.Метрика Рейтинг@Mail.ru Free Web Counter
page counter
Last Modified: April 22, 2016 @ 1:06 am