I have a dataframe with two values x1 and x2, each of these points has a class label. import numpy as np import pandas as pd import matplotlib.pyplot as plt
I am trying to draw a 3D plot using matplotlib for my below code, but in the plot wireframe is not displayed over the surface. I thought it might be a problem w
This link has R code to replicate ggplot's colours: Plotting family of functions with qplot without duplicating data I have had a go at replicating the code in
I solved my own question after a long and failed search, so I'm posting the question here and the answer immediately below. The goal: plot percentages but annot
Take the following seaborn boxplot for example, from https://stanford.edu/~mwaskom/software/seaborn/examples/horizontal_boxplot.html import numpy as np import
How can I label each boxplot in a seaborn plot with the median value? E.g. import seaborn as sns sns.set_style("whitegrid") tips = sns.load_dataset("tips") ax
Code is: import numpy as np import matplotlib.pyplot as plt from matplotlib import colors example_data = np.random.randint(4, size=(40,44)) cmap = colors.List
I would like to use a colormap from matplotlib e.g. CMRmap. But I don't want to use the "black" color at the beginning and the "white" color at the end. I'm int
Is there a way to change the font color of the legend in a matplotlib plot? Specially in occasions where the background of the plot is dark, the default black t
I am new to python and I'm trying to make a drop down menu for this graph that shows temperatures at different times of day.The datas are imported from a csv fi
My code is succesfully saving images to file, but it is cropping important details from the right hand side. Answers exist for fixing this problem when it arise
I'm using PyCharm 2021.2.3 Community Edition Python interpreter 3.10.0 matplotlib 3.5.0 seaborn 0.11.2 numpy 1.21.4 pandas 1.3.4 PySimpleGUI 4.55.1 When I run t
I'm using seaborn.displot to display a distribution of scores for a group of participants. Is it possible to have the y axis show an actual percentage (example
For some reason, I need to set the keyword "block" equal to True explicitly, so that plots are shown when I run a script from the bash shell. (I don't need that
I've increased the font of my ticklabels successfully, but now they're too close to the axis. I'd like to add a little breathing room between the ticklabels an
I've increased the font of my ticklabels successfully, but now they're too close to the axis. I'd like to add a little breathing room between the ticklabels an
Is there a way to group boxplots in matplotlib? Assume we have three groups "A", "B", and "C" and for each we want to create a boxplot for both "apples" and "o
I plot a figure as below: plt.plot(lon,lat,'ro-') plt.show() but the lines aren't closed. How can I make them closed as polygons? thank you