plot

How to plot a multidimensional array in a 3D plot?

How to plot a multidimensional array in a 3D plot? Question: I have a multidimensional array (P x N x M) and I want to plot each N x M array in a 3D plot in such a way the P images are stacked along the z-axis. Do you know hw to do this in …

Total answers: 2

custom legend function for matplotlib chart

custom legend function for matplotlib chart Question: Right now when I have dual y-axis and I want to have one legend box for both of my labels I do the following: fig, ax = plt.subplots(1,2) ax0=ax[0].twinx() line1=ax[0].plot([1, 2, 3], [4, 5, 6], ‘b’, lw=1, label=’Line 1′) line2=ax0.plot([1, 2, 3], [6, 5, 4], ‘r’, lw=1, label=’Line …

Total answers: 1

How to plot multiple dataframes with different lenghts into one plot

How to plot multiple dataframes with different lenghts into one plot Question: the question I have a lot of dataframes (approx. 300) that I would like to plot into one line chart. The issue is – they all have different number of values (lengths). How to normalise the dataframes, so they can be plotted on …

Total answers: 4

plt.show() results in an empty plot figure

plt.show() results in an empty plot figure Question: plt.show() isn’t working in Matplotlib Python My Code: # Python program to show pyplot module import matplotlib.pyplot as plt from matplotlib.figure import Figure # Creating a new figure with width = 5 inches # and height = 4 inches fig = plt.figure(figsize =(5, 4)) # Creating a …

Total answers: 1

Change the cell size/width of imshow or similar function

Change the cell size/width of imshow or similar function Question: I need the first and last cells to be half the width. My goal is to get something like this: But I got this: My code: import numpy as np import matplotlib.pyplot as plt data = np.array([0. , 0.2 , 0.4 , 0.6 , 0.8 …

Total answers: 1

How to make a barplot not based of labels?

How to make a barplot not based of labels? Question: I don’t have a dummy code so I will try to explain it as good as I can. If no success I will try to think of a code to make it more clear. My question is regarding making a barplot. I’d like to make …

Total answers: 1

how to plot line with angle 60 degree

how to plot line with angle 60 degree Question: i have some data of colors in RGB, i want to plot it to CIEab color channel in 2d which is use the data of a & b. then i need to separate my data with a line which is 60 degree i have done plot …

Total answers: 2

How find the minimum point on the plotted line (xmin, ymin) add the minimum point?

How find the minimum point on the plotted line (xmin, ymin) add the minimum point? Question: i can’t find min. How to add minimum point? Please help How find the minimum point on the plotted line (xmin, ymin) add the minimum point ? import numpy as np import matplotlib.pyplot as plt x = np.linspace(-5, 5, …

Total answers: 1

Bar plot type chart with unique values compounding the bars

Bar plot type chart with unique values compounding the bars Question: I’m trying to create a graph using python that show each value that count, stacked, in a form of column. df = pd.DataFrame() df[‘hour’]=[’00:00′, ’00:00′,’01:00′, ’01:00′,’01:00′,’02:00′,’02:00′,’03:00′,’03:00′,’03:00′,’03:00′,’03:00′,’04:00′,’05:00′,’05:00′,’05:00′] df[‘event’]=[‘abc’,’def’,’abc’,’def’,’ghj’,’def’,’klm’,’mno’,’klm’,’ghj’,’pqr’,’stu’,’def’, ‘abc’,’pqr’,’mno’ ] I’m expecting something like this: A solution or any insight will be very welcome! Asked …

Total answers: 2

How to stop matplotlib from incorrectly adding lines at vertical asymptotes?

How to stop matplotlib from incorrectly adding lines at vertical asymptotes? Question: For functions that contain vertical asymptotes, y^2 = x^3/(2(3) – x) for example, matplotlib will add in vertical lines at the asymptotes which majorly throws off the expected graph. I am using plot_implicit() from sympy. I have tried setting the adaptive attribute to …

Total answers: 1