Skip to content

Commit

Permalink
Will now create Figures directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
filipinascimento committed Feb 18, 2021
1 parent 952a9f2 commit b9d65e8
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions Notebooks/DrawMaps.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"import numpy as np\n",
"import geopandas as gpd\n",
"from scipy.sparse import coo_matrix,csr_matrix,save_npz,load_npz\n",
"%matplotlib widget\n",
"%matplotlib inline\n",
"from IPython.display import set_matplotlib_formats\n",
"set_matplotlib_formats('retina')\n",
"import os\n",
Expand All @@ -37,7 +37,8 @@
"import matplotlib.ticker as ticker\n",
"from collections import Counter\n",
"import matplotlib.patches as mpatches\n",
"import matplotlib as mpl"
"import matplotlib as mpl\n",
"os.makedirs(\"../Figures/\", exist_ok=True)"
]
},
{
Expand Down Expand Up @@ -271,8 +272,8 @@
" # ax.set_extent([-30, 150, -70, 70])\n",
" # ax.stock_img()\n",
" ax.set_global()\n",
" if(not useCircular):\n",
" ax.set_extent([-30, 150, -70, 70])\n",
"# if(not useCircular):\n",
"# ax.set_extent([-30, 150, -70, 70])\n",
" ax.add_feature(cfeature.LAND,facecolor='gray',alpha=1.0)\n",
" ax.add_feature(cfeature.OCEAN,facecolor=(0.7,0.7,0.7),alpha=1.0)\n",
" # ax.add_feature(cfeature.OCEAN)\n",
Expand All @@ -294,7 +295,7 @@
" lw=0.1,\n",
" ec=(0.1,0.1,0.1,1.0)))\n",
" if(name):\n",
" ax.text((region[3]+region[2])*0.5, (region[1]), name,horizontalalignment='center',verticalalignment='bottom', transform=ccrs.Geodetic(),zorder=6)\n",
" ax.text((region[3]+region[2])*0.5, (region[0]+region[1])*0.5, name,horizontalalignment='center',verticalalignment='center', transform=ccrs.Geodetic(),zorder=6)\n",
" \n",
" \n",
" norm = mpl.colors.Normalize(vmin=maxPositivePValue, vmax=np.log10(thresholdCorrelation))\n",
Expand Down Expand Up @@ -341,7 +342,7 @@
" \n",
" print(maxPositivePValue);\n",
" if(exportName):\n",
" fig.savefig(\"Figures/\"+exportName+\".pdf\");\n",
" fig.savefig(\"../Figures/\"+exportName+\".pdf\");\n",
" plt.show()\n",
"\n",
" fig, ax = plt.subplots(figsize=(6, 1))\n",
Expand Down Expand Up @@ -376,7 +377,7 @@
" format=ticker.FuncFormatter(fmt))\n",
" \n",
" if(exportName):\n",
" plt.savefig(\"Figures/cm_%s.pdf\"%exportName)\n",
" plt.savefig(\"../Figures/cm_%s.pdf\"%exportName)\n",
" fig.show()\n"
]
},
Expand All @@ -388,7 +389,7 @@
"source": [
"import warnings\n",
"warnings.filterwarnings(\"ignore\")\n",
"\n",
"# use the name ofthe file\n",
"plotConfigs = [\n",
"# (\"LaggedCorrelation\",0,None),\n",
"# (\"LaggedCorrelation\",30,None),\n",
Expand All @@ -411,17 +412,17 @@
" extraEpsilonFactor = 0.5,\n",
" min_samples = 5,\n",
" min_points = 30,\n",
"# exportName=\"region_%s_d%d_l%d_v3_complete\"%(propertyName,windowDays,maxLag),\n",
" exportName=\"region_%s_d%d_l%d_v3_complete\"%(propertyName,windowDays,maxLag),\n",
" maxPositivePValue=maxPositivePValue,\n",
" );"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:climate]",
"display_name": "Python [conda env:teleconnectionsgranger]",
"language": "python",
"name": "conda-env-climate-py"
"name": "conda-env-teleconnectionsgranger-py"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -433,7 +434,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
"version": "3.8.6"
}
},
"nbformat": 4,
Expand Down

0 comments on commit b9d65e8

Please sign in to comment.