Skip to content
Advertisement

Tag: matplotlib

Proplot colorbar from custom cmap

I’d like to add a colorbar to my figure from a Colormap object rather than using a mappable (such as returned from imshow. From the docs I think this should be possible using option 4. I’m using the following code: This gives the following result: Which almost what I want but I’d like to color bar values to ranges from

Matplotlib stacked histogram numpy.ndarray error

I am trying to make a stacked histogram using matplotlib by looping through the categories in the dataframe and assigning the bar color based on a dictionary. I get this error on the ax1.hist() call. How should I fix it? AttributeError: ‘numpy.ndarray’ object has no attribute ‘hist’ Reproducible Example Updated effort, still not working This is close, but it is

Exe generated by PyInstaller fails quietly on a different machine

I’m having trouble getting an exe generated by PyInstaller on one PC (PC-Good) working on another (PC-Bad). The exe is created on PC-Good, and executes as expected on PC-Good Both PCs are running Windows 10 Issue occurs on PC-Bad upon calling most of the matplotlib.pyplot methods (such as subplots() or plot()) Issue persists even when matplotlib is in non-interactive mode

Python: Add dynamic text in Matplotlib animation

I made an animation from the list of images saved as numpy arrays. Then I want to add a text onto the animation like like a subtitle whose text changes for each frame but placing plt.text(some_string) only adds the string at the first iteration and it does not work if I change the passed string in the loop. Below is

Export huge seaborn chart into pdf with multiple pages

I created a program which generates a large number of chart using seaborn catplot. This is the example of my code with the illustration of how the final chart looks like. However since the plot may extend up to more than 300 plots, when I tried to export to pdf, the size of the chart is too big and big

Advertisement