Plot information stored in dataframe within a tree (ggtree)
You can accomplish this using the ggtree package available on Bioconductor.
First you will need to combine your tree with the data.
library(tidyverse)
library(ggtree)

ftree &lt;- tree$edge %&gt;%
   as_tibble() %&gt;%
   mutate(Node_number = 1:n()) %&gt;% # finds edge numbering
   right_join(data, by = &quot;Node_number&quot;) %&gt;% # find internal node associated with your node numbering 
   left_join(fortify(tree, ladderize = FALSE), ., by = c(&quot;node&quot; = &quot;V2&quot;)) # merge tree and data

Note that this will produce a warning, but it does work.
Then plot the tree using ggtree and its geom_nodepoint layer.
ggtree(ftree, ladderize = FALSE) + # plots tree
   geom_tiplab() + # adds tip labels
   geom_nodepoint(aes(subset = !is.na(Number), size = Number, x = branch)) + # adds your data as points
   scale_size_continuous(range = c(4, 12)) # scales point sizes


You can adjust the size of the points with the scale_size_continuous function.
Data
data &lt;- read_csv('Node_number,Number 
50,31
1,15
13,25
35,12
40,4
5,2')

and tree is the same as you provided.
Ggtree also has a decent manual available at https://yulab-smu.top/treedata-book/.