How to add hatches to boxplots with sns.boxplot or sns.catplot

Iterate through each subplot / FacetGrid with for ax in g.axes.flat:. ax.patches contains matplotlib.patches.Rectangle and matplotlib.patches.PathPatch, so the correct ones must be used. Caveat: all hues must appear for each group in each Facet, otherwise the patches and hatches will not match. In this case, manual or conditional code will probably be required to correctly … Read more

Saving Matplotlib graphs to image as full screen

The method you use to maximise the window size depends on which matplotlib backend you are using. Please see the following example for the 3 most common backends: import matplotlib.pyplot as plt plt.figure() plt.plot([1,2], [1,2]) # Option 1 # QT backend manager = plt.get_current_fig_manager() manager.window.showMaximized() # Option 2 # TkAgg backend manager = plt.get_current_fig_manager() manager.resize(*manager.window.maxsize()) … Read more

3d GNUPLOT Animation With Multiple Graphs

I needed to switch it to all within one splot command like so: # define fixed axis-ranges # filename and n=number of lines of your data filedata=”Sun_t_v_state.dat” filedata2 = ‘Mercury_v_state.dat’ filedata3 = ‘Venus_t_v_state.dat’ filedata4 = ‘Earth_t_v_state.dat’ filedata5 = ‘Mars_t_v_state.dat’ filedata6 = ‘Jupiter_t_v_state.dat’ filedata7 = ‘Saturn_t_v_state.dat’ filedata8 = ‘Uranus_t_v_state.dat’ filedata9 = ‘Neptune_t_v_state.dat’ filedata10 = ‘Pluto_t_v_state.dat’ n … Read more

How to remove or hide y-axis ticklabels from a matplotlib / seaborn plot

seaborn is used to draw the plot, but it’s just a high-level API for matplotlib. The functions called to remove the y-axis labels and ticks are matplotlib methods. After creating the plot, use .set(). .set(yticklabels=[]) should remove tick labels. This doesn’t work if you use .set_title(), but you can use .set(title=””) .set(ylabel=None) should remove the … Read more