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
-
0
votes1
answer320
viewsChange distance on x-axis - Matplotlib
I’m mounting a chart using the Python matplotlib library but the result is not good! The names of the x angle are not visible. Follow picture Code: #-*- coding: utf-8 -*- #Meu Décimo oitavo Programa…
-
0
votes1
answer1065
viewssort graphing and fix value in python
I’m trying to make a graph of the variation of the prices of the Itau stock however the result is with the values of disordered shares insira o código aqui import matplotlib.pyplot as plt dados =…
-
0
votes1
answer422
viewsX-axis customization in matplotlib
Good morning, I have the code:import pandas as pd from matplotlib import pyplot as plt server250_mar19 = pd.read_csv('dbnode2_mar19.csv') plt.plot(server250_mar19.Date, server250_mar19.CPU_pct)…
-
0
votes1
answer61
views3d graph with dimension error
I’m trying to plot a graph in 3d. I already have in 2d. All quiet there. It is a matrix with the values of the amplitudes of a wave propagating in a tab. But I would plot the values of the matrix as…
-
0
votes0
answers259
viewsMatplotlib.pyplot with Django
I’m trying to insert a graph through the matlib.pyplot library, but I can only upload it externally by inserting it into Jango. I want to insert it as a loaded image, that when receiving data from…
-
0
votes1
answer107
viewsmatplotlib -> Could not load source '<__array_function__Internals>': Source unavailable
I am having this problem when using plt.show() or plt.savefig('/path'): The same error occurs when I try to plot a simple graph: import matplotlib.pyplot as plt plt.stackplot(range(4), [2, 2, 2, 2],…
-
0
votes0
answers1085
viewsHow to plot or overlay graphs of a function with two variables using matplotlib?
I’m having trouble finding the right graph on my Plot, I’m modeling two physics equations of two variables, I believe the problem is because I’m not going through the graph correctly with my while,…
-
0
votes1
answer67
viewsHow to display different scope subplots in the same figure?
1 - Summary of the problem I’m trying to implement the Binary Backpack Problem, using Python and a simple genetic algorithm. Follows the repository on Github. I wrote functions for plotting the…
-
0
votes1
answer119
viewsHow to join two lines in the same scale of the graph?
Hello! I have the following code: def createGraph(): plt.title("Evolution of COVID-19") plt.xlabel("Days") plt.ylabel("Infected People") countries = ['China', 'Italy'] days = [1,...,63] #Array from…
-
0
votes1
answer559
viewsConvert BGR to RGB (Opencv)
I have a code that finds the edges around what was labeled in the image and places the value of -1 in the pixels of that border found. I’m having trouble converting the image already with the edges…
-
0
votes1
answer551
viewsHow to place the value for the y-axis next to the chart marker?
Hello, I would like the figures for the y-axis to appear alongside the points on the graph. Thanks in advance! plt.figure(figsize = (16,8)) plt.xticks(rotation = 90) sns.lineplot(x =…
-
0
votes1
answer81
viewsColor Bar Values in Matplotlib
I have a code with 3 variables: a1, a2 and dc1.The variable dc1 is the absolute difference value of a2 and a1. I am generating a graph in matplotlib with the values of the a1 variable and would like…
-
0
votes1
answer65
viewsMatplotlib graphics are overwriting themselves
I’m trying to generate a report with several charts generated by matplotlib, however, I realize that after generating the graphics they are overwriting others that have already been created, follows…
-
0
votes1
answer54
viewsRegplot with year on X-axis (Python)
I’m trying to plot a regression graph where the date interval is in year format, but I can’t centralize the data on the X axis. The chart range below is between 2016 and 2020.…
-
0
votes0
answers49
viewsDeprecationwarning in Matplotlib
Hello, I am using the version "pandas==1.0.4" and in my code below has generated the following Warning: MatplotlibDeprecationWarning: Passing the minor parameter of set_xticks() positionally is…
-
0
votes0
answers82
viewsHow to plot bar graph with matplotlib + Counter()
Hello! I’m trying to plot a bar graph from Data Science from Zero, but it’s very different from the book. Note: the book is in Python 2 and I am using Python 3 In the book, is: from collections…
-
0
votes0
answers206
viewsshow more Abels(xticks) on x-axis in Pandas/Pyplot charts
Hello I have this data in a CSV file (here only two lines were written, but the real file has several). Ano;Mes;Valor;Qtde;Tipo 2013;01;3982168388.81;562405;C 2014;01;4332471647.33;570833;C When I…
-
0
votes1
answer44
viewsMatplotlib library problem (Python)
I am learning python and am making a program that generates graphics from a CSV file, but every time I try to use the function savefig(), it saves the data with the Labels of the previous ones,…
-
0
votes1
answer202
viewsHow to generate a horizontal multiple graph using python
Good afternoon, I’m doing a job for the college where I need to generate a multiple graph in horizontal bars. I’m using the following code: df_escolaridade['Espacialidades'] =…
-
0
votes0
answers22
viewsPlotting of graphics in Iteration
Good afternoon, Contextualizing, This is a study of control charts from the Tennessee Eastman Process dataset. The IDV below is corresponding to n° of the fault I wish to plot. Without the iteration…
-
0
votes0
answers51
viewsHow to use pyplot broken_barh using dates? Because I want to plot a Gantt chart
import matplotlib.pyplot as plt from math import floor def tamanho(lista): return floor(len(lista)/2) rangex = [[(0,1.5)], [(1.5,3)], [(3,3)]] rangey = [(n, -.5) for n in…
-
0
votes0
answers29
views3D graph error "only size-1 arrays can be converted to Python scalars"
Hello, I am trying to plot a 3D graph of an integral solution and am having the error "only size-1 arrays can be converted to Python scalars". When I try to plot a function simpler than the original…
-
0
votes0
answers38
viewsPython: I need to get the area below a curve
This is my code: index = 0 T = np.zeros((300,1)) T[:,0] = np.linspace(0.01, 3, 300)[:] A = np.loadtxt('AAA_'+str(index)+'.txt') Tr = 1.0 idx = (abs(T-(Tr))).argmin() a = T[:idx+1] a = [i[0] for i in…
-
0
votes0
answers28
viewsmatplotlib.axes.Axes.hist : need to understand the relationship between input and output parameters
For example, it has the following code: import matplotlib import numpy as np import matplotlib.pyplot as plt np.random.seed(10**7) mu = 121 sigma = 21 x = mu + sigma * np.random.randn(1000) num_bins…
-
0
votes0
answers44
viewsHow do you solve the problem when plotting the image in Pycharm using Matplotlib?
I am having trouble displaying the image/graph using pycharm community, when I run the code I get the following error message: UserWarning: Matplotlib is currently using agg, which is a non-GUI…
-
0
votes1
answer33
viewsHow to create bar graph with 2 different y axes and the same x axis?
I’m trying to plot a bar graph with 2 different y axes and the same x-axis. The closest I’ve come to success with the following code: fig = plt.figure() # Create matplotlib figure ax =…
-
0
votes1
answer32
views"subplot" is giving error in "title"
I’m trying to spin a subplot,only that the title(title): > TypeError Traceback (most recent call last) > ~\AppData\Local\Temp/ipykernel_17364/305905731.py in <module> 4 >…
-
-1
votes1
answer59
viewsDoes the "sudo" command work in Debian?
I tried to execute the sudo in python and returned me "bash: sudo: command not found", what’s the problem? I’m trying to use matplotlib and I’m not getting it, so I tried to install, running: sudo…
-
-1
votes1
answer174
viewsHow to generate a graph with distinct X and Y with the matplotlib module in Python?
The objective would be to generate a bar graph where the Y axis goes from 0 to 10 (fixed mode), and the user would inform the maximum value of X (the X axis being constituted of 1 until the informed…
-
-1
votes1
answer228
viewsPlotting circles in different planes
I need to plot circles in the plans Zy and zx, but I only get in the plane xy, because when changing the variables x, y and z, forgive the shape of a heart. How can I fix this? import numpy as np…
-
-1
votes1
answer387
viewsInstall matplotlib
I am trying to install matplotlib on the computer but am getting the following error: ERROR: Command errored out with Exit status 1: command: 'c: users ferco appdata local Programs python…
-
-1
votes1
answer158
viewsHow can I view an Axessubplot object in the same way as pyplot.show()?
I’m learning how to deal with pandas and after getting a Dataframe, the next step was to get a chart of this Dataframe "Upermarket": supermarket.loc[:10, 'Total'].plot(figsize=(14, 6)) This results…
-
-1
votes1
answer102
viewsChanging the axes of a data histogram to improve data visualization
I am practicing a bit of data science for a college project with the information available on COVID19 and from there I am trying to estimate by graphs the distribution of age groups but when I was…
-
-1
votes1
answer977
viewsScatterplot trend line in Python matplotlib
Suppose I have two simple Python lists and create a scatter chart: x = [548, 677, 987, 2, 29, 1114, 521, 999] y = [96, 775, 258, 369, 410, 99, 5, 1117] import matplotlib.pyplot as plt plt.scatter(x,…
-
-1
votes1
answer51
viewsPython bar graph
Hey, guys, all right? This is my first post here, sorry if I make any mistakes... I’m just starting to learn how to code in Python, and I need a little help... The Axes in my chart are overlapping.…
-
-1
votes0
answers8
viewsFiltering of shaft information in the Matplotlib Graph
Hello, I’m creating a chart with Python and Matplotlib, using two lists with the same amount of values. My graphic is coming out correctly, but I want to fix the design of it that is not the way I…
-
-1
votes1
answer80
viewsIronpython.Runtime.Exceptions.Importaxception: 'No module named fcntl' - Ironpython C#
Hello, good afternoon, sir. I am calling a file . py, which is in the scope of my application directory, and the following error is returned: Ironpython.Runtime.Exceptions.Importaxception: 'No…
-
-1
votes2
answers1122
viewsLabel for bar graph - Matplotlib
Hello, I have this dataframe: I’m generating a bar graph of deaths per day, I’d like to put labels on the bars to show number for each day. plt.figure(figsize=(12, 8)) plt.bar(df2['Data'],…
-
-1
votes1
answer43
viewsHow to change the position of the graph in the figure in matplotlib
The graph became small and poorly positioned. for i in df.index: plt.plot(df.at[i,'x0'], df.at[i,'y0'], label=i) # A e B plt.axvline(x=ABx, ymin=0.1, ymax=0.55, linestyle = "dashed", color='gray')…
-
-1
votes1
answer29
viewsSharpened Bar Graph in Matplotlib
I’m working on a chart that involves a file. csv, my question is what would be the best way to print a chart with 3 bars grouped for each country/country that contains: Median_wealth, Mean_wealth…