<｜begin▁of▁sentence｜>### Instruction:
Given the coauthorships in network science graph which you can read from a GML file named netscience.gml, can you use both Louvain and Walktrap methods in cdlib to perform community detection and then plot the relation between community size and internal edge density?
### Response:
from cdlib import algorithms, viz, evaluation
import networkx as nx
# Read the network science coauthorship graph
g = nx.read_gml('netscience.gml')
# Detect communities using the Louvain method
coms = algorithms.louvain(g)
# Detect communities using the Walktrap method
coms2 = algorithms.walktrap(g)
# Plot the relation between community size and internal edge density
lmplot = viz.plot_com_properties_relation([coms,coms2], evaluation.size, evaluation.internal_edge_density)
<|EOT|>
