pheatmap , Clustering tree down

I'm trying to plot a picture by pheatmap package, but when clusting the rows, the tree's direction is downside rather than upwards. pls help me, thank you.

pheatmap(fpkm.no0,scale = 'row',clustering_distance_rows = 'euclidean',cluster_cols = T,
clustering_method = 'median',angle_col = 45,fontsize = 30,treeheight_col = 60,
treeheight_row = 60,fontfamily = 'serif',fontsize_number = 25,show_rownames = F,
color = colorRampPalette(c('#669999','white','#003366'))(30))

The reason is likely the clustering_method = 'median' as explained in the documentation:

Note however, that methods "median" and "centroid" are not leading to a monotone distance measure, or equivalently the resulting dendrograms can have so called inversions or reversals which are hard to interpret, but note the trichotomies in Legendre and Legendre (2012).

So apparently it's not unexpected, as to what you should do, I don't know. Maybe don't use median as a method, or you can try and follow this suggestion.