ggplotly()
〜ggplot
のグラフを使用すると問題が発生します.Y軸が消えます。ここでiris
データセットを使用して再現性の例(この例は非常にダンプですが、何でも)ggplot2 + plotly:軸のタイトルが消える
data(iris)
g = ggplot(data = iris, aes(x = Petal.Length, y = Petal.Width, fill = Species)) +
geom_bar(stat = "identity", position = "dodge") +
scale_fill_manual(name = "legend", values = c("blue", "red", "green")) +
ylab("Y title") +
ylim(c(0,3)) +
xlab("X title") +
ggtitle("Main title")
g
ggplotly(g)
あなたが見ることができるようだ、Y軸タイトルが消えました。
まあ、ylim
が削除されても機能しますが、y制限を指定したいと思います。
私は、次の操作を実行しようとした:
data(iris)
g = ggplot(data = iris, aes(x = Petal.Length, y = Petal.Width, fill = Species)) +
geom_bar(stat = "identity", position = "dodge") +
scale_fill_manual(name = "legend", values = c("blue", "red", "green")) +
scale_y_continuous(name = "Y title", limits = c(0, 3)) +
xlab("X title") +
ggtitle("Main title")
g
ggplotly(g)
しかし、今では収まらない凡例のタイトルです。
マイ設定:3.2.0 R、plotly 2.0.16、ggplot2両方の例では2.0.0
はggplotによって与えられたグラフは、私が欲しいものですが、ggplotly何か他のものを与えます。回避策はありますか?
これは、ファセット – marbel