Questions tagged [matplotlib.mlab]

Questions on the matplotlib mlab API: MATLAB-compatible functions

https://matplotlib.org/api/mlab_api.html

15 questions
7
votes
2 answers

3D Waterfall Plot with Colored Heights

I'm trying to visualise a dataset in 3D which consists of a time series (along y) of x-z data, using Python and Matplotlib. I'd like to create a plot like the one below (which was made in Python:…
IanRoberts
  • 2,846
  • 5
  • 26
  • 33
4
votes
1 answer

An equivalent function to matplotlib.mlab.bivariate_normal

As of Matplotlib 3.1, mlab.bivariate_normal is removed from matplotlib's library. I was wondering if there is a built-in class that does the same job elsewhere (or in matplotlib)? I searched for a bit but can't find it readily. I realize that one…
user7864386
3
votes
0 answers

Matplotlib 3D: axis bounds always too large (doesn't set lims correctly)

I have an issue (bug?) with 3D plotting in matplotlib that I wonder if anyone may be able to help with please? As can be seen by the matplotlib gallery example plots (e.g. from: https://matplotlib.org/examples/mplot3d/surface3d_demo.html), when the…
IanRoberts
  • 2,846
  • 5
  • 26
  • 33
2
votes
0 answers

Why the outputs of spectrogram between python and MATLAB are greatly different?

I am trying to translate a MATLAB script into a python script. However, I got completely different outputs from the MATLAB spectrogram and the matplotlib.mlab.specgram(). I checked other questions, however, they didn't help my problem. Could you…
Kei
  • 21
  • 2
2
votes
0 answers

Matplotlib.mlab Objects cannot be broadcast to a single shape

My code: (x, y, t) = mlab.psd( d, Fs=1.0 / h['xdelta'], NFFT=512) psd = 20 * np.log10(y) plt.plot(x, y, t) plt.show() I just get a the following error upon execution: ValueError: shape mismatch: objects cannot be broadcast to a single…
Orange
  • 43
  • 13
1
vote
1 answer

How to make class for onclick(event) functions for Interactive plot in matplotlib?

I have tried to create an interactive matplotlib plot using some functions. I want to group the functions into one class (I am still new to this, took help from someone else's code) import matplotlib.pyplot as plt def draw_line(startx,starty): …
1
vote
1 answer

Not able to draw a bounding box with "Width" attribute on the matplotlib's plot?

I am trying to draw a bounding box across text such as : from matplotlib.pyplot import text from matplotlib.patches import FancyBboxPatch import matplotlib.transforms as mtransforms import numpy as np import matplotlib.pyplot as plt def…
Anu
  • 3,198
  • 5
  • 28
  • 49
1
vote
0 answers

How to use own CSV file in matplotlib

I am facing the problem with loading CSV data into matplotlib. This is how my code looks like this: import numpy as np import matplotlib.cm as cm import matplotlib.mlab as mlab import matplotlib.pyplot as plt import pandas as pd csv_filename =…
Roman Šimr
  • 81
  • 1
  • 10
1
vote
1 answer

How to converting string dates(YYYY-MM-DD) from SQL database to matplotlib dates in python?

I wanna plot a graph for data present in the database of temperature and dates. the data dates is of string type. I tried to convert the string type into matplot date using date2num() function. But, while at the time of plotting graphs I observed…
Sri Harsha
  • 123
  • 2
  • 2
  • 12
0
votes
0 answers

How can I plot a matplotlib.mlab spectrogram while keeping the frequency and time values?

I'm trying to plot a colour map and I need to use mlab.specgram() to perform a cross-correlation of two functions in the frequency domain, so I can't use pyplot.specgram(). I used pyplot.imshow in order to plot a colour map of the cross-correlation,…
Petra
  • 195
  • 1
  • 1
  • 10
0
votes
1 answer

What to use instead of csv2rec

According to the documentation matplotlib.mlab.csv2rec is deprecated, but the message doesn't indicate what we should move to instead. This is an extremely useful function that keeps my scripts short, I don't want to go rewrite all of this by hand.…
Elliott Slaughter
  • 1,455
  • 19
  • 27
0
votes
1 answer

Superimpose two Voronoi plots in Python

I'd like to superimpose two Voronoi plots in Python, but when I plot the two it just gives me two different plots ( I want both diagrams on the same plot). Here's my code : import numpy as np import scipy.spatial as sp import matplotlib.pyplot as…
0
votes
1 answer

Differences between mlab PCA and sklearn PCA

I have a certain set of "2-dimensional" data which I have to study using a PCA decomposition. As a first step I tried using the matplotlib.mlab library: import numpy as np from matplotlib.mlab import PCA data = np.loadtxt("Data.txt") result =…
dade
  • 1
  • 1
0
votes
1 answer

python pyplot negative contour lines not displayed

minr=min(r_s) maxr=max(r_s) mini=min(i_s) maxi=max(i_s) xi=np.arange(minr,maxr, 0.1) yi=np.arange(mini,maxi, 0.1) zi=mlab.griddata(r_s, i_s, r_z, xi, yi, interp='linear') plt.rcParams['contour.negative_linestyle'] =…
Kam
  • 3
  • 2
0
votes
0 answers

Memory Usage python matplotlib.mlab.griddata

Using the griddata-function of matplotlib.mlab I'm facing some problems with memory usage. The function is called several times by the scipy.integrate.quad-function. The task manager tells me that python allocates up to ~1,8 GB memory before it…
Frettchen
  • 11
  • 3