0

I would like to have two changes:

  1. Instead of 1.2 I want to have 1.200.000 (also for the others) as x axis tick labels - red colour

  2. Get rid of the mini-lines (y axis ticks) - blue colour

Plot example

Here is my code:

import pandas as pd
#import numpy as np
import matplotlib.pyplot as plt

df = pd.read_excel(r"C:\Users\...\3_Python.xlsx", sheet_name=2)

a = [_*200000 for _ in range(12)]
b = [_*200000 for _ in range(12)]

df.plot(kind="scatter"
        ,color="dimgrey"
        ,marker="D"
        ,y="Vorher"
        ,x="Nachher"
        ,title="Title"
        ,xticks=[_*200000 for _ in range(12)]
        ,yticks=[_*200000 for _ in range(12)]
        )

plt.plot(a, b, label="xxx", linestyle="-", color="black")

plt.text(1000000, 1, "xxxx")
plt.text(1, 1000000, "yyyyy")

plt.ylim(ymin=0, ymax=1200000)
plt.xlim(xmin=0, xmax=1200000)

plt.xlabel("past")
plt.ylabel("future")
plt.grid(True, linewidth=2, color="grey")
plt.show()
STerliakov
  • 4,983
  • 3
  • 15
  • 37
Yokanishaa
  • 75
  • 5

0 Answers0