jktr / matplotlib-backend-kitty

show matplotlib plots directly in your kitty terminal
Creative Commons Zero v1.0 Universal
137 stars 16 forks source link

Control the image size being showed in kitty? #3

Closed h4pZ closed 2 years ago

h4pZ commented 3 years ago

Hi, I was wondering if there is a way to control the size of the plot being shown on the terminal, since it always takes the whole terminal window no matter the figsize

jktr commented 3 years ago

Plot size isn't configurable at the moment.

The plot's backing figure is actually resized on draw to match the terminal's current size. This is so that making your terminal larger takes advantage of the additional space and making your terminal smaller doesn't cut off parts of any subsequently rendered figure.

Could you describe your usecase for wanting differently-sized plots?

h4pZ commented 3 years ago

By getting different sized plots you could have a similar experience as in a jupyter notebook / lab., which was something I'm familiar with.

Also, sometimes I'll have two terminals, one with nvim and the other one with ipython. I'll iterate over my code by writing something on nvim and the executing it on ipython with something like vim-slime. In case of working with plots, being able to see how the actual image would look like when saved can help in this loop.

The last thing I can think of is when I have only ipython open, plotting it in the terminal doesn't allow me to see the previous code blocks I've written which is a little bit of an annoyance .

jktr commented 2 years ago

You can now set the environment variable MPLBACKEND_KITTY_SIZING to manual to disable the automatic resizing.