matplotlib - Set the height and width of a mpld3 plot -


i want set width , height of mpld3 plot specific value (in pixels, fits div in). way tried looks (javascript):

commands["width"]=plotwidth; commands["height"]=plotheight; mpld3.draw_figure("plotname",commands); 

plotwidth , plotheight values want height , width set to.

now, sets size of mpld3-figure object values want, plot inside still keeps old size, looks nothing happened. so, how change size of plot itself? far looks whatever do, plot not change.

you can change shape of mpld3 plot when creating figure python code plt.figure(figsize=(width,height)) (where width , height in inches). here notebook demonstrating this.

there has been some interest in making mpld3 figures "responsive", cooler , more precise way accomplish goal, far no 1 has tried making necessary code changes. patches welcome!


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -