Plots notebook vs .py #5034
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @tenFnAN -- thanks for the question and for trying out Positron. For seaborn/matplotlib, the matplotlib “Size and Shape” setting is pretty much identical to VS Code notebook and the "default" settings for size. Let me know if the below is helpful Here's the setting for sizing policies: I made a quick reprex with the same 6x6 facet grid and some fake data: import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Set the random seed for reproducibility
np.random.seed(42)
# Generate random data
n_points = 100
n_facets = 6 * 6
data = pd.DataFrame({
'x': np.random.uniform(0, 2500, n_points * n_facets),
'y': np.random.uniform(0, 2500, n_points * n_facets),
'facet_col': np.tile(range(6), n_points * 6),
'facet_row': np.repeat(range(6), n_points * 6)
})
# Set up the plot
sns.set(style="whitegrid")
g = sns.FacetGrid(data, col="facet_col", row="facet_row", height=3, aspect=1,
sharex=False, sharey=False)
# Plot the data points
g.map(sns.scatterplot, "x", "y", alpha=0.6)
# Customize the plot
g.set_axis_labels("X", "Y")
g.set_titles(col_template="Col {col_name}", row_template="Row {row_name}")
g.fig.suptitle("6x6 Facetted Plot with Random Data", y=1.02)
# Adjust the layout and display the plot
plt.tight_layout()
plt.show() Jupyter Notebook extension on left and Positron plot pane on right: |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for the tip. |
Beta Was this translation helpful? Give feedback.
Hi @tenFnAN -- thanks for the question and for trying out Positron.
For seaborn/matplotlib, the matplotlib “Size and Shape” setting is pretty much identical to VS Code notebook and the "default" settings for size. Let me know if the below is helpful
Here's the setting for sizing policies:
I made a quick reprex with the same 6x6 facet grid and some fake data: