Error using Plotly in Google Colab, uniformtext-options not available

Hi Plotly-Community,

I wanted to use plotly-express in Google Colab but couldn’t get the following example to work, which worked fine in jupyter notebooks locally:

Controlling text fontsize with uniformtext

I received the following error message:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-26-66f710cfe1f8> in <module>()
      4 fig = px.bar(df, y='pop', x='country', text='pop')
      5 fig.update_traces(texttemplate='%{text:.2s}', textposition='outside')
----> 6 fig.update_layout(uniformtext_minsize=8, uniformtext_mode='hide')
      7 fig.show()

3 frames
/usr/local/lib/python3.6/dist-packages/plotly/basedatatypes.py in _raise_on_invalid_property_error(self, *args)
   3664                     full_obj_name=full_obj_name,
   3665                     invalid_str=invalid_str,
-> 3666                     prop_descriptions=self._prop_descriptions,
   3667                 )
   3668             )

ValueError: Invalid properties specified for object of type plotly.graph_objs.Layout: ('uniformtext_minsize', 'uniformtext_mode')

I also checked the version of plotly, which is 0.4.1 locally and on Google Colab.

Is there a way to get the text-size functionality in Google Colab that I am missing?

thanks, Michael

1 Like