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

Unable/unclear to use keyword 'extent' with imshow

Open jensdenbraber opened this issue 5 years ago • 2 comments

When setting the 'extent' keyword in the imshow function I receive the following error:

due to unexpected exception with message: Call to imshow() failed

How I call the imshow function:

PyObject* mat; plt::imshow(values, height, width, 1, {{"interpolation","bilinear"},{"origin", "lower"},{"aspect", "auto"}, {"extent","{0, 100, 0, 40}"}, &mat);

How could I provide imshow() with the extent keyword?

jensdenbraber avatar May 25 '20 11:05 jensdenbraber

That's probably because "{0, 100, 0, 40}" is passed as string to matplotlib but it expects an array or list. That's another case of #184: currently it is only possible to pass string kwargs.

Cryoris avatar May 25 '20 13:05 Cryoris

I suggested a solution for this in #241

RaphaelViards avatar Nov 27 '20 16:11 RaphaelViards