filmov
tv
【Practical programming】How to display multiple line graphs on one graph with R

Показать описание
(Japanese follows English.) I will share my programming knowledge with anyone who wants to make a living from programming.
This time, I would like to draw multiple graphs on one graph with R.
First, prepare the data. The prepared data is data that records how many days, minutes, and what you studied.
If this data is graphed, it will be displayed like this.
The graphs are color-coded according to what you have studied.
You can show or hide the graph by clicking the legend on the right side of the graph.
Looking at the code for color coding, there is information about what you are studying in the color argument of the plot_ly function.
Currently, there is English Chinese Spaninsh in the study content information, but when it is displayed in the graph, it is displayed in alphabetical order.
And the color gradation at the time of color coding can be specified by the colors argument.
Now, since blue and red are used for colors, Chinese is blue, English is purple, which is an intermediate color between blue and red, and Spanish is red.
Subtitles are in the comments section of this video.
プログラミングで生計を立てようとしている人に向けて、私のプログラミングの知識を共有します。
今回は、Rで一つのグラフに複数のグラフを描画したいと思います。まず、データを用意します。用意したデータは、何日に、何分、何を勉強したかを記録したデータです。こちらのデータをグラフにした場合、こちらのような表示になります。何を勉強したかで、グラフが色分けされます。グラフ右側の凡例部分をクリックすると、そのグラフの表示非表示を切り替えられます。色分けの為のコードを見ると、plot_ly関数のcolor引数に勉強内容の情報があります。今、勉強内容の情報にEnglish Chinese Spaninshがありますが、グラフに表示される時は、alphabet順の順番で表示されます。そして、色分けする時の色のグラデーションは、colors引数で指定できます。今、colorsにblueとredをしている為、グラフ上ではChineseがblue、Englishがblueとredの中間の色のpurple、Spanishがredとなります。
This time, I would like to draw multiple graphs on one graph with R.
First, prepare the data. The prepared data is data that records how many days, minutes, and what you studied.
If this data is graphed, it will be displayed like this.
The graphs are color-coded according to what you have studied.
You can show or hide the graph by clicking the legend on the right side of the graph.
Looking at the code for color coding, there is information about what you are studying in the color argument of the plot_ly function.
Currently, there is English Chinese Spaninsh in the study content information, but when it is displayed in the graph, it is displayed in alphabetical order.
And the color gradation at the time of color coding can be specified by the colors argument.
Now, since blue and red are used for colors, Chinese is blue, English is purple, which is an intermediate color between blue and red, and Spanish is red.
Subtitles are in the comments section of this video.
プログラミングで生計を立てようとしている人に向けて、私のプログラミングの知識を共有します。
今回は、Rで一つのグラフに複数のグラフを描画したいと思います。まず、データを用意します。用意したデータは、何日に、何分、何を勉強したかを記録したデータです。こちらのデータをグラフにした場合、こちらのような表示になります。何を勉強したかで、グラフが色分けされます。グラフ右側の凡例部分をクリックすると、そのグラフの表示非表示を切り替えられます。色分けの為のコードを見ると、plot_ly関数のcolor引数に勉強内容の情報があります。今、勉強内容の情報にEnglish Chinese Spaninshがありますが、グラフに表示される時は、alphabet順の順番で表示されます。そして、色分けする時の色のグラデーションは、colors引数で指定できます。今、colorsにblueとredをしている為、グラフ上ではChineseがblue、Englishがblueとredの中間の色のpurple、Spanishがredとなります。