lava / matplotlib-cpp

Extremely simple yet powerful header-only C++ plotting library built on the popular matplotlib
MIT License
4.4k stars 1.13k forks source link

subplot #128

Open tupaibasu2004 opened 5 years ago

tupaibasu2004 commented 5 years ago

Thanks for this nice header file. I m planning to use this header file to plot some graphs for my PhD work. In case of subplot, I need to know if the following can be done:- 1.Can the font size be adjusted for Main title, Legend and axes labels? 2.Say suppose subplot is used to plot 6 graphs in 2 rows and 3 columns. Is there any function to adjust the length and the width of the area over which each individual graph is plotted? (other than the navigation bar of the graph display window of matplotlib)

ningli commented 5 years ago

For your second question, there is a 'subplots_adjust' function. You do something like:

std::map<std::string, double> keywords; keywords.insert(std::make_pair("left", 0.1)); // also right, top, bottom keywords.insert(std::make_pair("wspace", 0.3)); // also hspace plt::subplots_adjust(keywords);

Check the python documentation for meanings of these parameters.