Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

devide the subplot into subplots in mathplotlib

# libraries and data
from matplotlib import pyplot as plt
import pandas as pd
import numpy as np
df=pd.DataFrame({'x_values': range(1,101), 'y_values': np.random.randn(100)*15+range(1,101), 'z_values': (np.random.randn(100)*15+range(1,101))*2 })

# Plot 1
ax1 = plt.subplot2grid((2, 2), (0, 0), colspan=2)
ax1.plot( 'x_values', 'y_values', data=df, marker='o', alpha=0.4)

# Plot 2
ax2 = plt.subplot2grid((2, 2), (1, 0), colspan=1)
ax2.plot( 'x_values','z_values', data=df, marker='o', color="grey", alpha=0.3)

# Plot 3
ax3 = plt.subplot2grid((2, 2), (1, 1), colspan=1)
ax3.plot( 'x_values','z_values', data=df, marker='o', color="orange", alpha=0.3)

# Show the graph
plt.show()
Comment

devide the subplot into subplots in mathplotlib

# libraries and data
from matplotlib import pyplot as plt
import pandas as pd
import numpy as np
df=pd.DataFrame({'x_values': range(1,101), 'y_values': np.random.randn(100)*15+range(1,101), 'z_values': (np.random.randn(100)*15+range(1,101))*2 })
 
# 4 columns and 2 rows
# The first plot is on line 1, and is spread all along the 4 columns
ax1 = plt.subplot2grid((2, 4), (0, 0), colspan=4)
ax1.plot( 'x_values', 'y_values', data=df, marker='o', alpha=0.4)

# The second one is on column2, spread on 3 columns
ax2 = plt.subplot2grid((2, 4), (1, 0), colspan=3)
ax2.plot( 'x_values','z_values', data=df, marker='o', color="grey", alpha=0.3)

# The last one is spread on 1 column only, on the 4th column of the second line.
ax3 = plt.subplot2grid((2, 4), (1, 3), colspan=1)
ax3.plot( 'x_values','z_values', data=df, marker='o', color="orange", alpha=0.3)

# Show the graph
plt.show()
Comment

PREVIOUS NEXT
Code Example
Typescript :: how to pass data between requests 
Typescript :: wrapper tsx 
Typescript :: Exclude value from array typescript type 
Typescript :: pass generic type to arow function typescript 
Typescript :: benefits of ginger juice 
Typescript :: translate a vector 
Typescript :: engineering adding requirements to password 
Typescript :: get Nested Iteration index Count in Angular 13 
Typescript :: reports for market research 
Typescript :: first k digits of n*n 
Typescript :: coldfusion check if key exists and not empty 
Typescript :: to move previous month 
Typescript :: There are 7 components with misconfigured ETags 
Typescript :: $clients = User::query()-where("type","client" ) 
Typescript :: java objects cannot change? 
Typescript :: input non-negative decimal in typescript 
Typescript :: in javaWrite a plan that prints all the perfect numbers in the range of 1 to 1000 
Typescript :: google sheets past tsv data 
Typescript :: typescript types for state 
Typescript :: ionic google map 
Typescript :: How to separate two similar names from two lists in Python 
Typescript :: google fonts roboto 
Cpp :: sfml local mouse position 
Cpp :: flutter convert datetime in day of month 
Cpp :: c++ find minimum value in vector 
Cpp :: unordered_map of pair and int 
Cpp :: how to declare comparator for set of pair 
Cpp :: infinity c++ 
Cpp :: convert set to vector c++ 
Cpp :: c++ make constructor fails if bad argument 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =