Closed Jieran-S closed 4 months ago
What do you mean by "0 should be on the right and 1 should be on the right"? Did you follow this documentation?
If you want to change the side of the ticks from left to right, you can try the parameter label_side
(see here), if you set label_side
to the right (or bottom), then the ticks will be put on the left (or top), and vice versa.
I checked again. I didn't find any problem, could you please look into the documentation and confirm? @Jieran-S
Hey DingWB thanks for the quick response! ☺️ Let me explain my question a bit more clearly.
Say I have a heatmap as below, with the left annotation containing the boxplot. The boxplot dataframe is essentially the heatmap dataframe, I am projecting the heatmap row-wise to generate a boxplot.
Since the annotation is a left annotation, I would assume the boxplot to be orientated towards left, meaning the y-axis should be projecting towards left. (i.e. the minimal value of y-axis should be on the right, and the maximum y-axis value should be on the left). Whereas in this heatmap, the minimal y-axis value (0) is on the left and the max (1) is on the right, making the boxplot facing not left but right.
Here is how I coded the left annotation:
box = anno_boxplot(results, cmap="cividis", height=30, legend=False)
row_ha = HeatmapAnnotation(sample=anno_label(row_split, merge=True, rotation=0),
domains=anno_simple(row_anno.domains),
samples=anno_simple(row_anno.samples),
all_method_result=box,
axis=0, orientation='left')
Could you help me check a bit which might be the problem? I tried almost everything but it just dosen't work...
Hi @Jieran-S ,
Thanks for your explanation. Is there any problem if you run this example code? If not, something might be wrong with your code or data. Could you please tell me which version you are using? If it is not the latest version, please upgrade to the newest version and try again.
If you are still facing the same issue with the latest version, please upload your data and paste your code, and I will debug it.
When plotting left boxplot annotation, even if I set the variable as suggested in the tutorial, the boxplot annotation on the left is still oriented to the right (meaning 0 at left and 1 at right), see image below for better demonstration.
My code for the left_annotation is
And I call this annotation in
ClusterMapPlotter
byChecking the source code, we only call
vert=False
when we selectaxis=0
and that automatically changes the boxplot into a horizontal but right-facing orientation. I was wondering if we can add something likeor something similar to change the orientation of the boxplot?
This is the boxplot orientation I am talking about: if the annotation is on the left, 0 should be on the right and 1 should be on the right