1

enter image description here

I want to plot one graph on the orange area and one plot each in blue and red respectively. I was trying in the following way. Is there a way to achieve this? Any help would be appreciated.

import pandas as pd
import matplotlib.pyplot as plt


data =  pd.read_csv("data.csv")


fig = plt.figure()
plt.style.use('seaborn')

plt.tight_layout()

ax1 = plt.subplot(22[1:2])
ax1.plot(data.time_stamp,data.cell_1)

ax2 = plt.subplot(223)
ax2.plot(data.time_stamp,data.cell_2)

ax3 = plt.subplot(224)
ax3.plot(data.time_stamp,data.cell_3)

plt.show()

2 Answers 2

2

You can use GridSpec to define the dimension of each subplot.

from matplotlib.gridspec import GridSpec

fig = plt.figure()
grid = GridSpec(2,2, figure=fig)
ax1 = fig.add_subplot(grid[0,:])
ax2 = fig.add_subplot(grid[1,0])
ax3 = fig.add_subplot(grid[1,1])
for ax in fig.axes:
    ax.set_xticks([])
    ax.set_yticks([])

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

0

You might want to give the add_axes() function a try, there are tutorials and showcases online.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.