-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Update colorbar tick names in sunpath gallery example #2097
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
1570da7
62c1b7a
0a26efb
4945475
587fb66
9ca3163
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -33,7 +33,14 @@ | |||||
# draw the analemma loops | ||||||
points = ax.scatter(np.radians(solpos.azimuth), solpos.apparent_zenith, | ||||||
s=2, label=None, c=solpos.index.dayofyear) | ||||||
ax.figure.colorbar(points) | ||||||
# add and format colorbar | ||||||
cbar = ax.figure.colorbar(points) | ||||||
times_ticks = pd.date_range('2019-01-01', '2020-01-01', freq='MS', tz=tz) | ||||||
cbar.set_ticks(ticks=times_ticks.dayofyear, labels=[], minor=False) | ||||||
cbar.set_ticks(ticks=times_ticks.dayofyear+15, | ||||||
labels=times_ticks.strftime('%b'), | ||||||
minor=True) | ||||||
cbar.ax.tick_params(which='minor', width=0) | ||||||
|
||||||
# draw hour labels | ||||||
for hour in np.unique(solpos.index.hour): | ||||||
|
@@ -112,7 +119,14 @@ | |||||
fig, ax = plt.subplots() | ||||||
points = ax.scatter(solpos.azimuth, solpos.apparent_elevation, s=2, | ||||||
c=solpos.index.dayofyear, label=None) | ||||||
fig.colorbar(points) | ||||||
# add and format colorbar | ||||||
cbar = fig.colorbar(points) | ||||||
times_ticks = pd.date_range('2019-01-01', '2020-01-01', freq='MS', tz=tz) | ||||||
cbar.set_ticks(ticks=times_ticks.dayofyear, labels=[], minor=False) | ||||||
cbar.set_ticks(ticks=times_ticks.dayofyear+15, | ||||||
labels=times_ticks.strftime('%b'), | ||||||
minor=True) | ||||||
cbar.ax.tick_params(which='minor', width=0) | ||||||
|
||||||
for hour in np.unique(solpos.index.hour): | ||||||
# choose label position by the largest elevation for each hour | ||||||
|
@@ -128,8 +142,10 @@ | |||||
label = date.strftime('%Y-%m-%d') | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest you also do that in the previous figure There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find it very annoying that I can't comment on lines that have not been changed... I guess this is a GitHub thing though! Anyway, maybe also modify the text to say that ".... The |
||||||
ax.plot(solpos.azimuth, solpos.apparent_elevation, label=label) | ||||||
|
||||||
ax.figure.legend(loc='upper left') | ||||||
ax.figure.legend(loc='upper center', bbox_to_anchor=[0.45, 1], ncols=3) | ||||||
ax.set_xlabel('Solar Azimuth (degrees)') | ||||||
ax.set_ylabel('Solar Elevation (degrees)') | ||||||
ax.set_xticks([0, 90, 180, 270, 360]) | ||||||
ax.set_ylim(0, None) | ||||||
|
||||||
plt.show() |
Uh oh!
There was an error while loading. Please reload this page.