When trying to change the color of the x and y axis I am using ax.tick_param.
If I use label color 'r' or labelcolor='#00000077', but if I write label color='grey' or a hex value: #bdbdbd then the background changes too. Is that expected?
This works:
ax.tick_params(labelsize=22, labelcolor='#00000077', top = False, left=False)
This doesnt:
ax.tick_params(labelsize=22, labelcolor='#BDBDBD', top = False, left=False)
This exact code gives me
using 'grey' although I think to recall seeing that once as well within Jupyter Lab ... but I think it was just related to the inline display, not the actual output of .savefig().
A wild guess is that you use labelcolor='#77', which is not a valid color name. This is only checked at draw time and can result in drawing some parts of the figure and then raising an exception.
If that's not it, please clean up your original description
Use inline code formatting (i.e. backticks) to mark code fragments, .e.g. labelcolor='grey'.
Be precise on what you write, sometimes you write "label color", sometimes you write "labelcolor".
This works / this does not work contains exactly the same code
The code for reproduction misses qoutes on the labelcolor value and is thus not executable.
Hi @timhoffm ,
It is github that trims the text, it says # 00 00 00 00 77 in reality, same with labelcolor= 'r'.
I think the issue is what @suuuehgi describes, I am using jupiter labs and the issue shows only on the inline display. When I moved the code to power bi it worked.
When writing code in Markdown, you should surround it with backticks. I have inserted some where I think they should go, but I am not 100% certain, so please edit again and correct any that are wrong.
Activity
suuuehgi commented on Oct 20, 2022
This exact code gives me

using 'grey' although I think to recall seeing that once as well within Jupyter Lab ... but I think it was just related to the inline display, not the actual output of .savefig().
ruthpozuelo commented on Oct 20, 2022
I am using Jupyter Lab and I am indeed looking at the inline display. Got it!
timhoffm commented on Oct 20, 2022
I'm sorry, I cannot follow your description.
A wild guess is that you use labelcolor='#77', which is not a valid color name. This is only checked at draw time and can result in drawing some parts of the figure and then raising an exception.
If that's not it, please clean up your original description
ruthpozuelo commented on Oct 20, 2022
Hi @timhoffm ,
It is github that trims the text, it says # 00 00 00 00 77 in reality, same with labelcolor= 'r'.
I think the issue is what @suuuehgi describes, I am using jupiter labs and the issue shows only on the inline display. When I moved the code to power bi it worked.
QuLogic commented on Oct 21, 2022
When writing code in Markdown, you should surround it with backticks. I have inserted some where I think they should go, but I am not 100% certain, so please edit again and correct any that are wrong.
ruthpozuelo commented on Oct 21, 2022
Done @QuLogic