I am struggling with a simple histogram where scales of x-axis should be free. ?Each panel should only show the range relevant for data plotted in that panel. ? library(lattice) library(AER) data(CreditCard) histogram( ~ card + reports, data = CreditCard, scales = "free") This code creates two panels of histograms. ?But each panel has x-axis range from 0 to 14 and "yes" and "no". ?I want a graph where "card" panel x-axis only has "yes" and "no" and where "reports" panel only has numbers 0 to 14. ? How can this code be fixed? Thanks, Naresh
start here library(latticeExtra) c(histogram(~ card, data=CreditCard), histogram(~ reports, data=CreditCard)) then continue with resizePanels(c(histogram(~ card, data=CreditCard), histogram(~ reports, data=CreditCard), y.same=TRUE), w=c(2,16))> On Apr 20, 2022, at 11:27, Naresh Gurbuxani <naresh_gurbuxani at hotmail.com> wrote: > > library(lattice) > library(AER) > data(CreditCard) > histogram( ~ card + reports, data = CreditCard, scales = "free")