I'm having trouble getting all of the axes onto the same scale when using altair to make a group of plots like so:
class_list = ['c-CS-m','c-CS-s','c-SC-m','c-SC-s','t-CS-m','t-CS-s','t-SC-m','t-SC-s']
list_of_plots = []
for class_name in class_list:
list_of_plots.append(alt.Chart(data[data['class'] == class_name]).mark_bar().encode(
x = alt.X('DYRK1A', bin = True, scale=alt.Scale()),
y = 'count()').resolve_scale(
y='independent'
))
list_of_plots[0] & list_of_plots[1] | list_of_plots[2] & list_of_plots[3] | list_of_plots[4] & list_of_plots[5] | list_of_plots[6] & list_of_plots[7]
I'd like to have the x axis run from 0.0 to 1.4 and the y axis run from 0 to 120 so that all eight plots I'm producing are on the same scale! I've tried to use domain, inside the currently empty Scale()
call but it seems to result in the visualisations that have x axis data from say 0.0 to 0.3 being super squished up and I can't understand why?
For context, I'm trying to plot continuous values for protein expression levels. The 8 plots are for different classes of mice that have been exposed to different conditions. The data is available at this link if that helps: https://archive.ics.uci.edu/ml/datasets/Mice+Protein+Expression
Please let me know if I need to provide some more info in order for you to help me!