I want to connect box plot means. I can do the basic part but cannot connect box plot means and box plots offset from x axis. similar post but not connecting means Python: seaborn pointplot and boxplot in one plot but shifted on the x-axis As we can see the sns.line plot does not follow the means and box plots
Tag: matplotlib
How to update a NetworkX plot in real-time?
I’m trying to update a networkx plot using matplotlib in a canvas, but it adds a new plot to the graph each time instead of updating the graph below, I had to add the call to nx.draw_networkx() function to get it to update and I’m not sure if this is part of the issue. Example Code: Answer I have found
Seaborn histogram makes columns white
In what cases Seaborn makes histogram columns white? I use it Seaborn in Jupyter notebook: Then I plot histogram using this function: As a result in some cases I have histograms with all blue columns or some blue and some white or only white columns. Please, see attached pictures. How to make Seaborn always draw blue columns? Answer I believe
Seaborn expands X axis dates back to year 2000
I have a pandas dataframe that contains dates starting at 2017-09-01 (which I believe is in the correct format for a dataframe date). But the X axis is expanded dramatically. I do not have any outliers on the LHS. Answer Pandas and matplotlib’s dates sometimes don’t go along well. You can set the xlims explicitly as follows:
Matplotlib: changing the alpha of plotted image with AnnotationBox artist
This question is into relation with the following answer: https://stackoverflow.com/a/53851017/8814577 I’ve used the in the answer described method to drop images in a boxplot with AnnotionBox (from matplotlib.offsetbox) and it worked out great. However I’ve been searching but did not find an obvious solution to change the alpha channel (transparency) of the plotted image. I’ve been looking into trying to
Matplotlib pie chart: Show both value and percentage
Here’s my current code Currently, it shows only the percentage (using autopct) I’d like to present both the percentage and the actual value (I don’t mind about the position) How to do it? Thanks Answer Create your own formatting function. Note that you have to recalculate the actual value from the percentage in that function somehow
Matlab equivalent to Python’s figsize
In Python’s matplotlib.pyplot the figsize command allows you to determine the figure size, eg. Is there an equivalent command in Matlab that does this? These old posts show different solutions but none are as clean as Python’s figsize. Answer Since you aim for saving/exporting your figure, you must pay attention to the right Figure Properties, namely: PaperPosition, PaperSize, and PaperUnits.
Annotate 3D scatter plot on pick event
I want to show annotations on a 3D scatter plot when the user clicks on a point. The code I have shows the annotation once I move the plot after I click on a point. How can I make the annotation appear as soon as the user clicks on a point, without having to move the plot? Answer Add fig.canvas.draw_idle()
How do I convert this histogram into a dot plot/dot chart using matplotlib and numpy?
I’m trying to create a dot plot/dot chart based on students’ hours of sleep, but the closest I was able to get was a histogram which matched my data. The method I tried which will be provided below didn’t work for me either due to my sheer inexperience or incompatibility with my data. Any help would be greatly appreciated. I’ve
How to change spines linewidth in 3D plot?
When you have a 2D plot in matplolib you can change the line width of spines (the containing box) as follows: Figure with thick spines: However this same methodology does not work for 3D plots. How could I change the axes line thickness for a 3D plot? Answer You can do this using the following code. I adapted the idea