Created
April 25, 2022 15:35
-
-
Save audhiaprilliant/b5a415f33842f989594a9e6d94ee9124 to your computer and use it in GitHub Desktop.
Simulation of Monty Hall Problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| plotnine.options.figure_size = (10, 4.8) | |
| ( | |
| ggplot( | |
| data = df_general | |
| )+ | |
| geom_line( | |
| aes(x = 'iter', | |
| y = 'value', | |
| group = 'status', | |
| color = 'status'), | |
| size = 1 | |
| )+ | |
| scale_x_continuous( | |
| breaks = range(0, len(df_general) + 100, 100) | |
| )+ | |
| scale_color_manual( | |
| values = ['#981220', '#80797c'], | |
| labels = ['Stick', 'Switch'] | |
| )+ | |
| labs( | |
| title = 'Probability of winning the game', | |
| color = 'Strategy' | |
| )+ | |
| xlab( | |
| xlab = 'Number of iteration' | |
| )+ | |
| ylab( | |
| ylab = 'Number of chance' | |
| )+ | |
| theme_minimal()+ | |
| theme( | |
| legend_position = (0.225, 0.815), | |
| legend_direction = 'horizontal' | |
| ) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment