Oh OK, then you just want to pass some CSS style parameters when you call 
setLabel on either the PlotItem 
<https://pyqtgraph.readthedocs.io/en/latest/graphicsItems/plotitem.html#pyqtgraph.PlotItem.setLabel>
 
or AxisItem 
<https://pyqtgraph.readthedocs.io/en/latest/graphicsItems/axisitem.html#pyqtgraph.AxisItem.setLabel>.
 
What is not clear in the documentation is that the extra **args in 
PlotItem.setLabel get passed on to the AxisItem.setLabel, so you can use 
the same CSS styling parameters.

For example:
a_plotitem.setLabel("left", "temperature", color="#FF0000")

On Sunday, 17 January 2021 at 2:01:03 pm UTC+10:30 [email protected] 
wrote:

> no no, it is to change the color and font of the labels for example if we 
> have displayed "time" on the x-axis and "temperature" on the y-axis ".
>  How to change the color and font of the" time "labels and "temperature".
> thank you.
>
> Le dimanche 17 janvier 2021 à 02:50:44 UTC, Patrick a écrit :
>
>> Hi,
>>
>> Does AxisItem setTextPen() 
>> <https://pyqtgraph.readthedocs.io/en/latest/graphicsItems/axisitem.html#pyqtgraph.AxisItem.setTextPen>
>>  
>> do what you want?
>>
>> So something like this:
>> plot.getAxis("left").setTextPen((255, 0, 0))
>>
>> Patrick
>> On Sunday, 17 January 2021 at 11:24:07 am UTC+10:30 [email protected] 
>> wrote:
>>
>>> Hi
>>> how to change the color and font of axis and title labels in a PlotItem. 
>>> thank you so much
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/90655182-085b-41c3-847d-af24911e63f6n%40googlegroups.com.

Reply via email to