Closed SunYong0821 closed 2 months ago
The color
parameter in Numbers
is designed to accept only a single color as indicated in the documentation. Although it works if you supply multiple colors, the behavior is not guaranteed. If you want to customize each color, please use Bar
and check the last example https://marsilea.readthedocs.io/en/stable/api/APIs/marsilea.plotter.Bar.html
The
color
parameter inNumbers
is designed to accept only a single color as indicated in the documentation. Although it works if you supply multiple colors, the behavior is not guaranteed. If you want to customize each color, please useBar
and check the last example https://marsilea.readthedocs.io/en/stable/api/APIs/marsilea.plotter.Bar.html`Numbers`中的`color`参数设计为仅接受文档中指示的单一颜色。虽然如果您提供多种颜色它可以工作,但不能保证其行为。如果您想自定义每种颜色,请使用`Bar`并检查最后一个示例https://marsilea.readthedocs.io/en/stable/api/APIs/marsilea.plotter.Bar.html
It seems that it's not quite working either.
The
color
parameter inNumbers
is designed to accept only a single color as indicated in the documentation. Although it works if you supply multiple colors, the behavior is not guaranteed. If you want to customize each color, please useBar
and check the last example https://marsilea.readthedocs.io/en/stable/api/APIs/marsilea.plotter.Bar.html
group_rows, cut_rows and hsplit,It appears that these three features seem identical, but do they have any differences?
This is what you want:
import marsilea as ma
import marsilea.plotter as mp
import numpy as np
data = np.random.randn(4, 4)
h = ma.Heatmap(data)
h.add_right(mp.Bar([1,2,3,4], palette=["r", "g", ".1", ".8"]))
h.cut_rows([2])
h.render()
The
color
parameter inNumbers
is designed to accept only a single color as indicated in the documentation. Although it works if you supply multiple colors, the behavior is not guaranteed. If you want to customize each color, please useBar
and check the last example https://marsilea.readthedocs.io/en/stable/api/APIs/marsilea.plotter.Bar.htmlgroup_rows, cut_rows and hsplit,It appears that these three features seem identical, but do they have any differences?
Regarding this, hsplit
and vsplit
are deprecated, you should see a warning when you use them. group_rows
can split by given labels and order, cut_rows
can split only by the index of row.
@SunYong0821 As of v0.4.6, you can use multiple colors for color
in Numbers
.
Hope you enjoy Marsilea!
import marsilea as ma
import marsilea.plotter as mp
import numpy as np
data = np.random.randn(4, 4)
h = ma.Heatmap(data)
h.add_right(mp.Numbers([1, 2, 3, 4], color=["r", "g", ".1", ".8"]))
h.cut_rows([2])
h.render()
The
color
parameter inNumbers
is designed to accept only a single color as indicated in the documentation. Although it works if you supply multiple colors, the behavior is not guaranteed. If you want to customize each color, please useBar
and check the last example https://marsilea.readthedocs.io/en/stable/api/APIs/marsilea.plotter.Bar.html`Numbers`中的`color`参数设计为仅接受文档中指示的单一颜色。虽然如果您提供多种颜色它可以工作,但不能保证其行为。如果您想自定义每种颜色,请使用`Bar`并检查最后一个示例https://marsilea.readthedocs.io/en/stable/api/APIs/marsilea.plotter.Bar.htmlgroup_rows, cut_rows and hsplit,It appears that these three features seem identical, but do they have any differences?group_rows、cut_rows 和 hsplit,看起来这三个功能看起来相同,但是它们有什么区别吗?
Regarding this,
hsplit
andvsplit
are deprecated, you should see a warning when you use them.group_rows
can split by given labels and order,cut_rows
can split only by the index of row.关于这一点,hsplit
和vsplit
已被弃用,您在使用它们时应该会看到警告。group_rows
可以按给定的标签和顺序进行拆分,cut_rows
只能按行的索引进行拆分。
OK thx
@SunYong0821 As of v0.4.6, you can use multiple colors for
color
inNumbers
.Hope you enjoy Marsilea!
import marsilea as ma import marsilea.plotter as mp import numpy as np data = np.random.randn(4, 4) h = ma.Heatmap(data) h.add_right(mp.Numbers([1, 2, 3, 4], color=["r", "g", ".1", ".8"])) h.cut_rows([2]) h.render()
I test it pefect!~ thx~
if I didnt use
cut_rows
:if i use
cut_rows
:why?