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
| """ | |
| china_power_redesigned.py | |
| ========================= | |
| A redesign of a dual-axis stacked-area chart from S&P Global's "Look Forward: | |
| Energy Futures" (Feb 2026), showing China's power generation mix and CO2 | |
| emissions, 2015-2025. | |
| The original chart tried to show two claims at once: | |
| (1) electricity demand keeps rising, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| np.random.seed(123456) | |
| N = 100 | |
| aim = 0 | |
| scale = 0.5 | |
| adjusted = [] | |
| for i in range(N): | |
| curr = np.random.randn() * scale + aim | |
| adjusted.append(curr) | |
| aim = -curr | |
| non_adjusted = np.random.randn(N)*scale |
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
| from __future__ import print_function | |
| import numpy as np | |
| def asciihist(it, bins=10, minmax=None, str_tag='', | |
| scale_output=30, generate_only=False, print_function=print): | |
| """Create an ASCII histogram from an interable of numbers. | |
| Author: Boris Gorelik boris@gorelik.net. based on http://econpy.googlecode.com/svn/trunk/pytrix/pytrix.py | |
| License: MIT | |
| """ | |
| ret = [] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder