Notes for me python csv graph

Introduction

I want to make a graph for a paper. It is convenient to use Excel, but it seems that Excel is not good at mass-producing graphs of the same size (width and height). I'll forget it later, so make a note of it. Use the data saved in CSV.

manner

Rough flow

Use spyder. Use pandas and matplotlib.

Read csv. Define the read value with the name df. Name the first, second, and third columns'num1','num2', and'num3', respectively. Check if CSV can be read properly with print. plt.plot (df ['num1'], df ['num2'], marker = "o") Write the X-axis as num1 and the Y-axis as num2. Plot with a marker. Save as PNG.

code

import pandas as pd import matplotlib.pyplot as plt

df = pd.read_csv('4.csv', names=['num1', 'num2', 'num3']) print(df) plt.plot(df['num1'], df['num2'],marker="o") plt.savefig("1.png ") plt.show()

4. Contents of csv.

image.png

result

image.png

Note

The third column is not used. Put CSV in the same folder as .py.

What I want to do in the future

Edited according to the format of the paper. Insert axis labels and legends

Recommended Posts

Notes for me python csv graph
Personal notes for python image processing
For me: Infrastructure and network notes
Notes for Python file input / output
Notes for using OpenCV on Windows10 Python 3.8.3.
Notes on nfc.ContactlessFrontend () for nfcpy in python
[Python] Script useful for Excel / csv processing
Python> Output numbers from 1 to 100, 501 to 600> For csv
Notes for using python (pydev) in eclipse
2016-10-30 else for Python3> for:
python [for myself]
Python scraping notes
Python study notes _000
Python beginner notes
Python study notes_006
Python study notes _005
Python grammar notes
Python Library notes
Csv in python
python personal notes
python pandas notes
Python study notes_001
python learning notes
Python3.4 installation notes
Read Python csv data with Pandas ⇒ Graph with Matplotlib
Notes for implementing simple collaborative filtering in Python
About Python for loops
missingintegers python personal notes
Python basics ② for statement
Python package development notes
About Python, for ~ (range)
python decorator usage notes
Python ipaddress package notes
Refactoring tools for Python
[Personal notes] Python, Django
Python Pickle format notes
[Python] pytest-mock Usage notes
[Introduction for beginners] Reading and writing Python CSV files
python for android Toolchain
First Python miscellaneous notes
Matlab => Python migration notes
Csv tinkering with python
Notes around Python3 assignments
Notes using Python subprocesses
Read Python csv file
Notes on writing config files for Python Note: configparser
Draw graph in python
OpenCV for Python beginners
[Python] Reading CSV files
Python try / except notes
Python framework bottle notes
Install Python (for Windows)
[Python] for statement error
Python environment for projects
Notes on importing data from MySQL or CSV with Python
Stylish technique for pasting CSV data into Excel with Python
Python code for writing CSV data to DSX object storage
Miscellaneous notes that I tried using python for the matter
[Python] Introduction to graph creation using coronavirus data [For beginners]
Read csv with python pandas
About Fabric's support for Python 3