-1

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)

enter image description here

how do I change max and min values for x and y coordinates for instance

enter image description here

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

enter image description here

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
user13412850
  • 509
  • 1
  • 5
  • 16
  • Does this answer your question? [How to set the range of y-axis for a seaborn boxplot?](https://stackoverflow.com/questions/33227473/how-to-set-the-range-of-y-axis-for-a-seaborn-boxplot) – L_W May 17 '21 at 15:40

1 Answers1

0

Please add this before plt.scattar

plt.xlim([-5, 10])
plt.ylim([-100, -20])

Sincerely yours,