Compare commits

..

No commits in common. "dev2" and "dev" have entirely different histories.
dev2 ... dev

3 changed files with 2 additions and 130 deletions

View File

@ -1,68 +1,5 @@
Programming Challenges - Increasing Difficulty Napisz program w języku Python, który narysuje wykres funkcji liniowej y=x.
Task 1: Basic Plotting Author: AI
Create a Python script that plots a simple quadratic function y = x^2 for x values from -5 to 5.
Requirements:
- Use NumPy to generate the x values (at least 100 points)
- Calculate corresponding y values
- Plot the function using Matplotlib
- Add appropriate labels and title
Task 2: Multiple Functions
Extend your script to plot two functions on the same graph:
- y1 = sin(x)
- y2 = cos(x)
Requirements:
- Plot both functions for x values from 0 to 4π
- Use different colors for each function
- Add a legend to distinguish the functions
- Include axis labels and a title
Task 3: Parametric Plotting
Create a script that plots a parametric curve (e.g., a spiral or Lissajous figure).
Requirements:
- Use parametric equations to generate x and y coordinates
- Plot the curve with appropriate styling
- Add labels, title, and grid
- Experiment with different parameter ranges
Task 4: Data Visualization
Create a script that visualizes a dataset (you can generate synthetic data or use built-in datasets).
Requirements:
- Create at least 2 different types of plots (e.g., line plot, scatter plot, bar chart)
- Include proper labels, titles, and legends
- Use color effectively to enhance understanding
- Add annotations or special markers for important data points
Task 5: Interactive Plotting
Create an interactive plot where users can modify parameters and see the results in real-time.
Requirements:
- Use matplotlib widgets or another interactive library
- Allow users to change at least 2 parameters of a function
- Update the plot dynamically as parameters change
- Include clear instructions for the user
Task 6: Advanced Visualization
Create a comprehensive visualization that combines multiple plot types in subplots.
Requirements:
- Create at least 3 subplots with different types of visualizations
- Share axes where appropriate
- Use consistent styling across all subplots
- Include a main title for the entire figure
- Save the figure to a file with high resolution
Task 7: Object-Oriented Plotting
Refactor one of your previous scripts to use object-oriented Matplotlib approach.
Requirements:
- Use Figure and Axes objects explicitly
- Create reusable plotting functions or classes
- Implement proper error handling
- Document your code with comments or docstrings
Task 8: Custom Visualization
Create a unique visualization of your choice that demonstrates advanced Matplotlib features.
Requirements:
- Use advanced features like custom colormaps, 3D plotting, or animations
- Include data analysis or transformation
- Make the visualization informative and visually appealing
- Provide a clear explanation of what the visualization shows

View File

@ -1,37 +0,0 @@
import matplotlib.pyplot as plt
import numpy as np
# Zdefiniuj zakres wartości x
x = np.linspace(-10, 10, 400) # 400 punktów od -10 do 10
# Oblicz wartości y = x
y = x
# Narysuj wykres
plt.plot(x, y, label='y = x')
# Dodaj okrąg
theta = np.linspace(0, 2*np.pi, 400)
radius = 5
x_circle = radius * np.cos(theta)
y_circle = radius * np.sin(theta)
plt.plot(x_circle, y_circle, label=f'Okrąg o promieniu {radius}')
# Dodaj siatkę
plt.grid(True)
# Dodaj etykiety osi
plt.xlabel('x')
plt.ylabel('y')
# Dodaj tytuł
plt.title('Wykres funkcji liniowej y = x z okręgiem')
# Pokaż legendę
plt.legend()
# Ustaw skalę osi, żeby wyglądało proporcjonalnie
plt.axis('equal')
# Wyświetl wykres
plt.show()

28
rozw
View File

@ -1,28 +0,0 @@
import numpy as np
import matplotlib.pyplot as plt
# Generate x values from 0 to 4π
x = np.linspace(0, 4*np.pi, 1000)
# Calculate y values for both functions
y1 = np.sin(x)
y2 = np.cos(x)
# Create the plot
plt.figure(figsize=(10, 6))
plt.plot(x, y1, color='blue', label='sin(x)')
plt.plot(x, y2, color='red', label='cos(x)')
# Add labels and title
plt.xlabel('x')
plt.ylabel('y')
plt.title('Sine and Cosine Functions')
# Add legend
plt.legend()
# Add grid for better readability
plt.grid(True, alpha=0.3)
# Display the plot
plt.show()