[SOLVED] qwtspectrogram axis adjustment for area not pixels

Hi I am using qwtspectrogram to plot my array data but the problem i am having is scaling.. the qwt scales are distributed over the intervals x and y and the axis are dependent on the pixels. for example if I have a data set of (500x500) and i want to plot for 500mm x500mm its perfect because it is translated over the pixels but if i want to plot 500x500 number of points for 300mmx300mm it is a mess and it shows in the plot 500x500 i know i have to manage the x and y axis but I have no idea how to do that. I manage to play a little and display 500x500 for 250mmx250mm area but can not do for others.
my code is as shown below