All Questions

Tagged with
Filter by
Sorted by
Tagged with
0votes
0answers
9views

Using matplotlib and PyQt5

I'm writing code to update a matplotlib graph in real time while embedded into a PyQt5 application. Separately, the two pieces of code (for the graph and the embedding of a still graph. Putting the ...
user avatar
1vote
0answers
20views

How to plot a histogram for each sample from a 2D-array

On a dataset, I fitted one machine learning model multiples time and I collected the predictions in a NumPy array. The shape of the NumPy array is (400, 250) where 250 is the number of times I fitted ...
user avatar
  • 364
-2votes
0answers
16views

How can I graph correctly the x and y axis values in python

I expect a graph from 0 to 5 in X and form 0 to 200 in y import numpy as np import matplotlib.pyplot as plt import collections with open('Circulares.txt','r') as r: x=[] y=[] h=dict() ...
user avatar
  • 7
0votes
1answer
6views

The plot method plots the list shifted back by one, while scatter is ok

Hi the following code represents the first 10 integers' cubes. The scatter method works fine, the plot method shifts everything one to the left. The axis looks correct to me. I tried to figure it out ...
user avatar
0votes
0answers
18views

Correct Year not displayed on matplotlib plot python

So I am using LSTM model for multivariate time series prediction and plotting the predictions using matplotlib but it does not display accurate year which should be 2020 instead starts from 1970. My ...
user avatar
  • 1
0votes
0answers
17views

Plot depending on dataframe

I load a single file into three dataframes: data = pd.read_csv(file, sep='\t', names=['Time', '60Ni', '61Ni', '62Ni', '63Cu', '64Ni', '65Cu', '66Zn'], skiprows=6, nrows=50, index_col=False, dtype=...
user avatar
  • 25
2votes
1answer
54views

How can I save multiple figures after they have been created in a loop?

I'm relatively new to using Python and have been re-writing some of my MatLab scripts. I have a script that creates 7 figures within a loop. After they have been made I want to save each one.I am ...
user avatar
0votes
0answers
10views

Matplot figure not rendered getting "Not Responding" message

I am trying to update candlestick chart every 1min. I am using mplfinance to create candlestick plots and yahoo finance to get the data. I am using time.sleep to pause and refresh. Issue is plot ...
user avatar
  • 181
0votes
0answers
6views

Interval Parameter not working on FuncAnimation

I want to provide 1min interval before my candlestick plot is refreshed/updated with new data using import matplotlib.animation (FuncAnimation). I am using mplfinance to create the candlestick plot ...
user avatar
  • 181
0votes
0answers
20views

Plotting matplotlib figure through a class doesn't work

I created a class "Plot" for matplotlib plot objects. Running the following code neither shows error nor outputs anything. Any help is much appreciated. import matplotlib.pyplot as plt ...
user avatar
  • 103
0votes
0answers
51views

Why are my plots connected - how to plot on multiple figures in a for-loop in Python?

I am new to Python and trying to re-write some of my previous MatLab scripts. I am running into issues plotting within a for-loop. My first plot is 3D and my second plot is 2D. For some reason the ...
user avatar
0votes
0answers
11views

Mouse hover event in multi y axis chart using matplotlib.pyplot in python 3.8

I have a streaming graph with 5 y axis using matplotlib.pyplot in Python 3.8. I need to write a code for, when mouse hover on each and every y axis then the value and information about that axis (E.g. ...
user avatar
0votes
0answers
23views

Unable to see numbers on y axis for a barplot with seaborn [duplicate]

I'm trying to plot a barplot with transactionmode, gender and transaction amount. The code is below transaction = df_['tran_amt (k$)_sum'] print(transaction) The output is 0 26664155.670 1 ...
user avatar
0votes
0answers
7views

Saving a PyWavelets Transform as an image (jpg/png)

I've been trying to save the final transform of the PyWavelets transform, but it only saves the total figure. Does anyone have any recommendations I get 4 transforms and the end goal is to convert the ...
user avatar
  • 1
1vote
2answers
30views

Second y-axis not showing when using matplotlib

I am trying to plot data_1 and data_2 against data (data supplied in example) using 2 y-axis on different scales. When I run my code it seems only data_2 gets plotted. I am limited to only use the ...
user avatar
1vote
1answer
23views

How to make a multiline title with strings

I am new to using Python and am converting some of my MatLab code. I have 3 strings that I would like to use as a multi-line title. I keep getting the error"TypeError: unhashable type: 'list'&...
user avatar
2votes
1answer
62views
+50

"Import as" isn't recognized, normal import is

I'm playing around with matplotlib to understand its structure better and I'm confused by the following piece of code: import matplotlib as mpl from mpl import pyplot as plt # ModuleNotFoundError : No ...
user avatar
0votes
1answer
25views

Plot: x must be a label or position

I want to plot a graph but I get ValueError: x must be a label or position Calc_height distribution avg_overall_rating avg_potential avg_weight 0 165.0 74 67.365543 73....
user avatar
0votes
0answers
21views

Problem in plotting real-time data (with 4 y axis) using matplotlib in python 3.8

I am trying to plot real-time data (with 4 y axis) from Indian Stock Market using matplotlib in python 3.8. But the problem is, when I use only one y axis then it is fine but when I use 4 y axis then ...
user avatar
0votes
2answers
44views

Ploting time series data shows only one time series out of two in Python

I have two time series to plot in single box using matplotlib in python. However, I can see only one line instead of two. I have a data frame which contain three columns. "A"," B",&...
user avatar
0votes
1answer
21views

How to update scatter with plot?

I am updating the graph, but can't join to it the scatter, could someone help me, please? I don't understand, how to realize it. from matplotlib import pyplot as plt from matplotlib.animation import ...
user avatar
  • 145
-1votes
0answers
17views

So i tried this matlpotlib code but it's showing error. I think because of the csv file which is not showing the column name [closed]

So i tried this code but it's showing errorenter image description here enter image description here
user avatar
0votes
1answer
37views

How I can resolve this problem of my code? [closed]

I get a lot of graphs when I compile the code below. But I want everything to be graphed in a single figure. This is my code: import numpy as np ...
user avatar
0votes
0answers
22views

How to create the 5NN model

I've problem with construct the 5NN model. Report it's success rate on the testing sample. Report it's rate of false-positive and false-negative predictions.. Firstly, I need to download the data on ...
user avatar
0votes
2answers
18views

Matplotlib change colour of every second element in yaxis

So I have this plot here: What I want to do is to have every second element of yaxis to be coloured for example in blue and the rest in red. Here is the result I want to get: and here is the code I ...
user avatar
  • 13
0votes
1answer
13views

How to set Timestamp (pandas Datetime) to xlim of plot with FunctAnimation?

I want to limit my graph from left and set (the current time - 2 hours) to xlim. I tried to add to the "update" function this self.ax.set_xlim(left=max(self.data.iloc[0, 0], self.data.iloc[-...
user avatar
  • 145
0votes
1answer
15views

Why the view doesn't change with the new data that plotted by FuncAnimation?

I am plotting some data, but see nothink. If you zoom out, you will find, that the data is plotted on other side of fig, and the view doesn't...automatically changed for be able to see data. Could ...
user avatar
  • 145
0votes
1answer
23views

How to create a scatterplot of data using `matplotlib.pyplot.scatter`

I've problem with matplotlib.pyplot.scatter. Firstly, I need to download the data on Iris classification and paste headlines. import numpy as np import pandas as pd import matplotlib....
user avatar
0votes
1answer
36views

How can I add a new plots to existing figures?

I am new to Python and have mainly used MatLab in the past. I am re-writing one of my MatLab scripts and am wondering how to add plots to figures. It seems in python I can only have one figure open at ...
user avatar
0votes
0answers
22views

Hatch each bar separately in matplotlib

I have a barchart consisting of 7 bars, I want to hatch each bar separately. My attempt was to create a list and assign it to the hatch attribute as below: import matplotlib.pyplot as plt import numpy ...
user avatar
  • 493
1vote
2answers
27views

Plotting Using Trapezodial Rule

So I am trying to plot f = cos(x) using the trapezoidal rule but I keep getting an error saying: TypeError: only length-1 arrays can be converted to Python scalars I am not sure how the function is ...
user avatar
0votes
0answers
20views

How to put two scatter plots in same graph in Tkinter?

I have dataset and i want plot it with average value in same graphs. Dataset contains only date and value. My code is as below fig = plt.figure(figsize=(9, 9), dpi=100) ...
user avatar
0votes
1answer
23views

How to plot nodes of different shapes and facecolor of bbox in the same graph using networkx and matplotlib in Python?

I want to plot a simple graph using networkx. There are two nodes with labels Python and Programming in each. The code and graph are as follows: import networkx as nx G = nx.DiGraph() G.add_node(0) G....
user avatar
  • 652
1vote
1answer
29views

Is it possible to increase the width of node in networkx graph so that the labels are within nodes?

I have created a directed networkx graph using following nodes, edges and label for each nodes: G = nx.DiGraph() #Add nodes G.add_nodes_from([0,1,2,3,4,5,6,7,8,9, 10, 11, 12, 13, 14, 15, 16]) #...
user avatar
  • 652
1vote
0answers
40views

Matplotlib: Replace a subplot with an existing axes object

I am working with a package that produces only a matplotlib.Axes object, but it produces exactly what I want for that particular figure. It would be highly advantageous, however, to take that object ...
user avatar
  • 4,508
0votes
0answers
24views

How to make a multi-colored plot in matplotlib?

How can I generate a multi-colored time series line chart in matplotlib? Trying to plot the y values and assign colors based on the codes. The x-axis of the plot would be the dates. import numpy as ...
user avatar
  • 597
1vote
0answers
41views

How can I plot time-series on matplotlib polar plot?

Unsure if a polar plot is exactly what I should be using to accomplish this. But, essentially, I have multiple time-series (just amplitude vs. time), each corresponding to a different angle in degrees....
user avatar
  • 173
0votes
0answers
28views

Python plot signals based on the azimuth of arrival?

I'm trying to make a plot of a signal, where the orientation of the signal on the plot is the azimuth the signal originated from. My initial thought was to use a polar projection, but I don't actually ...
user avatar
1vote
1answer
28views

Matplotlib - Plot 1D range line and scatter points on it

Any suggest to reproduce this kind of graph ? I am trying to reproduce only whiskers of a generic boxplot. Vertical lines rapresent a specific range and i would plot points on them in order to ...
user avatar
  • 25
0votes
0answers
19views

Python - adding a second X and Y axis in the graph

I have the following figure which I would like to add the second X-axis on top of the figure and the second Y-axis on the right side of the figure with the same range. I would also like to remove 1e-...
user avatar
0votes
0answers
33views

How can I plot several files in one graph?

I am reading some files and I would like to plot every file into one 2x2 Figure. def plot_Cu_Blk(file): global fullname global outfile global entries pd.options.display....
user avatar
  • 25
0votes
0answers
25views

Cannot import matplotlib module after installing cython

To speed up certain resource-intensive Python functions, I'm using Cython. However, after using cython, I've seen that importing the matplotlib.pyplot module takes more than 2-3 minutes, whereas ...
user avatar
0votes
0answers
17views

Can't run matplotlib library, error in (The DTypes <class 'numpy.dtype[float64]'> and <class 'numpy.dtype[datetime64]'> do not have a common DType)

Unable to co-run code for result. Gives an error message [TypeError: The DTypes <class 'numpy.dtype[float64]'> and <class 'numpy.dtype[datetime64]'> do not have a common DType. For example ...
user avatar
  • 1
1vote
1answer
20views

How to plot multiple scatter plots with a global colourbar in python?

I have a dataset from which I've calculated a value which I've used in a colourbar for a plot. See below: I'm trying to figure out how to combine it so that another parameter is plotted over it (see ...
user avatar
0votes
0answers
28views

How to rotate labels using bar_label in matplotlib? [duplicate]

How do I rotate the labels by 90 degree in a bar chart using matplotlib.bar_label()? In the documentation of matplotlib.bar_label(), can you explain usage of below argument with some example? **...
user avatar
0votes
0answers
18views

Python - Contour plot with Numpy meshgrid

I have three arrays such as follows: x = np.array([x1,x2,....x400]) y = np.array([y1,y2,....y400]) z = np.array([z1,z2,....z400]) The x and y values define a 2d plane with a length and depth of 400 ...
user avatar
0votes
0answers
12views

How to set the background color in python in phobe2?

How to set the background colour of a figure in phobe2? import phoebe from phoebe import u # units import numpy as np import matplotlib.pyplot as plt b = phoebe.default_binary() b.add_dataset('mesh',...
user avatar
0votes
0answers
13views

Scatter plot and errorbar plot in one figure

I am trying to have a scatter plot from my points on top of my error bar plot. However, my error bars cover my scatter points. Do you have any suggestion how those scatter points can be on top of my ...
user avatar
  • 175
1vote
0answers
26views

matplotlib memory leak on MacOS

I have faced a matplotlib memory leakage problem while working on my python project that I can't solve. Nothing I found regarding this problem helped. Here is a very simplified script causing ...
user avatar
0votes
0answers
36views

How to plot data from a .kml file using matplotlib on python 3.7 and Windows 10"?

I will first give a little bit of context to my problem. I have obtained a .kml file of the territorial seas around the world on the site : https://www.marineregions.org/downloads.php, and I would ...
user avatar
  • 19

15 30 50 per page
1
2 3 4 5
120