“形状”图例仅为组的第一个图创建

时间:2020-05-26 19:40:36

标签: altair

我有6个图表的图表,这些图表是通过循环以相同的方式生成的(仅绘制的站点发生了变化)。然后将这些图合并:

图表= plot_group_0&plot_group_1 ...等

enter image description here

但是,仅在第一个图上显示指定右上角“时间间隔”的辅助图例细节。

此“间隔”图例由“形状”功能自动生成。

shape = alt.Shape('interval:N',title ='Interval'),

有没有一种方法可以明确地强制它出现在每个情节中?显然,循环中的每个图都执行了相关的“形状”线,因此我不确定为什么它只出现一次。

1 个答案:

答案 0 :(得分:0)

默认情况下,链接的图表共享其图例和比例。如果希望图例或比例尺独立,则可以设置$query = "INSERT INTO 'easycomputing'('STID', 'NAME', 'TONG') VALUES (:STID, :NAME, :TONG)"; $dns = " mysql:host=localhost;dbname=phan1"; $username="root"; $password= ""; // $password=""; try{ //access the database $db = new PDO($dns, $username, $password); //execute the query $statement = $db->prepare($query); $statement->bindValue(':STID', 137, PDO::PARAM_INT); $statement->bindValue(':NAME', 'tenten', PDO::PARAM_STR); $statement->bindValue(':TONG', 5, PDO::PARAM_INT); //execute the query if( $statement->execute() ){ echo "record tranfer successfully"; }else{ echo "fail to execute the record"; } 属性,如Scale and Guide Resolution

中所述

要共享比例但使用独立的图例,请使用:

resolve

要具有独立的比例和独立的图例,请使用

chart = plot_group_0 & plot_group_1 #... etc
chart = chart.resolve_legend(shape='independent')