Skip to content
Advertisement

Tag: matplotlib

Shading between two lines with Matplotlib

I want to use axvspan() function to visualize a DataFrame that I obtained using Pandas DataReader.But when I use the the following codes, I saw an error and there is no shading in subplots. What should I do? Thank you. Answer Try looping over all Subplots and adding axvspan to the specific AxesSubplot instead: Some slight code reduction using the

How to provide axis for seaborn clustermap

I want to provide the plot axes for a seaborn clustermap. The docs say that additional arguments are passed to the heatmap function. The docs of the heatmap function mention the keyword argument ax. Which is why I call the clustermap function with the keyword argmument ax=plt.gca(). However this will result in the following error: Thus I was wondering how

Color bar limits doesn’t follow the data limits

I am trying to make plot with two 2d histograms. And i need them both to have a colorbar. But, i was able to plot the colobar at the lateral of one of these histograms, but as can see in the image below, the limits of the color bar doesn’t reflect the limits of the histogram. The bin with higher

How to have a poligon in the legend

I have a chart with 4 elements: blue square,blue triangle, red square and red triangle, I’m tryng to add these 4 items to the legend. when I add a polygon patch to the legend, it is displayed as a rectangle, even though the patch is of a triangle How can I get it to work? Answer You could use line

Advertisement