Skip to content

Commit

Permalink
[UPDATE] update plots
Browse files Browse the repository at this point in the history
  • Loading branch information
hollydinkel committed Aug 19, 2024
1 parent 6d57b8c commit 413821f
Show file tree
Hide file tree
Showing 20 changed files with 92 additions and 78 deletions.
Binary file modified images/asset_turnover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ebitda.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ebitda_separate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/financial_leverage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/fraction_constellation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/gom_isp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/iqps_isp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/kleos_isp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/npm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/planet_isp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/revenue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/revenue_separate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/roe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/satellogic_isp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/total_asset_growth_rate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/total_equity_growth_rate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/total_liabilities_growth_rate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/total_satellites.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 8 additions & 5 deletions src/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,30 @@ def plotKPIs(fig, ax, data, key, companyMetadata, company, ylabel):
ax.plot(data["Quarter"], data[key], color=company_color, linestyle=companyMetadata[company]["style"], label=company, linewidth=10)
ax.legend(ncol=3, bbox_to_anchor=(0.9, -0.15), fancybox=True, title="Company", fontsize='16', frameon=True)
ax.set_xlim([pd.to_datetime('2018-06-01'), pd.to_datetime('2024-12-31')])
if ylabel=="Revenue ($USD)":
ax.set_yscale('log')
ax.set_ylim([1, 10**9])
fig.tight_layout()
box = ax.get_position()
ax.set_position([box.x0, box.y0 + box.height * 0.2, box.width, box.height * 0.8])
plt.rcParams['legend.title_fontsize'] = '16'
return fig

def plotPredictions(fig, ax, company, companyMetadata, time=None, inSamplePrediction=None, outSamplePrediction=None, ground_truth=None, split=None, plotEverything=False):
def plotPredictions(fig, ax, company, companyMetadata, time=None, inSamplePrediction=None, outSamplePrediction=None, ground_truth=None, ylabel=None, split=None, plotEverything=False):
size = 22
if company != "Synspective" and not plotEverything:
company_color = np.array(companyMetadata[company]["color"]) / 255
ax.set_title(company, fontsize=16, fontweight='bold')
ax.tick_params(axis='both', which='major', labelsize=16)
ax.set_xlabel('Year', fontsize=16)
ax.set_ylabel('Revenue ($ USD)', fontsize=16)
ax.set_ylabel(ylabel, fontsize=16)
ax.xaxis.set_major_locator(ticker.MaxNLocator(nbins=5))
ax.yaxis.set_major_locator(ticker.MaxNLocator(nbins=5))
ax.set_xlim([pd.to_datetime('2018-06-01'), pd.to_datetime('2024-12-31')])
ax.plot(time[:-split], inSamplePrediction, color=company_color, linestyle="dotted", label="In-Sample Prediction", linewidth=10)
ax.plot(time[-split:], outSamplePrediction, color=company_color, alpha=0.5, linestyle="dashed", label="Out-of-Sample Prediction", linewidth=10)
ax.plot(time, ground_truth, color=company_color, linestyle="solid", label="Ground Truth", linewidth=10)
ax.legend(ncol=2, bbox_to_anchor=(0.85, -0.15), fancybox=True, fontsize='16', frameon=True)
ax.legend(ncol=3, bbox_to_anchor=(1.0, -0.15), fancybox=True, fontsize='14', frameon=True)
box = ax.get_position()
ax.set_position([box.x0, box.y0 + box.height * 0.2, box.width, box.height * 0.8])
elif company!= "Synspective" and plotEverything:
Expand Down Expand Up @@ -77,6 +80,6 @@ def plotPredictions(fig, ax, company, companyMetadata, time=None, inSamplePredic
line2, = ax.plot([], [], color='k', linestyle="dashed", alpha=0.5, linewidth=12, label='Out-of-Sample Prediction')
line3, = ax.plot([], [], color='k', linestyle="solid", linewidth=12, label='Ground Truth Data')
# Add the legend with specified labels
fig.legend([line1, line2, line3], ['In-Sample Prediction', 'Out-of-Sample Prediction', 'Ground Truth Data'],
loc='upper center', bbox_to_anchor=(0.5, 0.08), ncol=2, prop={'size': size})
fig.legend([line1, line2, line3], ['In-Sam1le Prediction', 'Out-of-Sample Prediction', 'Ground Truth Data'],
loc='upper center', bbox_to_anchor=(0.5, 0.08), ncol=3, prop={'size': size})
return fig
157 changes: 84 additions & 73 deletions src/process.py

Large diffs are not rendered by default.

0 comments on commit 413821f

Please sign in to comment.