Dataset Viewer
Auto-converted to Parquet Duplicate
id
stringlengths
7
11
category
stringclasses
7 values
difficulty
stringclasses
3 values
prompt
stringlengths
82
282
solution
stringlengths
96
321
checks
stringlengths
14
71
input_data
stringlengths
16
425
expected_output
stringlengths
500
3.55k
line_001
line_plots
easy
Using the provided x and y arrays, create a line plot with title 'Linear Growth', x-label 'X Values', and y-label 'Y Values'.
fig, ax = plt.subplots() ax.plot(x, y) ax.set_title('Linear Growth') ax.set_xlabel('X Values') ax.set_ylabel('Y Values')
["line_data", "title", "xlabel", "ylabel"]
{"type": "arrays", "x": [1, 2, 3, 4, 5], "y": [2, 4, 6, 8, 10]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Linear Growth", "xlabel": "X Values", "ylabel": "Y Values", "xlim": [0.8, 5.2], "ylim": [1.6, 10.4], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [1, 2, 3, 4, 5], "ydata": [2, 4, 6, 8, 10], "color": "#1f77b4", ...
line_002
line_plots
easy
Using the provided x and y arrays, create a line plot with title 'Sales Over Time', x-label 'Quarter', and y-label 'Revenue ($)'.
fig, ax = plt.subplots() ax.plot(x, y) ax.set_title('Sales Over Time') ax.set_xlabel('Quarter') ax.set_ylabel('Revenue ($)')
["line_data", "title", "xlabel", "ylabel"]
{"type": "arrays", "x": [1, 2, 3, 4], "y": [100, 150, 130, 180]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Sales Over Time", "xlabel": "Quarter", "ylabel": "Revenue ($)", "xlim": [0.85, 4.15], "ylim": [96.0, 184.0], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [1, 2, 3, 4], "ydata": [100, 150, 130, 180], "color": "#...
line_003
line_plots
easy
Using the provided x and y arrays, create a red line plot with title 'Quadratic Function', x-label 'Input', and y-label 'Output'.
fig, ax = plt.subplots() ax.plot(x, y, color='red') ax.set_title('Quadratic Function') ax.set_xlabel('Input') ax.set_ylabel('Output')
["line_data", "line_color", "title", "xlabel", "ylabel"]
{"type": "arrays", "x": [0, 1, 2, 3], "y": [0, 1, 4, 9]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Quadratic Function", "xlabel": "Input", "ylabel": "Output", "xlim": [-0.15000000000000002, 3.15], "ylim": [-0.45, 9.45], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [0, 1, 2, 3], "ydata": [0, 1, 4, 9], "color"...
line_004
line_plots
medium
Using the provided x, y1, and y2 arrays, create a plot with two lines. Plot y1 in blue and y2 in red. Add title 'Comparison', x-label 'X', and y-label 'Y'.
fig, ax = plt.subplots() ax.plot(x, y1, color='blue') ax.plot(x, y2, color='red') ax.set_title('Comparison') ax.set_xlabel('X') ax.set_ylabel('Y')
["line_count", "line_data", "line_color", "title", "xlabel", "ylabel"]
{"type": "multi_arrays", "x": [0, 1, 2, 3, 4], "y1": [0, 1, 4, 9, 16], "y2": [0, 2, 4, 6, 8]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Comparison", "xlabel": "X", "ylabel": "Y", "xlim": [-0.2, 4.2], "ylim": [-0.8, 16.8], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [0, 1, 2, 3, 4], "ydata": [0, 1, 4, 9, 16], "color": "#0000ff", "linestyle": "-...
line_005
line_plots
medium
Using the provided x, y1, and y2 arrays, create a plot with two lines. Label y1 as 'quadratic' and y2 as 'linear'. Add a legend, title 'Function Comparison', x-label 'X', and y-label 'Y'.
fig, ax = plt.subplots() ax.plot(x, y1, label='quadratic') ax.plot(x, y2, label='linear') ax.legend() ax.set_title('Function Comparison') ax.set_xlabel('X') ax.set_ylabel('Y')
["line_count", "line_data", "legend", "title", "xlabel", "ylabel"]
{"type": "multi_arrays", "x": [0, 1, 2], "y1": [0, 1, 4], "y2": [0, 1, 2]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Function Comparison", "xlabel": "X", "ylabel": "Y", "xlim": [-0.1, 2.1], "ylim": [-0.2, 4.2], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [0, 1, 2], "ydata": [0, 1, 4], "color": "#1f77b4", "linestyle": "-", "m...
line_006
line_plots
medium
Using the provided x and y arrays, create a line plot with circle markers ('o') and a dashed line style ('--'). Add title 'Data Points', x-label 'Index', and y-label 'Value'.
fig, ax = plt.subplots() ax.plot(x, y, marker='o', linestyle='--') ax.set_title('Data Points') ax.set_xlabel('Index') ax.set_ylabel('Value')
["line_data", "line_style", "title", "xlabel", "ylabel"]
{"type": "arrays", "x": [1, 2, 3, 4, 5], "y": [1, 3, 2, 4, 3]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Data Points", "xlabel": "Index", "ylabel": "Value", "xlim": [0.8, 5.2], "ylim": [0.85, 4.15], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [1, 2, 3, 4, 5], "ydata": [1, 3, 2, 4, 3], "color": "#1f77b4", "linesty...
line_007
line_plots
hard
Using the provided x, y1, and y2 arrays, create a 2x1 subplot. Plot y1 in the top subplot with title 'Quadratic' and y2 in the bottom subplot with title 'Exponential'. Add grid to both.
fig, (ax1, ax2) = plt.subplots(2, 1) ax1.plot(x, y1) ax1.set_title('Quadratic') ax1.grid(True) ax2.plot(x, y2) ax2.set_title('Exponential') ax2.grid(True)
["axes_count", "line_data", "grid"]
{"type": "multi_arrays", "x": [0, 1, 2, 3, 4], "y1": [0, 1, 4, 9, 16], "y2": [1, 2, 4, 8, 16]}
{"axes_count": 2, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Quadratic", "xlabel": "", "ylabel": "", "xlim": [-0.2, 4.2], "ylim": [-0.8, 16.8], "xscale": "linear", "yscale": "linear", "grid_on": true, "lines": [{"xdata": [0, 1, 2, 3, 4], "ydata": [0, 1, 4, 9, 16], "color": "#1f77b4", "linestyle": "-", "...
line_008
line_plots
hard
Using the provided x and y arrays, create a line plot with logarithmic scale on the y-axis. Add title 'Exponential Growth', x-label 'Time', and y-label 'Value (log scale)'.
fig, ax = plt.subplots() ax.plot(x, y) ax.set_yscale('log') ax.set_title('Exponential Growth') ax.set_xlabel('Time') ax.set_ylabel('Value (log scale)')
["line_data", "yscale", "title", "xlabel", "ylabel"]
{"type": "arrays", "x": [1, 2, 3, 4, 5], "y": [10, 100, 1000, 10000, 100000]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Exponential Growth", "xlabel": "Time", "ylabel": "Value (log scale)", "xlim": [0.8, 5.2], "ylim": [6.309573444801933, 158489.3192461114], "xscale": "linear", "yscale": "log", "grid_on": false, "lines": [{"xdata": [1, 2, 3, 4, 5], "ydata": [10,...
scatter_001
scatter_plots
easy
Using the provided x and y arrays, create a scatter plot with title 'Squared Values', x-label 'X', and y-label 'X Squared'.
fig, ax = plt.subplots() ax.scatter(x, y) ax.set_title('Squared Values') ax.set_xlabel('X') ax.set_ylabel('X Squared')
["scatter_data", "title", "xlabel", "ylabel"]
{"type": "arrays", "x": [1, 2, 3, 4], "y": [1, 4, 9, 16]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Squared Values", "xlabel": "X", "ylabel": "X Squared", "xlim": [0.85, 4.15], "ylim": [0.25, 16.75], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [{"offsets": [[1.0, 1.0], [2.0, 4.0], [3...
scatter_002
scatter_plots
easy
Using the provided x and y arrays, create a scatter plot with green markers. Add title 'Inverse Relationship', x-label 'X', and y-label 'Y'.
fig, ax = plt.subplots() ax.scatter(x, y, c='green') ax.set_title('Inverse Relationship') ax.set_xlabel('X') ax.set_ylabel('Y')
["scatter_data", "scatter_color", "title", "xlabel", "ylabel"]
{"type": "arrays", "x": [1, 2, 3, 4, 5], "y": [5, 4, 3, 2, 1]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Inverse Relationship", "xlabel": "X", "ylabel": "Y", "xlim": [0.8, 5.2], "ylim": [0.8, 5.2], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [{"offsets": [[1.0, 5.0], [2.0, 4.0], [3.0, 3.0...
scatter_003
scatter_plots
easy
Using the provided x and y arrays, create a scatter plot with marker size 100. Add title 'Large Markers', x-label 'X', and y-label 'Y'.
fig, ax = plt.subplots() ax.scatter(x, y, s=100) ax.set_title('Large Markers') ax.set_xlabel('X') ax.set_ylabel('Y')
["scatter_data", "scatter_size", "title", "xlabel", "ylabel"]
{"type": "arrays", "x": [1, 2, 3], "y": [1, 2, 3]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Large Markers", "xlabel": "X", "ylabel": "Y", "xlim": [0.9, 3.1], "ylim": [0.9, 3.1], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [{"offsets": [[1.0, 1.0], [2.0, 2.0], [3.0, 3.0]], "fa...
scatter_004
scatter_plots
medium
Using the provided x, y_a, and y_b arrays, create two scatter series. Plot y_a in red and y_b in blue. Add title 'Two Groups', x-label 'X', and y-label 'Y'.
fig, ax = plt.subplots() ax.scatter(x, y_a, c='red') ax.scatter(x, y_b, c='blue') ax.set_title('Two Groups') ax.set_xlabel('X') ax.set_ylabel('Y')
["scatter_data", "scatter_color", "title", "xlabel", "ylabel"]
{"type": "multi_arrays", "x": [1, 2, 3], "y_a": [2, 3, 4], "y_b": [4, 5, 6]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Two Groups", "xlabel": "X", "ylabel": "Y", "xlim": [0.9, 3.1], "ylim": [1.8, 6.2], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [{"offsets": [[1.0, 2.0], [2.0, 3.0], [3.0, 4.0]], "facec...
scatter_005
scatter_plots
medium
Using the provided x, y_a, and y_b arrays, create two scatter series with alpha=0.5 for y_a and alpha=0.7 for y_b. Add a legend with labels 'A' and 'B', title 'Transparency Demo', x-label 'X', and y-label 'Y'.
fig, ax = plt.subplots() ax.scatter(x, y_a, alpha=0.5, label='A') ax.scatter(x, y_b, alpha=0.7, label='B') ax.legend() ax.set_title('Transparency Demo') ax.set_xlabel('X') ax.set_ylabel('Y')
["scatter_data", "legend", "title", "xlabel", "ylabel"]
{"type": "multi_arrays", "x": [1, 2, 3], "y_a": [2, 3, 4], "y_b": [4, 5, 6]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Transparency Demo", "xlabel": "X", "ylabel": "Y", "xlim": [0.9, 3.1], "ylim": [1.8, 6.2], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [{"offsets": [[1.0, 2.0], [2.0, 3.0], [3.0, 4.0]],...
scatter_006
scatter_plots
hard
Using the provided x, y, and sizes arrays, create a scatter plot where each point has a different size based on the sizes array. Add title 'Variable Size Points', x-label 'X', and y-label 'Y'.
fig, ax = plt.subplots() ax.scatter(x, y, s=sizes) ax.set_title('Variable Size Points') ax.set_xlabel('X') ax.set_ylabel('Y')
["scatter_data", "scatter_size", "title", "xlabel", "ylabel"]
{"type": "multi_arrays", "x": [1, 2, 3, 4, 5], "y": [1, 4, 9, 16, 25], "sizes": [20, 50, 100, 200, 400]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Variable Size Points", "xlabel": "X", "ylabel": "Y", "xlim": [0.8, 5.2], "ylim": [-0.20000000000000018, 26.2], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [{"offsets": [[1.0, 1.0], [2....
scatter_007
scatter_plots
hard
Using the provided x, y, and colors arrays, create a scatter plot where point colors are determined by the colors array using the 'viridis' colormap. Add a colorbar, title 'Color Mapped Data', x-label 'X', and y-label 'Y'.
fig, ax = plt.subplots() sc = ax.scatter(x, y, c=colors, cmap='viridis') plt.colorbar(sc) ax.set_title('Color Mapped Data') ax.set_xlabel('X') ax.set_ylabel('Y')
["scatter_data", "title", "xlabel", "ylabel"]
{"type": "multi_arrays", "x": [1, 2, 3, 4, 5], "y": [1, 2, 3, 4, 5], "colors": [0, 25, 50, 75, 100]}
{"axes_count": 2, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Color Mapped Data", "xlabel": "X", "ylabel": "Y", "xlim": [0.8, 5.2], "ylim": [0.8, 5.2], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [{"offsets": [[1.0, 1.0], [2.0, 2.0], [3.0, 3.0], ...
bar_001
bar_charts
easy
Using the provided categories and heights arrays, create a bar chart with title 'Category Counts', x-label 'Category', and y-label 'Count'.
fig, ax = plt.subplots() ax.bar(categories, heights) ax.set_title('Category Counts') ax.set_xlabel('Category') ax.set_ylabel('Count')
["bar_data", "title", "xlabel", "ylabel"]
{"type": "bar_data", "categories": ["A", "B", "C"], "heights": [10, 20, 15]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Category Counts", "xlabel": "Category", "ylabel": "Count", "xlim": [-0.54, 2.5400000000000005], "ylim": [0.0, 21.0], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [], "collection_count":...
bar_002
bar_charts
easy
Using the provided categories and heights arrays, create a bar chart with orange bars. Add title 'Sales by Region', x-label 'Region', and y-label 'Sales'.
fig, ax = plt.subplots() ax.bar(categories, heights, color='orange') ax.set_title('Sales by Region') ax.set_xlabel('Region') ax.set_ylabel('Sales')
["bar_data", "bar_color", "title", "xlabel", "ylabel"]
{"type": "bar_data", "categories": ["X", "Y", "Z"], "heights": [5, 15, 10]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Sales by Region", "xlabel": "Region", "ylabel": "Sales", "xlim": [-0.54, 2.5400000000000005], "ylim": [0.0, 15.75], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [], "collection_count": ...
bar_003
bar_charts
medium
Using the provided categories and widths arrays, create a horizontal bar chart with title 'Product Revenue', x-label 'Revenue ($)', and y-label 'Product'.
fig, ax = plt.subplots() ax.barh(categories, widths) ax.set_title('Product Revenue') ax.set_xlabel('Revenue ($)') ax.set_ylabel('Product')
["bar_data", "title", "xlabel", "ylabel"]
{"type": "bar_data", "categories": ["Product A", "Product B", "Product C"], "widths": [100, 150, 80]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Product Revenue", "xlabel": "Revenue ($)", "ylabel": "Product", "xlim": [0.0, 157.5], "ylim": [-0.54, 2.5400000000000005], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [], "collection_c...
bar_004
bar_charts
medium
Using the provided categories and heights arrays, create a bar chart with blue fill and black edge color with edge width of 2. Add title 'Monthly Sales', x-label 'Month', and y-label 'Sales'.
fig, ax = plt.subplots() ax.bar(categories, heights, color='blue', edgecolor='black', linewidth=2) ax.set_title('Monthly Sales') ax.set_xlabel('Month') ax.set_ylabel('Sales')
["bar_data", "bar_color", "title", "xlabel", "ylabel"]
{"type": "bar_data", "categories": ["Jan", "Feb", "Mar", "Apr"], "heights": [30, 45, 38, 50]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Monthly Sales", "xlabel": "Month", "ylabel": "Sales", "xlim": [-0.5900000000000001, 3.5900000000000003], "ylim": [0.0, 52.5], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [], "collectio...
bar_005
bar_charts
medium
Using the provided categories, values_a, and values_b arrays, create a grouped bar chart. Place group A bars and group B bars side by side. Use width=0.35 and label them 'Group A' and 'Group B'. Add a legend, title 'Quarterly Comparison', x-label 'Quarter', and y-label 'Value'.
fig, ax = plt.subplots() x = np.arange(len(categories)) width = 0.35 ax.bar(x - width/2, values_a, width, label='Group A') ax.bar(x + width/2, values_b, width, label='Group B') ax.set_xticks(x) ax.set_xticklabels(categories) ax.legend() ax.set_title('Quarterly Comparison') ax.set_xlabel('Quarter') ax.set_ylabel('Value'...
["bar_data", "legend", "xticklabels", "title", "xlabel", "ylabel"]
{"type": "grouped_bar_data", "categories": ["Q1", "Q2", "Q3"], "values_a": [20, 35, 30], "values_b": [25, 32, 34]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Quarterly Comparison", "xlabel": "Quarter", "ylabel": "Value", "xlim": [-0.485, 2.4849999999999994], "ylim": [0.0, 36.75], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [], "collection_c...
bar_006
bar_charts
hard
Using the provided categories, heights_a, and heights_b arrays, create a stacked bar chart. Plot heights_a in blue with label 'Product A', then stack heights_b on top in orange with label 'Product B'. Add a legend, title 'Stacked Revenue', x-label 'Quarter', and y-label 'Revenue'.
fig, ax = plt.subplots() ax.bar(categories, heights_a, label='Product A', color='blue') ax.bar(categories, heights_b, bottom=heights_a, label='Product B', color='orange') ax.legend() ax.set_title('Stacked Revenue') ax.set_xlabel('Quarter') ax.set_ylabel('Revenue')
["bar_data", "bar_color", "legend", "title", "xlabel", "ylabel"]
{"type": "stacked_bar_data", "categories": ["Q1", "Q2", "Q3"], "heights_a": [20, 25, 30], "heights_b": [15, 20, 25]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Stacked Revenue", "xlabel": "Quarter", "ylabel": "Revenue", "xlim": [-0.54, 2.5400000000000005], "ylim": [0.0, 57.75], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [], "collection_count...
bar_007
bar_charts
hard
Using the provided categories, heights, and errors arrays, create a bar chart with error bars (capsize=5). Add title 'Measurements with Error', x-label 'Sample', and y-label 'Value'.
fig, ax = plt.subplots() ax.bar(categories, heights, yerr=errors, capsize=5) ax.set_title('Measurements with Error') ax.set_xlabel('Sample') ax.set_ylabel('Value')
["bar_data", "title", "xlabel", "ylabel"]
{"type": "bar_error_data", "categories": ["A", "B", "C", "D"], "heights": [25, 40, 30, 55], "errors": [2, 3, 2.5, 4]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Measurements with Error", "xlabel": "Sample", "ylabel": "Value", "xlim": [-0.5900000000000001, 3.5900000000000003], "ylim": [0.0, 61.95], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [0.0, 1.0, 2.0, 3.0], "ydat...
bar_008
bar_charts
hard
Using the provided categories and heights arrays, create a bar chart and add the height value as a text label on top of each bar. Add title 'Values with Labels', x-label 'Category', and y-label 'Value'.
fig, ax = plt.subplots() bars = ax.bar(categories, heights) for bar in bars: height = bar.get_height() ax.text(bar.get_x() + bar.get_width()/2., height, f'{height}', ha='center', va='bottom') ax.set_title('Values with Labels') ax.set_xlabel('Category') ax.set_ylabel('Value')
["bar_data", "texts", "title", "xlabel", "ylabel"]
{"type": "bar_data", "categories": ["A", "B", "C"], "heights": [10, 25, 15]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Values with Labels", "xlabel": "Category", "ylabel": "Value", "xlim": [-0.54, 2.5400000000000005], "ylim": [0.0, 26.25], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [], "collection_cou...
hist_001
histograms
easy
Using the provided values array, create a histogram with 5 bins and black edges (edgecolor='black'). Add title 'Value Distribution', x-label 'Value', and y-label 'Frequency'.
fig, ax = plt.subplots() ax.hist(values, bins=5, edgecolor='black') ax.set_title('Value Distribution') ax.set_xlabel('Value') ax.set_ylabel('Frequency')
["patch_count", "title", "xlabel", "ylabel"]
{"type": "hist_data", "values": [1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 5]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Value Distribution", "xlabel": "Value", "ylabel": "Frequency", "xlim": [0.7999999999999998, 5.199999999999999], "ylim": [0.0, 4.2], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [], "col...
hist_002
histograms
easy
Using the provided values array, create a histogram with green bars, black edges (edgecolor='black'), and 10 bins. Add title 'Data Histogram', x-label 'Value', and y-label 'Count'.
fig, ax = plt.subplots() ax.hist(values, bins=10, color='green', edgecolor='black') ax.set_title('Data Histogram') ax.set_xlabel('Value') ax.set_ylabel('Count')
["patch_count", "bar_color", "title", "xlabel", "ylabel"]
{"type": "hist_data", "values": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Data Histogram", "xlabel": "Value", "ylabel": "Count", "xlim": [-1.4500000000000006, 52.45], "ylim": [0.0, 5.25], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [], "collection_count": 0,...
hist_003
histograms
medium
Using the provided values array, create a histogram with blue bars, black edges (edgecolor='black'), and 8 bins. Add title 'Score Distribution', x-label 'Score', and y-label 'Frequency'.
fig, ax = plt.subplots() ax.hist(values, bins=8, color='blue', edgecolor='black') ax.set_title('Score Distribution') ax.set_xlabel('Score') ax.set_ylabel('Frequency')
["patch_count", "bar_color", "title", "xlabel", "ylabel"]
{"type": "hist_data", "values": [10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Score Distribution", "xlabel": "Score", "ylabel": "Frequency", "xlim": [6.5, 83.5], "ylim": [0.0, 2.1], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [], "collection_count": 0, "patches"...
hist_004
histograms
medium
Using the provided values array, create a histogram with density=True (normalized so area sums to 1), black edges (edgecolor='black'). Use the default number of bins. Add title 'Probability Density', x-label 'Value', and y-label 'Density'.
fig, ax = plt.subplots() ax.hist(values, density=True, edgecolor='black') ax.set_title('Probability Density') ax.set_xlabel('Value') ax.set_ylabel('Density')
["patch_count", "title", "xlabel", "ylabel"]
{"type": "hist_data", "values": [1, 1, 2, 2, 2, 3, 3, 4, 5, 5, 5, 5]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Probability Density", "xlabel": "Value", "ylabel": "Density", "xlim": [0.8, 5.2], "ylim": [0.0, 0.8749999999999992], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [], "collection_count":...
hist_005
histograms
hard
Using the provided values_a and values_b arrays, create two overlapping histograms with alpha=0.5 and black edges (edgecolor='black'). Use 10 bins, label them 'Group A' and 'Group B'. Add a legend, title 'Group Comparison', x-label 'Value', and y-label 'Frequency'.
fig, ax = plt.subplots() ax.hist(values_a, bins=10, alpha=0.5, edgecolor='black', label='Group A') ax.hist(values_b, bins=10, alpha=0.5, edgecolor='black', label='Group B') ax.legend() ax.set_title('Group Comparison') ax.set_xlabel('Value') ax.set_ylabel('Frequency')
["patch_count", "legend", "title", "xlabel", "ylabel"]
{"type": "multi_hist_data", "values_a": [20, 25, 30, 35, 40, 45, 50, 55, 60], "values_b": [30, 35, 40, 45, 50, 55, 60, 65, 70]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Group Comparison", "xlabel": "Value", "ylabel": "Frequency", "xlim": [17.5, 72.5], "ylim": [0.0, 1.05], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [], "collection_count": 0, "patches"...
hist_006
histograms
hard
Using the provided values array, create a cumulative histogram (cumulative=True) with 20 bins and black edges (edgecolor='black'). Add title 'Cumulative Distribution', x-label 'Value', and y-label 'Cumulative Count'.
fig, ax = plt.subplots() ax.hist(values, bins=20, cumulative=True, edgecolor='black') ax.set_title('Cumulative Distribution') ax.set_xlabel('Value') ax.set_ylabel('Cumulative Count')
["patch_count", "title", "xlabel", "ylabel"]
{"type": "hist_data", "values": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ...
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Cumulative Distribution", "xlabel": "Value", "ylabel": "Cumulative Count", "xlim": [-3.9500000000000015, 104.95000000000002], "ylim": [0.0, 105.0], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collec...
box_001
boxplots
medium
Using the provided data array, create a basic boxplot with default styling. Add title 'Data Distribution', x-label 'Sample', and y-label 'Value'.
fig, ax = plt.subplots() ax.boxplot(data) ax.set_title('Data Distribution') ax.set_xlabel('Sample') ax.set_ylabel('Value')
["box_count", "title", "xlabel", "ylabel"]
{"type": "box_data", "data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Data Distribution", "xlabel": "Sample", "ylabel": "Value", "xlim": [0.5, 1.5], "ylim": [0.55, 10.45], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [0.925, 1.075, 1.075, 0.925, 0.925], "ydata": [3.25, 3.25, 7.75...
box_002
boxplots
medium
Using the provided data_a, data_b, and data_c arrays, create three boxplots on a single axes with default styling. Add title 'Group Comparison', x-label 'Group', and y-label 'Value'.
fig, ax = plt.subplots() ax.boxplot([data_a, data_b, data_c]) ax.set_title('Group Comparison') ax.set_xlabel('Group') ax.set_ylabel('Value')
["box_count", "title", "xlabel", "ylabel"]
{"type": "multi_box_data", "data_a": [1, 2, 3, 4, 5], "data_b": [3, 4, 5, 6, 7], "data_c": [5, 6, 7, 8, 9]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Group Comparison", "xlabel": "Group", "ylabel": "Value", "xlim": [0.5, 3.5], "ylim": [0.6, 9.4], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [0.85, 1.15, 1.15, 0.85, 0.85], "ydata": [2.0, 2.0, 4.0, 4.0, 2.0], ...
box_003
boxplots
medium
Using the provided data_a and data_b arrays, create two boxplots with labels 'Control' and 'Treatment' using default styling. Add title 'Experiment Results', x-label 'Group', and y-label 'Measurement'.
fig, ax = plt.subplots() ax.boxplot([data_a, data_b], labels=['Control', 'Treatment']) ax.set_title('Experiment Results') ax.set_xlabel('Group') ax.set_ylabel('Measurement')
["box_count", "xticklabels", "title", "xlabel", "ylabel"]
{"type": "multi_box_data", "data_a": [10, 12, 14, 16, 18], "data_b": [20, 22, 24, 26, 28]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Experiment Results", "xlabel": "Group", "ylabel": "Measurement", "xlim": [0.5, 2.5], "ylim": [9.1, 28.9], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [0.925, 1.075, 1.075, 0.925, 0.925], "ydata": [12.0, 12.0, ...
box_004
boxplots
hard
Using the provided data_a and data_b arrays, create two horizontal boxplots (vert=False) with default styling. Add title 'Horizontal Boxplots', x-label 'Value', and y-label 'Dataset'.
fig, ax = plt.subplots() ax.boxplot([data_a, data_b], vert=False) ax.set_title('Horizontal Boxplots') ax.set_xlabel('Value') ax.set_ylabel('Dataset')
["box_count", "title", "xlabel", "ylabel"]
{"type": "multi_box_data", "data_a": [15, 18, 20, 22, 25], "data_b": [30, 32, 35, 38, 40]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Horizontal Boxplots", "xlabel": "Value", "ylabel": "Dataset", "xlim": [13.75, 41.25], "ylim": [0.5, 2.5], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [18.0, 18.0, 22.0, 22.0, 18.0], "ydata": [0.925, 1.075, 1.0...
box_005
boxplots
hard
Using the provided DataFrame df (with columns 'value' and 'group'), create a seaborn boxplot comparing the groups. Add title 'Group Analysis', x-label 'Group', and y-label 'Value'.
fig, ax = plt.subplots() sns.boxplot(data=df, x='group', y='value', ax=ax) ax.set_title('Group Analysis') ax.set_xlabel('Group') ax.set_ylabel('Value')
["patch_count", "title", "xlabel", "ylabel"]
{"type": "dataframe", "df": {"value": [10, 12, 14, 16, 18, 20, 22, 24, 26, 28], "group": ["A", "A", "A", "A", "A", "B", "B", "B", "B", "B"]}}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Group Analysis", "xlabel": "Group", "ylabel": "Value", "xlim": [-0.5, 1.5], "ylim": [9.1, 28.9], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [0.0, 0.0], "ydata": [12.0, 10.0], "color": "#3f3f3f", "linestyle": ...
box_006
boxplots
hard
Using the provided data_a and data_b arrays, create a violin plot showing both distributions with default styling. Add title 'Distribution Comparison', x-label 'Dataset', and y-label 'Value'.
fig, ax = plt.subplots() ax.violinplot([data_a, data_b]) ax.set_title('Distribution Comparison') ax.set_xlabel('Dataset') ax.set_ylabel('Value')
["violin_count", "title", "xlabel", "ylabel"]
{"type": "multi_box_data", "data_a": [45, 48, 50, 52, 55, 47, 49, 51, 53, 46], "data_b": [55, 58, 60, 62, 65, 57, 59, 61, 63, 56]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Distribution Comparison", "xlabel": "Dataset", "ylabel": "Value", "xlim": [0.675, 2.325], "ylim": [44.0, 66.0], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [{"offsets": [[0.0, 0.0]], "...
text_001
annotations
easy
Create an empty plot with title 'My Plot', x-label 'X Axis', and y-label 'Y Axis'.
fig, ax = plt.subplots() ax.set_title('My Plot') ax.set_xlabel('X Axis') ax.set_ylabel('Y Axis')
["title", "xlabel", "ylabel"]
{"type": "none"}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "My Plot", "xlabel": "X Axis", "ylabel": "Y Axis", "xlim": [0.0, 1.0], "ylim": [0.0, 1.0], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [], "collection_count": 0, "patches": [], "patch_c...
text_002
annotations
easy
Using the provided x and y arrays, create a line plot with title 'Temperature Over Time', x-label 'Day', and y-label 'Temperature (C)'.
fig, ax = plt.subplots() ax.plot(x, y) ax.set_title('Temperature Over Time') ax.set_xlabel('Day') ax.set_ylabel('Temperature (C)')
["line_data", "title", "xlabel", "ylabel"]
{"type": "arrays", "x": [1, 2, 3, 4, 5], "y": [20, 22, 21, 23, 25]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Temperature Over Time", "xlabel": "Day", "ylabel": "Temperature (C)", "xlim": [0.8, 5.2], "ylim": [19.75, 25.25], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [1, 2, 3, 4, 5], "ydata": [20, 22, 21, 23, 25], "co...
text_003
annotations
medium
Using the provided x and y arrays, create a line plot. Add a text annotation 'Peak' at position (3, 9). Add title 'Peak Detection', x-label 'X', and y-label 'Y'.
fig, ax = plt.subplots() ax.plot(x, y) ax.text(3, 9, 'Peak') ax.set_title('Peak Detection') ax.set_xlabel('X') ax.set_ylabel('Y')
["line_data", "texts", "title", "xlabel", "ylabel"]
{"type": "arrays", "x": [1, 2, 3, 4, 5], "y": [1, 4, 9, 4, 1]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Peak Detection", "xlabel": "X", "ylabel": "Y", "xlim": [0.8, 5.2], "ylim": [0.6, 9.4], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [1, 2, 3, 4, 5], "ydata": [1, 4, 9, 4, 1], "color": "#1f77b4", "linestyle": "-...
text_004
annotations
medium
Using the provided x and y arrays, create a line plot. Add an annotation 'Maximum' pointing to the point (4, 16) with an arrow from position (2, 12). Add title 'Quadratic Function', x-label 'X', and y-label 'X Squared'.
fig, ax = plt.subplots() ax.plot(x, y) ax.annotate('Maximum', xy=(4, 16), xytext=(2, 12), arrowprops=dict(arrowstyle='->')) ax.set_title('Quadratic Function') ax.set_xlabel('X') ax.set_ylabel('X Squared')
["line_data", "texts", "title", "xlabel", "ylabel"]
{"type": "arrays", "x": [0, 1, 2, 3, 4], "y": [0, 1, 4, 9, 16]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Quadratic Function", "xlabel": "X", "ylabel": "X Squared", "xlim": [-0.2, 4.2], "ylim": [-0.8, 16.8], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [0, 1, 2, 3, 4], "ydata": [0, 1, 4, 9, 16], "color": "#1f77b4",...
text_005
annotations
hard
Using the provided x and y arrays, create a line plot. Add annotations 'Start' at the first point and 'End' at the last point, both with arrows. Add title 'Journey Progress', x-label 'Time', and y-label 'Progress'.
fig, ax = plt.subplots() ax.plot(x, y) ax.annotate('Start', xy=(0, 10), xytext=(0.5, 8), arrowprops=dict(arrowstyle='->')) ax.annotate('End', xy=(4, 20), xytext=(3.5, 22), arrowprops=dict(arrowstyle='->')) ax.set_title('Journey Progress') ax.set_xlabel('Time') ax.set_ylabel('Progress')
["line_data", "texts", "title", "xlabel", "ylabel"]
{"type": "arrays", "x": [0, 1, 2, 3, 4], "y": [10, 15, 12, 18, 20]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Journey Progress", "xlabel": "Time", "ylabel": "Progress", "xlim": [-0.2, 4.2], "ylim": [9.5, 20.5], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [0, 1, 2, 3, 4], "ydata": [10, 15, 12, 18, 20], "color": "#1f77b...
text_006
annotations
medium
Using the provided x and y arrays, create a line plot. Set x-axis limits to (0, 10) and y-axis limits to (0, 50). Add title 'Linear Trend', x-label 'X', and y-label 'Y'.
fig, ax = plt.subplots() ax.plot(x, y) ax.set_xlim(0, 10) ax.set_ylim(0, 50) ax.set_title('Linear Trend') ax.set_xlabel('X') ax.set_ylabel('Y')
["line_data", "xlim", "ylim", "title", "xlabel", "ylabel"]
{"type": "arrays", "x": [1, 2, 3, 4, 5], "y": [10, 20, 30, 40, 50]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Linear Trend", "xlabel": "X", "ylabel": "Y", "xlim": [0.0, 10.0], "ylim": [0.0, 50.0], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [1, 2, 3, 4, 5], "ydata": [10, 20, 30, 40, 50], "color": "#1f77b4", "linestyle...
text_007
annotations
hard
Using the provided categories and heights arrays, create a bar chart. Set the x-tick labels to ['January', 'February', 'March'] with 45-degree rotation. Add title 'Monthly Revenue', x-label 'Month', and y-label 'Revenue ($)'.
fig, ax = plt.subplots() ax.bar(categories, heights) ax.set_xticks(categories) ax.set_xticklabels(['January', 'February', 'March'], rotation=45) ax.set_title('Monthly Revenue') ax.set_xlabel('Month') ax.set_ylabel('Revenue ($)')
["bar_data", "xticklabels", "title", "xlabel", "ylabel"]
{"type": "bar_data", "categories": [0, 1, 2], "heights": [100, 150, 120]}
{"axes_count": 1, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Monthly Revenue", "xlabel": "Month", "ylabel": "Revenue ($)", "xlim": [-0.54, 2.5400000000000005], "ylim": [0.0, 157.5], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [], "collection_cou...
layout_001
layouts
medium
Using the provided line_data and scatter_x/scatter_y arrays, create a 1x2 subplot. Left: line plot of line_data with title 'Line Plot'. Right: scatter plot using scatter_x and scatter_y with title 'Scatter Plot'.
fig, (ax1, ax2) = plt.subplots(1, 2) ax1.plot(line_data) ax1.set_title('Line Plot') ax2.scatter(scatter_x, scatter_y) ax2.set_title('Scatter Plot')
["axes_count", "line_count", "collection_count"]
{"type": "layout_data", "line_data": [1, 2, 3, 4], "scatter_x": [1, 2, 3], "scatter_y": [1, 2, 3]}
{"axes_count": 2, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Line Plot", "xlabel": "", "ylabel": "", "xlim": [-0.15000000000000002, 3.15], "ylim": [0.85, 4.15], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [0.0, 1.0, 2.0, 3.0], "ydata": [1, 2, 3, 4], "color": "#1f77b4", ...
layout_002
layouts
medium
Using the provided y1 and y2 arrays, create a 2x1 subplot (2 rows, 1 column). Top: line plot of y1 with title 'Quadratic'. Bottom: line plot of y2 with title 'Linear'.
fig, (ax1, ax2) = plt.subplots(2, 1) ax1.plot(y1) ax1.set_title('Quadratic') ax2.plot(y2) ax2.set_title('Linear')
["axes_count", "line_data"]
{"type": "multi_arrays", "y1": [1, 4, 9, 16], "y2": [1, 2, 3, 4]}
{"axes_count": 2, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Quadratic", "xlabel": "", "ylabel": "", "xlim": [-0.15000000000000002, 3.15], "ylim": [0.25, 16.75], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [0.0, 1.0, 2.0, 3.0], "ydata": [1, 4, 9, 16], "color": "#1f77b4"...
layout_003
layouts
medium
Using the provided x and y arrays, create a line plot with figure size (10, 6). Add title 'Squares', x-label 'X', and y-label 'X Squared'.
fig, ax = plt.subplots(figsize=(10, 6)) ax.plot(x, y) ax.set_title('Squares') ax.set_xlabel('X') ax.set_ylabel('X Squared')
["figure_size", "line_data", "title", "xlabel", "ylabel"]
{"type": "arrays", "x": [1, 2, 3, 4, 5], "y": [1, 4, 9, 16, 25]}
{"axes_count": 1, "figure_size": [10.0, 6.0], "axes": [{"index": 0, "title": "Squares", "xlabel": "X", "ylabel": "X Squared", "xlim": [0.8, 5.2], "ylim": [-0.20000000000000018, 26.2], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [1, 2, 3, 4, 5], "ydata": [1, 4, 9, 16, 25], "color": "#1f...
layout_004
layouts
hard
Create a 2x2 grid of subplots. In position (0,0) plot a line [1,2,3,4] with title 'Line'. In (0,1) scatter points (1,1),(2,2),(3,3) with title 'Scatter'. In (1,0) create bars with heights [3,2,1] with title 'Bar'. In (1,1) create a histogram of [1,1,2,2,2,3] with title 'Histogram'.
fig, axs = plt.subplots(2, 2) axs[0, 0].plot(line_y) axs[0, 0].set_title('Line') axs[0, 1].scatter(scatter_x, scatter_y) axs[0, 1].set_title('Scatter') axs[1, 0].bar([0, 1, 2], bar_heights) axs[1, 0].set_title('Bar') axs[1, 1].hist(hist_values) axs[1, 1].set_title('Histogram')
["axes_count"]
{"type": "complex_layout", "line_y": [1, 2, 3, 4], "scatter_x": [1, 2, 3], "scatter_y": [1, 2, 3], "bar_heights": [3, 2, 1], "hist_values": [1, 1, 2, 2, 2, 3]}
{"axes_count": 4, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Line", "xlabel": "", "ylabel": "", "xlim": [-0.15000000000000002, 3.15], "ylim": [0.85, 4.15], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [0.0, 1.0, 2.0, 3.0], "ydata": [1, 2, 3, 4], "color": "#1f77b4", "line...
layout_005
layouts
hard
Using the provided y1 and y2 arrays, create a 2x1 subplot with shared x-axis (sharex=True). Plot y1 in top with title 'Ascending' and y2 in bottom with title 'Descending'.
fig, (ax1, ax2) = plt.subplots(2, 1, sharex=True) ax1.plot(y1) ax1.set_title('Ascending') ax2.plot(y2) ax2.set_title('Descending')
["axes_count", "line_data"]
{"type": "multi_arrays", "y1": [1, 4, 9, 16, 25], "y2": [25, 16, 9, 4, 1]}
{"axes_count": 2, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Ascending", "xlabel": "", "ylabel": "", "xlim": [-0.2, 4.2], "ylim": [-0.20000000000000018, 26.2], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [0.0, 1.0, 2.0, 3.0, 4.0], "ydata": [1, 4, 9, 16, 25], "color": "#...
layout_006
layouts
hard
Using the provided x, y1, and y2 arrays, create a plot with two y-axes. Plot y1 on the left axis in blue with y-label 'Temperature (C)' and y2 on the right axis (using ax.twinx()) in red with y-label 'Revenue ($)'. Add title 'Dual Axis Plot' and x-label 'Month'.
fig, ax1 = plt.subplots() ax1.plot(x, y1, color='blue') ax1.set_ylabel('Temperature (C)') ax1.set_xlabel('Month') ax1.set_title('Dual Axis Plot') ax2 = ax1.twinx() ax2.plot(x, y2, color='red') ax2.set_ylabel('Revenue ($)')
["axes_count", "line_count", "line_color", "title", "xlabel", "ylabel"]
{"type": "multi_arrays", "x": [1, 2, 3, 4, 5], "y1": [10, 20, 30, 40, 50], "y2": [1000, 2000, 1500, 2500, 3000]}
{"axes_count": 2, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Dual Axis Plot", "xlabel": "Month", "ylabel": "Temperature (C)", "xlim": [0.8, 5.2], "ylim": [8.0, 52.0], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [{"xdata": [1, 2, 3, 4, 5], "ydata": [10, 20, 30, 40, 50], "color": "#...
layout_007
layouts
hard
Create a 2x2 subplot. Add a unique title to each subplot: 'Plot 1', 'Plot 2', 'Plot 3', 'Plot 4'. Use plt.tight_layout() to prevent overlapping.
fig, axs = plt.subplots(2, 2) axs[0, 0].set_title('Plot 1') axs[0, 1].set_title('Plot 2') axs[1, 0].set_title('Plot 3') axs[1, 1].set_title('Plot 4') plt.tight_layout()
["axes_count", "title"]
{"type": "none"}
{"axes_count": 4, "figure_size": [6.4, 4.8], "axes": [{"index": 0, "title": "Plot 1", "xlabel": "", "ylabel": "", "xlim": [0.0, 1.0], "ylim": [0.0, 1.0], "xscale": "linear", "yscale": "linear", "grid_on": false, "lines": [], "line_count": 0, "collections": [], "collection_count": 0, "patches": [], "patch_count": 0, "le...
README.md exists but content is empty.
Downloads last month
9