Most voted "matplotlib" questions
A library used in the Python language for plotting graphics. The "pylab" interface of this is very similar to the MATLAB plotting functions.
Learn more…140 questions
Sort by count of
-
1
votes1
answer141
viewsControlling the Plot range of matplotlib , use problem of 100% of ram memory
Hello community of Stackoverflow :) I am developing a small code that will plot you from 2 filled lists from an equation while a while condition is not satisfied. Once the lists are filled in, I use…
-
1
votes0
answers51
viewsProblem with the xticks - matplotlib
I’m a beginner in the Science data area and I’m developing my solution to the Kaggle Titanic problem (https://www.kaggle.com/c/titanic). At the moment I am creating a visualization to verify the…
-
1
votes1
answer139
viewsTurning binary into a Python chart
Good evening I have a message that I turned into binary and wanted to make a graph from the following patterns ami pseudoternary, where if the binary digit 1 the frequency is 0 and if the binary…
-
1
votes1
answer280
viewsPlace numbering on graph curves (matplotlib)
I have a code in Python for the simulation of a mathematical model that I am studying. To generate the graphics, I am using only the function plot() of the matplotlib, inside a for (are several…
-
1
votes1
answer399
viewsSet the colors of a point on a matplotlib scatter chart
I am handling data received from an Arduine from a .txt. In the code, I Gero 4 arrays (X,Y,Z and F), where X,Y and Z are coordinates and F is the signal strength. I would like to plot the 3D graph…
-
1
votes1
answer545
viewsI cannot install matplotlib, Python 3.9
It starts occurring normally and out of nowhere, after a few lines, it starts a series of errors. I’ve even updated Visual Studio in every possible way. Follow the error: C:\Users\dborg>pip…
-
1
votes1
answer342
viewsOutlier Detection with python
Hello. I am currently learning Data Science, currently I am at the beginning of Machine Learning, and during my studies I realized that the data has to be organized and within "line, "very…
-
1
votes1
answer59
viewsFill graph line in Python and change axis numbers to strings
Good afternoon. This is the first time I’ve ever done a 3D graphic in Python, in Anaconda’s Jupyter Notebook. The goal is for the chart to look like this formatting: My code is this:: import numpy…
-
1
votes0
answers24
viewsWhat is the logic in using Matplotlib and Seed?
To use Matplotlib, we have to import it and use the acronym plt to facilitate programming as follows: import matplotlib.pyplot as plt And every time we use this library, we need to reference the…
-
0
votes1
answer676
viewsObtaining numerical values of mathematical graphs with python
Assuming you have a data file that allows you to plot a 2d graph (straight, parabola, conical), is it possible, starting from the image of the graph, to extract the numerical values that generated…
-
0
votes1
answer242
viewsHow to plot a graph when terminating a computer vision script on Raspberry pi?
I have a code using opencv Raspberry Pi and it is running a pattern recognition loop. In the end I close the script using "Ctrl + X" without any problem! I want to "stop" the graphical processing,…
-
0
votes1
answer300
viewsPrint dictionary using matplotlib
Hello, I have a dictionary of the type: and I would like to print a line chart with the key k as x and v as y. tried a lot of things but keep getting errors: plt.plot(lr.keys(),lr.values())…
-
0
votes1
answer207
viewsTransform varchar to float
I made a code that takes data from the comic to generate a graph with the matplotlib, but the data in the comic is as varchar and for the creation of the data it must be in the format float. How can…
-
0
votes1
answer69
viewsHow to include Labels in matplotlib
I have the following code: import matplotlib.pyplot as plt AP_X = [10,20,30,40] AP_Y = [50,60,70,80] plt.scatter(AP_X, AP_Y, color="green") plt.ylim(0, 100) plt.xlim(0, 100) plt.show() It displays a…
-
0
votes1
answer60
viewsHow should matplotlib. _cntr be imported using LTS version (2.2.0) of Matplotlib?
The . _cntr module is used to build Geojson files import matplotlib._cntr as cntr When trying to load it using matplotlib 2.2.0 it returns error: ImportError: No module named _cntr How should this…
-
0
votes1
answer180
viewsSlow matplotlib (Python) to plot a 2-D graph?
Lately I came up with the need to use Python for plotting graphics with more than 3600 coordinates, but I realized that time can be a problem, but I’m not sure if the code I did has any performance…
-
0
votes1
answer2140
viewsHow to define the tangent function in python?
I would like someone to help me define the tangent function using python with constraints at points where the function does not exist (pi/2 + k*pi(k integer). Thanks in advance.
-
0
votes2
answers249
viewsPython script does not generate chart as expected
My Python algorithm is running perfectly, I just can’t generate the graph! I couldn’t identify the error... What’s wrong? import matplotlib.pyplot as plt va=float(input('Digite o valor a ser…
-
0
votes0
answers734
viewsHow can I plot a spectrogram in real time by reading data from an ADC such as the "MCP3008" connected to the Raspberry GPIO?
My idea will be to read data from an ADC such as the MCP3008 connected to Rasperry’s GPIO, from the readings plot a real-time graphics of the signal processed by a FFT(fast Fourrier transform) or…
-
0
votes0
answers59
viewsGraphic error and simple list
import matplotlib.pyplot as plt x=[] y=[] z=[] dados=open('dados1.txt','r') for line in dados: line=line.strip() X,Y,Z=line.split() x.append(X) y.append(Y) z.append(Z) dados.close()…
-
0
votes1
answer52
viewsBlank graph
The program is running normal, however, the position graphs, line 339 and 345 are blank, others are normal. I would like to know what to do to solve? Follows code: # -*- coding: utf-8 -*- """…
-
0
votes1
answer170
viewsDo you know any libraries for plotting python graphics besides Matplotlib?
I would like to try other types of tables. I want to make a classification using k-Means and looking for some with animation feature, without I need to make this animation in Mallorca.
-
0
votes3
answers46
viewserror in creating subplots
I am trying to create several Graphics using the following procedure: fig_2, axes = plt.subplots(2,2, figsize=(20, 5)) axes[0].plot(abril.Date_Time, abril.CPUs_pct) axes[1].plot(abril.Date_time,…
-
0
votes1
answer632
viewsPandas: Convert Dataframes to Image
Given a Dataframe as the following: df = pd.DataFrame({'id_emp' : [13524791000109, 12053850000137, 4707821000113, 4707821000114, 1], 'name_emp': ['Cristiano', 'Gaúcho', 'Fenômeno','Angelin',…
-
0
votes1
answer756
viewsconnect matplotlib points
My program plots independent points but I would like to connect the a_min's and a_max's. How can I do that? In this case, there would be two parallel lines. He’s filling up like this: '''…
-
0
votes1
answer1394
viewsHow to improve a bar graph whose values are very close in Python?
I am drawing the bar graph using the following Python code: # -*- coding: utf-8 -*- import matplotlib.pyplot as plt import matplotlib.dates as dates from datetime import datetime, timedelta x = [] y…
-
0
votes1
answer751
viewsincrease the size of matplotlib numbers
How can I increase the size of graph numbers (those marked on x and y axes) in matplotlib? Similar to changing font size.
-
0
votes1
answer436
views3D Python Graphics
I have 3 arrays, from the arrays I must draw a 3D graphic. I have tried several ways but I could not. I believe I am not creating the data frames correctly. I’m trying to do it this way: x =…
-
0
votes1
answer3728
viewsLogarithmic Scale Graph with Python
Initially I created a Values X tempo (Unix Time) chart with the following code: # -*- coding: utf-8 -*- import matplotlib.pyplot as plt import matplotlib.dates as dates from datetime import…
-
0
votes1
answer131
viewsInitialize the graph in matplotlib and then insert elements
Hello. Is there any way I can first open a chart with matplotlib and, after opened, perform some operations? Ex: open graph and then plot a straight line, then another, so on. I know there are some…
-
0
votes1
answer2111
viewsHow to convert values into percentage of a "total" column into pandas?
Hello! I’m learning about Python and Numpy, but I’m having trouble working with percentages. Considering that the total column corresponds to 100%, as I do to obtain the respective percentages of…
-
0
votes0
answers1022
viewsHow to change bar colors individually in matplotlib?
Hello! Can anyone explain to me how the principle works to change the colors of the bars individually? All I can do is change the color of the whole chart. For example: From Blue to Black / From…
-
0
votes2
answers415
viewsRename a graph label in Python Matplotlib
I have a dataframe filter: F 3257703 M 2256044 with the code below I was able to display the graphic in pizza: porcentagemSexo = sexo.value_counts(normalize=True) rotulo = sexo.unique()…
-
0
votes1
answer1641
viewsMatplotlib python normalize y-axis
I’m trying to normalize the y axis of this Plot,when I speak normalize and leave on the same scale import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec import numpy as np from…
-
0
votes1
answer150
viewsSimulate area of action of points in matplotlib
I need to create a graph where, given the coordinates of the points, an x-ray circle is created around these points. Simulating the area of action. I have the following script:…
-
0
votes1
answer770
viewsTurn two data lists into a graph with two parallel lines
Guys. I am since yesterday trying to do something that is very simple in Excel, but not in Python. I have two lists. Flap1 = [1,1,0,1,0,1] and Flap2 = [0,0,0,0,1,1,1] What I need to do is create a…
-
0
votes1
answer531
viewsPython graph does not show all values on the x-axis
I used the pandas library to read a csv file and create a graph using matplotlib: import pandas as pd import matplotlib.pyplot as plt brazil_dataset = pd.read_csv('/content/states.csv') fig, ax =…
-
0
votes0
answers75
viewsHow do I convert the image data to float? Or is there something wrong with the code?
I’m testing a code and I had problems: I can’t see the image. The message that appears is: Typeerror: Image data cannot be converted to float (picture data cannot be converted to float) CODE: from…
-
0
votes2
answers91
viewsUnicode troubleshooting when trying to save a picture with latex text in Matplotlib
Talk personal. I have a problem using the Matplotlib library. Before the last Windows update I used the library without any problem. I basically use it to create function charts and save them on.…
-
0
votes2
answers2055
viewsCustomize / set the order X-axis graph matplotlib bars
I generated a chart with values for each year from 2011 to 2015. but the graph generation, on the X axis, the years are grouped according to the values, not in the correct sequence (2011, 2012,…
-
0
votes2
answers1329
viewsChange size of Plot area
I generated a Plot scatter, but I can’t change the size of the screen it appears on my laptop. Can anyone help me with this? plt.scatter(X,Y,label='Y(X)'); # sacater plot plt.xlabel('X');…
-
0
votes0
answers11
viewsCreate graph with plt.pcolormesh
I am trying to create a graph to visualize current speeds. I have put the following code: plt.figure(figsize=(14,2)) plt.pcolormesh(tempo1,niveis,np.transpose(v1u)) plt.title('v1')…
-
0
votes1
answer183
viewsHow to sort bar chart from larger to smaller value
I have made the following chart. I would like to sort from the highest to the lowest value. fig, ax = plt.subplots(figsize=(8,5)) sns.countplot(olist_geolocation['geolocation_state'])…
-
0
votes1
answer294
viewsHow to change the color of a curve when the values increase?
I have a data set. Sometimes some values increase compared to the previous ones. resultsCos = [(0, 0.4235497237569061), (0.005, 0.4235497237569061), (0.01, 0.4238950276243094), (0.015,…
-
0
votes0
answers16
viewsArgument does not support iteration. How to resolve?
I am trying to apply zip to the x, y and z lists, but when running the program I get the following error: izip argument #1 must support iteration. Can someone help me fix my mistake? from…
-
0
votes1
answer40
viewsHow to change colors in graphics using matplotlib
I created a plot of points using matplotlib, but I want to put the following condition: For points above zero ( > 0) in Y paint green and for points below zero ( < 0) paint red.…
-
0
votes0
answers28
viewspython3.9 + matplotlib Does not call import in . py
So ... python version 3.9.1 did a Pip install matplotlib and ran smoothly, despite questions with previous installation errors. It turns out that : import numpy as np import math import matplotlib…
-
0
votes0
answers16
viewsI can’t change the size of a picture - Matplotlib
I need to create a figure in bars, I’m trying to increase the size, as follows: plt.figure(figsize=(8,8)) plt.bar(df_nacoes_ano) plt.show() But I get the following message: TypeError: bar() missing…
-
0
votes1
answer83
viewsHow do I display an image according to a given Number and this number is by Random in python?
import numpy as np import matplotlib.pyplot as plt from PIL import Image import cv2 def showfig(image, ucmap): imgplot=plt.imshow(image, ucmap) img0 =…
-
0
votes0
answers13
viewsGroupby with pandas and matplotlib
How to group the total value of y per year x and plot? x = df_Year y = df_RevenueMillions plt.plot(x, y) plt.show()…