matplotlib-cpp icon indicating copy to clipboard operation
matplotlib-cpp copied to clipboard

Markersize?

Open tkhamvilai opened this issue 6 years ago • 2 comments

Is there a way to increase the markersize on a plot? Thank you.

tkhamvilai avatar Apr 12 '18 01:04 tkhamvilai

Hi, were you able to find a way to do this?

Sanjeeev-K avatar Apr 21 '20 23:04 Sanjeeev-K

For 3d scatter function,

emplate<typename NumericX, typename NumericY, typename NumericZ>
bool scatter(const std::vector<NumericX>& x,
             const std::vector<NumericY>& y,
             const std::vector<NumericZ>& z,
             const double s=1.0, // The marker size in points**2
             const std::map<std::string, std::string> & keywords = {},
             const long fig_number=0) {

You can use the input parameter s, that is, const double s=1.0.

After the statement PyObject *kwargs = PyDict_New();, add PyDict_SetItemString(kwargs, "s", PyFloat_FromDouble(s)).

Another method, you need to judge in the keywords traversal that when the key is "s", the value is changed to double, because the default value of the keywords parameter is string.

guo-nix avatar Nov 17 '22 01:11 guo-nix