colorbar Subroutine

public subroutine colorbar(z, N, leftLabel, rightLabel)

Add a colorbar to the top of the plot

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:,:):: z

Data used for levels computation

integer, intent(in) :: N

Number of levels to compute

character(len=*), intent(in), optional :: leftLabel

Label for left side of colorbar

character(len=*), intent(in), optional :: rightLabel

Label for right side of colorbar

Calls

proc~~colorbar~~CallsGraph proc~colorbar colorbar plcolorbar plcolorbar proc~colorbar->plcolorbar
Help

Called By

proc~~colorbar~~CalledByGraph proc~colorbar colorbar proc~doquiver doQuiver proc~doquiver->proc~colorbar proc~docontour doContour proc~docontour->proc~colorbar program~examples_prg examples_prg program~examples_prg->proc~doquiver program~examples_prg->proc~docontour
Help

Source Code


Source Code

	subroutine colorbar(z,N,leftLabel,rightLabel)
		!! Add a colorbar to the top of the plot
		real(wp),dimension(:,:),intent(in)::z
			!! Data used for levels computation
		integer,intent(in)::N
			!! Number of levels to compute
		character(*),intent(in),optional::leftLabel
			!! Label for left side of colorbar
		character(*),intent(in),optional::rightLabel
			!! Label for right side of colorbar
		
		real(pp),dimension(:,:),allocatable::values
		character(64),dimension(2)::labels
		
		real(pp)::fill_width
		real(pp)::cont_width
		integer::cont_color
		real(pp)::colorbar_width
		real(pp)::colorbar_height
		integer::k
		
		values = reshape( &
			& real([( real(k-1,wp)/real(N-1,wp)*(maxval(z)-minval(z))+minval(z) ,k=1,N)],pp), &
			& [N,1])
		
		fill_width = 2.0_pp
		cont_width = 0.0_pp
		cont_color = 1
		labels = ''
		if(present(leftLabel )) labels(1) = leftLabel
		if(present(rightLabel)) labels(2) = rightLabel
		
		call plcolorbar(colorbar_width,colorbar_height,&
			& ior(PL_COLORBAR_GRADIENT,PL_COLORBAR_SHADE_LABEL),PL_POSITION_TOP,&
			& 0.0_pp,0.01_pp,0.75_pp,0.05_pp,&
			& 0,1,1,0.0_pp,0.0_pp, &
			& cont_color,cont_width, &
			& [PL_COLORBAR_LABEL_LEFT,PL_COLORBAR_LABEL_RIGHT],labels, &
			& ['bcvmt'],[0.0_pp],[0],[size(values)],values)
	end subroutine colorbar


abs abs_t acos_t ad_t add_t arg arrayToChar asin_t assignment(=) atan_t bar barh biCGSTAB_t biConjugateGradientStabilized binData box charToArray checkPrecision colorbar colorbar2 colorize colorMap config_t conjg conjugateGradient conjugateGradient_t contour contourf cos_a cos_t cpuTime cubicSpline_t deDup DFT div_t doBar doContour doError doFillBetween doFunction doHist doLegend doLogPlot doPlot doQuiver doScatter doSurface endsWith errorbar eval_test eval_testN evalR_abs evalR_acos evalR_add evalR_asin evalR_atan evalR_cos evalR_div evalR_exp evalR_imag evalR_log evalR_log10 evalR_mul evalR_neg evalR_p evalR_pow evalR_real evalR_sin evalR_sqrt evalR_sub evalR_tan evalR_var evalZ_abs evalZ_acos evalZ_add evalZ_asin evalZ_atan evalZ_cos evalZ_div evalZ_exp evalZ_imag evalZ_log evalZ_log10 evalZ_mul evalZ_neg evalZ_p evalZ_pow evalZ_real evalZ_sin evalZ_sqrt evalZ_sub evalZ_tan evalZ_var exp exp exp_t f FFT FFT_freq figure fillBetween fillBetweenx findInterval flatten function_t gaussSeidel gaussSeidel_t hist iDFT iFFT imag_t intToChar inv jacobi jacobi_t labels legend linearInterp linearSpline_t lineSearch_t linspace log log log10 log10 log10_t log_t makeLogo matmul matmul maxval mean meshGridX meshGridY minimumResidual minval mixval mul_t neg_t newAbs newAcos newAdd newAsin newAtan newCos newDiv newExp newImag newIterator newLog newLog10 newMul newNeg newNodeStack newPow newReal newSin newSparse newSpvec newSqrt newSub newTan newToken newVar nint nodeStack_t norm2 norm2 operator(*) operator(*) operator(*) operator(**) operator(+) operator(+) operator(+) operator(-) operator(-) operator(.d.) operator(.o.) operator(.o.) operator(.oo.) operator(.sx.) operator(.x.) operator(/) operator(/) operator(<) operator(>) plot plot3 pop pow_t printTypes push quat_t quiver randomNormal randomUniform readGrid readStep real_t realToChar realToTime removeSpaces scaler scatter setRandomSeed setup show showProgress sin_a sin_t solveLU solveLU solverProgress SOR_t span sqrt sqrt_t startReport startsWith stDev steepestDescent sub_t subplot successiveOverRelaxation sum sum surface symmetricGaussSeidel symmetricSuccessiveOverRelaxation tan_a tan_t TDMA TDMA testBasic testBasicSolvers testColorize testColorMap testConstants testCpuTime testDeDup testDiff testDot testEndsWith testFFT testFlatten testFunction testIFFT testIntToChar testLinearInterp testLinspace testLU testMean testMeshGrid testMixval testNewConfig testNewSparse testNewSpline testNext testObjective testObjectiveN testPlot testPrecision testRandomNormal testRandomUniform testRead testReadGmsh testRealToChar testRealToTime testRemoveSpaces testSetRandomSeed testSolvers testSpan testSplineX testSpvec testStartsWith testStDev testTDMA testWallTime testWrite testWriteMat testWriteVTK testWriteVTK ticks title token_t tokenize toRPN transpose v2m var_t vector wait wallTime wireframe writeGrid writeGridVTK writeHeaderVTK writeMat writeScalarVTK writeStep writeVectorVTK xlabel xlim xticks xylim xyzlim ylabel ylim yticks