For a randomized normal dataset, When drawing histogram (histogram value/ scale = percent) and density (density value / type = normal scale = density) separately, their y-axes scales are different. I wanna draw a histogram and density together with histogram percentage on the left y-aix and probability density on the right y-axis. But once I have combined them, the two y-axes have the same scale with histogram percentage. proc sgplot data = normal_distribution; histogram value / scale = percent legendlabel = 'Histogram' fillattrs=(color=blue) name = 'hist'; density value / type = normal scale = density y2axis lineattrs=(color=red thickness=2) legendlabel='Probability Density' name = 'dens'; keylegend 'hist' 'dens' / linelength= 10 location = outside position = bottom; yaxis label = 'Histogram Percentage (%)'; y2axis label = 'Probability Density'; run;
... View more