data-visualization

How to change the colour of the median line in seaborn boxplot?

How to change the colour of the median line in seaborn boxplot? Question: More generally, how to change the colour values for a subset of the boxes properties in a seaborn boxplot? Be that the median, the whiskers, or such. I’m particularly interested in how to change the median value, as I have to create …

Total answers: 2

Heatmap with circles indicating size of population

Heatmap with circles indicating size of population Question: I would like to produce a heatmap in Python, similar to the one shown, where the size of the circle indicates the size of the sample in that cell. I looked in seaborn’s gallery and couldn’t find anything, and I don’t think I can do this with …

Total answers: 5

Using Altair on data aggregated from large datasets

Using Altair on data aggregated from large datasets Question: I am trying to histogram counts of a large (300,000 records) temporal data set. I am for now just trying to histogram by month which is only 6 data points, but doing this with either json or altair_data_server storage makes the page crash. Is this impossible …

Total answers: 3

Save Jupyter Notebook with Plotly Express widgets displaying

Save Jupyter Notebook with Plotly Express widgets displaying Question: I have a Jupyter notebook (python) where I used plotly express to plot in the notebook for analysis purposes. I want to share this notebook with non-coders, and have the interactive visuals be available still – but it does not seem to work. I tried following …

Total answers: 4

How to change annotation orientation in plotly?

How to change annotation orientation in plotly? Question: Say I have the following figure: import numpy as np import plotly.graph_objs as go z=np.random.randint(1000, 11000, size=20) trace=dict(type=’scatter’, x=3+np.random.rand(20), y=-2+3*np.random.rand(20), mode=’markers’, marker=dict(color= z, colorscale=’RdBu’, size=14, colorbar=dict(thickness=20))) axis_style=dict(zeroline=False, showline=True, mirror=True) layout=dict(width=550, height=500, xaxis=axis_style, yaxis=axis_style, hovermode=’closest’, ) fig=go.FigureWidget(data=[trace], layout=layout) fig Now say I want the colorbar to have a …

Total answers: 2

Why does my google colab session keep crashing?

Why does my google colab session keep crashing? Question: I am using google colab on a dataset with 4 million rows and 29 columns. When I run the statement sns.heatmap(dataset.isnull()) it runs for some time but after a while the session crashes and the instance restarts. It has been happening a lot and I till …

Total answers: 6

Double header in Matplotlib Table

Double header in Matplotlib Table Question: I need to plot a table in matplotlib. The problem is some columns have one-level headers, some columns have double-level headers. Here’s what I need: Here’s simple example for one-level headers: df = pd.DataFrame() df[‘Animal’] = [‘Cow’, ‘Bear’] df[‘Weight’] = [250, 450] df[‘Favorite’] = [‘Grass’, ‘Honey’] df[‘Least Favorite’] = …

Total answers: 5

How to make dots in Swarmplot (Seaborn) overlap with each other?

How to make dots in Swarmplot (Seaborn) overlap with each other? Question: I have made a swarmplot with seaborn, but I can’t seem to find the option to make the dots overlap with each other. They overlap with each other, but only at the sides. I would like them to make overlap everywhere when they …

Total answers: 3

Flow visualisation in python using curved (path-following) vectors

Flow visualisation in python using curved (path-following) vectors Question: I would like to plot a vector field with curved arrows in python, as can be done in vfplot (see below) or IDL. You can get close in matplotlib, but using quiver() limits you to straight vectors (see below left) whereas streamplot() doesn’t seem to permit …

Total answers: 5

AttributeError: Unknown property axisbg

AttributeError: Unknown property axisbg Question: Here is a code am trying to run: ax = plt.axes(axisbg=’#E6E6E6′) ax.set_axisbelow(True) plt.grid(color=’w’,linestyle=’solid’) for spine in ax.spines.values(): spine.set_visible(False) ax.xaxis.tick_bottom() ax.yaxis.tick_left() ax.tick_params(colors=’gray’,direction=’out’) for tick in ax.get_xticklabels(): tick.set_color(‘gray’) for tick in ax.get_yaxislabels(): tick.set_color(‘gray’) ax.hist(x,edgecolor=’E6E6E6′,color=’E6E6E6′); And the Error is: AttributeError: Unknown property axisbg Please help me identify the error. Asked By: Abhishek Kumar …

Total answers: 2