below are my values for x and y coordinates
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
x = np.random.randint(1,10,10)
y = np.random.randint(-100,10,10)
plt.scatter(x,y)
how do I change max and min values for x and y coordinates for instance
if I want to change X-Axis left to -5 and right to 10 likewise Y-Axis Bottom to -100 and top -20
The resulting figure
Please add this before plt.scattar
plt.xlim([-5, 10])
plt.ylim([-100, -20])
Sincerely yours,
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.