Untitled
unknown
plain_text
10 months ago
1.1 kB
5
Indexable
import random import numpy as np import networkx as nx # Set random seed seed = 0 random.seed(seed) np.random.seed(seed) nx.random.seed(seed) # Data generation for the main plot x = np.linspace(0.5, 3, 500) y1 = 0.04 * np.sin(1.25 * x) + 0.08 y2 = 0.03 * np.sin(1.25 * x) + 0.06 y3 = 0.02 * np.sin(1.25 * x) + 0.04 # Data generation for the inset plot x_inset = np.linspace(0, 3, 500) y_inset = 0.02 * np.sin(2.5 * x_inset) + 0.03 # Plotting fig, ax = plt.subplots(figsize=(8, 6)) # Main plot ax.plot(x, y1, label='Line 1', linestyle='-', color='black') ax.plot(x, y2, label='Line 2', linestyle='--', color='black') ax.plot(x, y3, label='Line 3', linestyle='-.', color='black') # Adding labels and a title ax.set_xlabel(r'$\mu / \hbar \omega_z$', fontsize=12) ax.set_ylabel(r'$E / \mu$', fontsize=12) # Inset plot ax_inset = fig.add_axes([0.6, 0.25, 0.25, 0.25]) ax_inset.plot(x_inset, y_inset, linestyle='-', color='black') # Adjusting the layout plt.tight_layout() # Save the plot as a PNG file plt.savefig("./results/chart_synthesis/gpt_arxiv_image/test_arxiv_image_100/generate_code_examples/41.png")
Editor is loading...
Leave a Comment