Changeset 3824 for trunk/LMDZ.MARS/util
- Timestamp:
- Jul 2, 2025, 2:58:14 PM (9 days ago)
- Location:
- trunk/LMDZ.MARS/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/util/display_netcdf.py
r3818 r3824 210 210 linewidth=0.5 211 211 ) 212 #gl.top_labels = False213 #gl.right_labels = False214 212 215 213 # Plot data in PlateCarree projection … … 229 227 label = varname + (f" ({units})" if units else "") 230 228 cbar.set_label(label) 231 ax.set_title(f"{varname} — {pole.capitalize()} Pole", pad=50)229 ax.set_title(f"{varname} — {pole.capitalize()} polar region", pad=20, y=1.05, fontsize=12, fontweight='bold') 232 230 233 231 figs.append(fig) … … 362 360 363 361 # Create plotter 364 plotter = Plotter(title="3D topographyview", bg="bb", axes=0)362 plotter = Plotter(title="3D globe view", bg="bb", axes=0) 365 363 366 364 # Configure camera … … 409 407 plt.xlabel(time_var or "Time Index") 410 408 plt.ylabel(varname + (f" ({var.units})" if hasattr(var, "units") else "")) 411 plt.title(f"{varname} vs {time_var or 'Index'}" )409 plt.title(f"{varname} vs {time_var or 'Index'}", fontweight='bold') 412 410 if output_path: 413 411 plt.savefig(output_path, bbox_inches="tight") … … 442 440 cbar = plt.colorbar() 443 441 cbar.set_label(varname + (f" ({var.units})" if hasattr(var, "units") else "")) 444 plt.title(f"{varname} averaged over latitude" )442 plt.title(f"{varname} averaged over latitude", fontweight='bold') 445 443 if output_path: 446 444 plt.savefig(output_path, bbox_inches="tight") … … 564 562 cbar = fig.colorbar(cf, ax=ax, pad=0.02) 565 563 cbar.set_label(varname + (f" ({var.units})" if hasattr(var, "units") else "")) 566 ax.set_title(f"{varname} (interpolated map over physical_points)" )564 ax.set_title(f"{varname} (interpolated map over physical_points)", fontweight='bold') 567 565 ax.set_xlabel(f"Longitude ({getattr(dataset.variables[lonv], 'units', 'deg')})") 568 566 ax.set_ylabel(f"Latitude ({getattr(dataset.variables[latv], 'units', 'deg')})") … … 600 598 plt.xlabel(varname + (f" ({var.units})" if hasattr(var, "units") else "")) 601 599 plt.ylabel(coord + (f" ({dataset.variables[coord].units})" if hasattr(dataset.variables[coord], "units") else "")) 602 plt.title(f"{varname} vs {coord}" )600 plt.title(f"{varname} vs {coord}", fontweight='bold') 603 601 if output_path: 604 602 plt.savefig(output_path, bbox_inches="tight") … … 612 610 plt.xlabel("Index") 613 611 plt.ylabel(varname + (f" ({var.units})" if hasattr(var, "units") else "")) 614 plt.title(f"{varname} (1D)" )612 plt.title(f"{varname} (1D)", fontweight='bold') 615 613 if output_path: 616 614 plt.savefig(output_path, bbox_inches="tight") … … 620 618 return 621 619 622 #if dslice.ndim == 2:620 if dslice.ndim == 2: 623 621 lat_idx2 = find_dim_index(dims, LAT_DIMS) 624 622 lon_idx2 = find_dim_index(dims, LON_DIMS) … … 630 628 lats = dataset.variables[latv][:] 631 629 lons = dataset.variables[lonv][:] 630 631 # Correct latitudes order 632 if lats[0] > lats[-1]: 633 lats = lats[::-1] 634 dslice = np.flipud(dslice) 632 635 633 636 # Handle masked arrays … … 675 678 cbar.set_label(varname + (f" ({dataset.variables[varname].units})" 676 679 if hasattr(dataset.variables[varname], "units") else "")) 677 ax.set_title(f"{varname} (lat × lon)" )680 ax.set_title(f"{varname} (lat × lon)", fontweight='bold') 678 681 ax.set_xlabel(f"Longitude ({getattr(dataset.variables[lonv], 'units', 'deg')})") 679 682 ax.set_ylabel(f"Latitude ({getattr(dataset.variables[latv], 'units', 'deg')})") … … 702 705 plt.xlabel("Dim 2 index") 703 706 plt.ylabel("Dim 1 index") 704 plt.title(f"{varname} (2D)" )707 plt.title(f"{varname} (2D)", fontweight='bold') 705 708 if output_path: 706 709 plt.savefig(output_path, bbox_inches="tight") … … 891 894 plt.xlabel(time_var or "Time Index") 892 895 plt.ylabel(varname + (f" ({var_obj.units})" if hasattr(var_obj, "units") else "")) 893 plt.title(f"{varname} vs {time_var or 'Index'}" )896 plt.title(f"{varname} vs {time_var or 'Index'}", fontweight='bold') 894 897 if output_path: 895 898 plt.savefig(output_path, bbox_inches="tight") -
trunk/LMDZ.MARS/util/display_netcdf.yml
r3818 r3824 163 163 - mpg123=1.32.9=hc50e24c_0 164 164 - msgpack-python=1.1.1=py312h68727a3_0 165 - multidict=6.6. 2=py312h178313f_0165 - multidict=6.6.3=py312h178313f_0 166 166 - munkres=1.1.4=pyhd8ed1ab_1 167 167 - ncurses=6.5=h2d0b736_3 168 168 - netcdf4=1.7.2=nompi_py312h3805cb1_102 169 169 - nlohmann_json=3.12.0=h3f2d84a_0 170 - numpy=2.3. 0=py312h6cf2f7f_0170 - numpy=2.3.1=py312h6cf2f7f_0 171 171 - ocl-icd=2.3.3=hb9d3cd8_0 172 172 - opencl-headers=2025.06.13=h5888daf_0 … … 174 174 - openjpeg=2.5.3=h5fbd93e_0 175 175 - openldap=2.6.10=he970967_0 176 - openssl=3.5. 0=h7b32b05_1176 - openssl=3.5.1=h7b32b05_0 177 177 - packaging=25.0=pyh29332c3_1 178 178 - pandas=2.3.0=py312hf9745cd_0
Note: See TracChangeset
for help on using the changeset viewer.