close
Skip to main content

New answers tagged

Score of 1
Accepted

matplotlib savefig silently exits with code 1 after plt.plot() succeeds — no exception, no output

The issue is that you did not run conda activate bo-xgb before running ~/.conda/envs/bo-xgb/python.exe, so the environment variables like PATH was not populated by Conda, causing the Python process to ...
Score of 1

matplotlib savefig silently exits with code 1 after plt.plot() succeeds — no exception, no output

the problem is one of these two things: problem in environment management by confusing between numpy 1 and numpy 2 version which makes matplotlib having issue with it. you have two solutions i think: ...
Score of 1

How to draw a radial axis in polar coordinate with matplotlib?

Here is what I have so far: #!/usr/bin/env python import copy import numpy as np import os, sys import matplotlib matplotlib.use('Agg') matplotlib.rcParams['text.latex.preamble'] = r'\usepackage{...
Score of -1

Trying to Change A Pixel in Python

I want to emphasize something that @furas touched on in their answer. When you see Python's assignment operator, =, don't think of it as an "equals" sign. The statement, a=b should be read ...
Score of 0

Unable to import matplotlib pyplot

hope you're doing good. If you want to just use pyplot, do this. Use pip to manage packages pip install matplotlib Next the way you import is much outdated nowadays, even though it's correct. It ...
Score of 6

Trying to Change A Pixel in Python

You have to do it directly in array imgRGB[242,71] = (255, 0, 0) Because you copy value from array to variable aCertainPixel = imgRGB[242,71] (it doesn't create reference to this pixel in array) and ...
Score of 1

How to draw a line outside of an axis in matplotlib (in figure coordinates)

Late to the party, but from the answer by Eric_Firing1 on the matplotlib website: "You can turn off the clipping to the axes box on a per-artist basis. Something like this:" import ...
Score of 1
Accepted

How do I use any of my system fonts in matplotlib GLOBALLY in the most straight-forward way possible?

This bloody thing took away like 6 hours of my life consulting with 2 different LLMs, and this is finally what works for me to update the Matplotlib cache with Windows 11 system fonts for MINGW64 (...
Score of 1

Matplotlib: zorder in 3d projection not working

For some reason, 3d graphs in matplotlib don't natively support assigned zorder and automatically calculate it instead. To disable that, use: ax = fig.add_subplot(projection= '3d', computed_zorder=...

Top 50 recent answers are included