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
-
14
votes2
answers2852
viewsPlot differences in matplotlib for different parameter accuracies
For a course work, I built the following code in Python using the Matplotlib and scikit-image packages: #!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np from scipy import interpolate…
-
10
votes2
answers1509
viewsMatplotlib + Latex: Writing Text on the Axes in English
Let’s start from the beginning, the versions I have are: Ipython: 1.1.0 Matplotlib: 1.3.1 Latex: pdftex 3.1415926-2.4-1.40.13 (Tex Live 2012/Debian) OS: Ubuntu 12.04 I want to plot what is below, in…
-
6
votes1
answer632
viewsGenerate contour charts over a 360*360 position map with weights from 0 to 1
What technique can I use to generate graphics in the style of c and d of this figure? Man input will be in the standard: X, Y and the weight of that position, where X and Y go from -180°; up to…
-
5
votes1
answer4590
viewsHow to resize graphics in Ipython Notebook without loss of quality?
In Ipython Notebook I produce graphics with (for example): x = [1,2,3,4] y = [5,6,7,8] plot(x, y) When I place the cursor over the generated graph, the tool appears at the bottom right corner to…
-
5
votes1
answer2226
viewsSave multiple figures in a loop - Python
I’m using python for experimental data analysis. I have in a folder several data files that, in the script, are grouped according to some criteria. I use a loop to read all the files in the folder…
-
5
votes1
answer35
viewsGraphic problem
How to arrange the view on the y-axis? import matplotlib.pyplot as plt with open("text.txt") as f: data=f.read() data=data.split('\n') x=[row.split(' ')[0] for row in data] y=[row.split(' ')[1] for…
-
4
votes1
answer3028
viewsHow to create more than one graph in matplotlib?
I need to create graphs of histograms in python with lists resulting from transformations. My doubt is that whenever I run the program, the next image only appears after I close the previous one.…
-
4
votes1
answer5773
viewsHow to specify values for my x-axis using matplotlib.pyplot?
I am unable to specify values for my x-axis, using matplotlib.pyplot. In some images the chart.xticks(years) solves the problem, but it seems that when the x-axis value set is too small, it uses…
-
4
votes1
answer161
viewsAdd different scales in matplotlib
I would like a help to configure the Y-axis scale. When trying to plot a bar graph with low and high values, the smaller ones end up not appearing in the scale. I tried some options, but it does not…
-
3
votes1
answer358
viewsGraph of total connections per second during a denial of service attack
I have a network dump (PCAP file) containing slowloris attacks: The following script will show the number of connections per second to IP 192.168.1.2 at port 80: tcpdump -qns 0 -A -r 1.pcap host…
-
3
votes2
answers937
viewsHow to save a chart to a PNG image?
I have some data from an experiment, and would like to save them as PNG. To display the data, I simply do the show(). However, I would like to save directly as PNG not to print the screen. How do I…
-
3
votes1
answer173
viewsHow to make python only read the file when it is complete
I’m doing a program that reads a file. txt that updates itself in the execution of another program in Fortran and creates a real-time animation of the temperature map of a board, however it is…
-
3
votes1
answer142
viewsHow to remove scientific notation on the y-axis using matplotlib?
When generating a graph using the library matplotlib in Python language in the Jupyter Notebook, I realized that the data presented in it were "reduced" (I think that would be the term) and with a…
-
3
votes1
answer35
viewsCenter values from each bar on matplotlib charts using Python
I’m doing studies on the library matplotlib in Python language extracting data from a local database, also using bilioteca sqlite3, the amount of cities that make birthday at home month of the year.…
-
3
votes3
answers69
viewsMatplotlib sorting using index as bar denominator
I am at an impasse and cannot find a solution. I wish to generate a Bar Plot from a dataframe that is reordered in descending order. I would like the bar name to be the index (0 to 5) When I plot my…
-
2
votes1
answer162
viewsProblems with Contour() in python
Hello, I’m having some problems with pylab’s Contour() function. In the final image, the values of the x and y axis are ranging from 0 to 600, which was the number of intervals in my arange().…
-
2
votes1
answer391
viewsHow can a colormap of a surface be mapped to a scalar function?
Translation of question I asked in the OR: I have a scalar function that represents the electrical potential on a spherical surface. I want to plot , for a given radius, the surface and map its…
-
2
votes0
answers603
viewsHow to make an animation show each change in the dataset? With matplotlib
I am using matplotlib to show my 3d dataset. But I would like to show each data set change in a 3D graph. And create an animation of that or maybe save the animation. Follow the code I’m using: from…
-
2
votes1
answer115
viewsGraph of a Python denial of service attack
Friends, I generated the following chart: The code used was the following: import matplotlib.pyplot as plt import matplotlib.dates as dates from datetime import datetime, timedelta x = [] y = []…
-
2
votes1
answer159
viewsHow to delimit plotting area in python?
The figure is cutting the captions, how do I fix it? # Libraries import matplotlib.pyplot as plt # Make data group_names=['0,89% - Tração Animal e Propulsão Humana', '45,08% - Passageiro e Misto',…
-
2
votes1
answer3034
viewsHow to customize the x-axis of a graph with two y-axes, for text?
I would like to know how I change my x-axis from a graph with two y-axes, because I want to give the x-axis names of Brazilian states. numpy_matrix = df.as_matrix() x = numpy_matrix[0:,0] y1 =…
-
2
votes1
answer912
viewsSet bar space using matplotlib
Good afternoon. I’m filling a bar chart but I can’t adjust the spacing between the 3 different bars of the same. # plota os resultados diameters = ['<=102', '103-152', '153-203', '203-254',…
-
2
votes1
answer181
viewsLinear Regression Evaluation and Graph Problem
My problem is that I can’t plot a line - first-degree function graph - in my first linear regression model. As a result, I have lines joining the scatter plot points of the training Features. I…
python-3.x matplotlib machine-learning regression sklearnasked 4 years, 2 months ago Breno Valle 23 -
2
votes0
answers20
viewsPlot Dendrogram X-axis with TF-IDF
I’m trying to plot Dendrograma with data that was vectored by TF-idf, however the axis x always presents me with numbers. I would like to know how to move to the Graphics Labels option, the real…
-
2
votes1
answer48
viewsIncorrectly created chart
Hello, I am training in creating graphics in Python with matplotlib. For this, I am importing an HTML with WEGE3 action history. df_history =…
-
1
votes1
answer3572
viewsFont size of the caption in a graph made in python
I would like to know how to adjust the font size used in a caption in a graph made in Python using the matplotlib library. I did some research and found this shape. plt.legend(loc='upper left',…
-
1
votes1
answer425
viewsHow to sum a column of a file and visualize with . Plot(Kind = 'bar')?
I’m trying to sum up the column Duration ,and present using plot() trip_data['duration'].value_counts().plot(kind = 'bar') trip_data['duration'].count_data().plot(kind = 'bar')…
-
1
votes2
answers856
viewsDatabase graph does not show python matplotlib
The sketch of the graph appears, but empty , with no data. import sqlite3 import matplotlib.pyplot as plt import matplotlib.dates as mdates connection = sqlite3.connect('escola.db') c =…
-
1
votes1
answer782
viewsData overlapping on the x-axis of the graph
I need to place a series of dates (timestamp) that are stored in a bd on the x-axis of a graph, the problem is that the dates overlap and it is impossible to perform an efficient analysis. It…
-
1
votes1
answer968
viewsPython chart does not display all desired values
I would like only the values of the x, y coordinates corresponding to the points to appear in the graph. But it’s not like this: For example: The point whose x coordinate is 04/10/2017 09:41:00 does…
-
1
votes2
answers1051
viewsPython Build a multiplate parabola chart with matplotlib
I’m trying to chart the figure, but only the red line which is a multilard parabola. It is part of a neural network that I have ready, but I cannot generate the function that generates this…
-
1
votes0
answers51
viewsBCG graphics in Python.
Friends, is there any way to make a chart as below using Python/Matplotolib? Thanks for your help. I observe that I researched a lot about the subject, but I am finding difficulty, mainly in the…
-
1
votes1
answer200
viewsBar chart made in Python became "weird". Any suggestions how to improve it?
Friends, The following chart was generated: The code used was the following: # -*- coding: utf-8 -*- import matplotlib.pyplot as plt import matplotlib.dates as dates from datetime import datetime,…
-
1
votes1
answer848
viewsDisplay only hours, minutes and seconds on a graph whose input is in Unix time
Be the Python code that generates a bar graph: # -*- coding: utf-8 -*- import matplotlib.pyplot as plt import matplotlib.dates as dates from datetime import datetime, timedelta x = [] y = [] with…
-
1
votes1
answer982
viewsError generating matplotlib graph
I am new to Python and I am having difficulty with my algorithm, the function of it is to check words in a set of files in PDF format and analyze the recurrence of each word generating with this…
-
1
votes0
answers1189
viewsError "Valueerror: operands could not be broadcast Together with shapes"
I’m getting this mistake: Traceback (Most recent call last): File "geraEstatistica.py", line 148, in cnplot = map.Contour(x,y,result,clevs,Cmap=plt.cm.jet) File…
-
1
votes1
answer2967
viewsFigure Legends
I would like to know why a marker in the 2dB column on the 10 0 line appears in the image and how I can eliminate that without erasing the markers on the blue line, which is what I want? The code to…
-
1
votes0
answers853
viewsTypeerror: importPoisson() takes 1 positional argument but 2 Were Given
I am trying to import from an external file some data to be able to generate a graph and such, but every time of this error, follows my code: They may also say bugs you found in my code that can be…
-
1
votes1
answer123
viewsDisplaying only integer values on X-axis in matplotlib chart
I would like to show X-axis only integer values of K: k in range(20) import matplotlib.pyplot as plt %matplotlib inline X = [k for k in range(20)] y = rmse_val plt.plot(X,y,color='green' ,…
-
1
votes1
answer156
viewsClassification of network attack data (attack or no attack)
I’m using the dataset: https://www.unsw.adfa.edu.au/unsw-canberra-cyber/cybersecurity/ADFA-NB15-Datasets/ The goal is to classify a sample as attack or no attack. A good idea would be to use…
-
1
votes1
answer819
viewsHow to set the xticks equal to that figure
I’m taking a course in Python geared towards finance. Then in an exercise you are asked to plot a graph using Dataframes. So far so good, I managed to do everything right, however my xticks do not…
-
1
votes0
answers399
viewsPlotting graphics with functions in 3D matplotlib
Good night, you guys! I need to plot an area graph where the height z varies according to any function and its interval depends on the initial point and the final point reported. I found the example…
-
1
votes1
answer104
viewsHow to change the background of a chart with Python 'Seaborn'
I try to change the background of my chart with the 'Seaborn' module, however, I am not successful. I installed the module today (16/04/2021). code: import matplotlib.pyplot as plt import seaborn as…
-
1
votes2
answers366
viewsHow to generate a temperature x time graph of data collected by an Adian?
Good afternoon guys, I’m trying to use a program in python to read seven temperature values through the serial port with Arduino, so far the program I’ve done collects the data, saved in a text…
-
1
votes1
answer449
viewsmatplotlib - Cut saved plot
When saving my chart it gets a left cutout on top of the names because it is wide. How do I fix it? cmap = cc.cm['kbc'] norm = matplotlib.colors.Normalize(vmin = ranking_members.rating.min(), vmax =…
-
1
votes1
answer624
viewsProblem with Python Graph
Through calculations and mathematical expressions, starting from the information of three data informed by the user (Launch distance - Duration time - Maximum height reached), calculate the speeds…
-
1
votes1
answer84
viewsHow to store results of statistical calculations (mean, correlation) for later use in graphs?
[![Example of the Relevance Matrix][1]][1] I want to create a graph that is technically called "Relevance Matrix". The concept of this graph is to position the KPI (performance indicator) on x-axis,…
-
1
votes1
answer432
viewsHow to add a Matplotlib chart on Tkinter
I have a graphic of matplotlib put in format (pizza) and I wanted to take the picture and add it to Tkinter matplotlib.use("Tkagg") DataBaser.cursor.execute(""" SELECT RendaMensal FROM Registro…
-
1
votes0
answers185
viewsHow to position an image in reportlab using pdfrw as flowable?
I’m using the reportlab to generate reports. I can define the creation process in four steps: 1) take the data via API, 2) filter the data, 3) generate the graphics with the matplotlib and 4) insert…
-
1
votes1
answer226
viewsWhat is the equivalent of Seaborn’s```argument in matplotlib?
When I want the points belonging to different categories to be colored each of a color in the seaborn, i simply put the categorical variable of interest as argument value hue. Replicable example:…