Hi Erik,
What version of Matplotlib are you using? Please type:
conda list matplotlib
and paste the output in your reply.
Also, what operating system are you on?
Best,
Mike
PS: Pasting the traceback was good. This really helped to understand what
happened. But the line breaks were gone. Everything was one long line.
Maybe you can find a way to keep the line breaks when pasting. This would
help considerable to read and understand the pasted text. One way could be
to past the text in an editor first and then do another copy-paste from
the editor into your message. But a one-line traceback is much better than
none. ;)
Am 26.04.24 um 00:49 schrieb Erik Guldbech:
> Hi,
>
> While using the depth_time_contour function to plot temperature, the
> following error is generated. A plot is generated; however, the legend is
> missing. Running python 3.9.19 with Pitlakq 1.7.3.
>
> Thanks, Erik
>
> ---------------------------------------------------------------------------
> AttributeError Traceback (most recent call last) Cell In[17], line 4 2 #
> (nc_out, species, location, tar, time_slot, show_ice, save, show,
> no_show_below, lower_border, show_water_level, upper_border) 3
> species=[{"name": "t2", "levels": "auto"}] ----> 4
> depth_time_contour.main(out_dir+"/
out.nc",species=species,location=9) File
> ~\.conda\envs\pitlakq310\lib\site-packages\pitlakq\postprocessing\depth_time_contour.py:595
> <
http://localhost:8889/lab/tree/pitlakq_work/models/Berkeley_Pit_Project/Python_processing/~/.conda/envs/pitlakq310/lib/site-packages/pitlakq/postprocessing/depth_time_contour.py#line=594>,
> in main(nc_out, species, location, tar, time_slot, show_ice, save, show,
> no_show_below, lower_border, show_water_level, upper_border) 593
> contour.read_data() 594 if show: --> 595 contour.show() 596 if save: 597
> contour.save_figure() File
> ~\.conda\envs\pitlakq310\lib\site-packages\pitlakq\postprocessing\depth_time_contour.py:321
> <
http://localhost:8889/lab/tree/pitlakq_work/models/Berkeley_Pit_Project/Python_processing/~/.conda/envs/pitlakq310/lib/site-packages/pitlakq/postprocessing/depth_time_contour.py#line=320>,
> in Contour.show(self) 319 print(name) 320 if name not in self._figures: -->
> 321 fig = self._draw(specie) 322 self._figures[name] = fig 323 fig =
> self._figures[name] File
> ~\.conda\envs\pitlakq310\lib\site-packages\pitlakq\postprocessing\depth_time_contour.py:382
> <
http://localhost:8889/lab/tree/pitlakq_work/models/Berkeley_Pit_Project/Python_processing/~/.conda/envs/pitlakq310/lib/site-packages/pitlakq/postprocessing/depth_time_contour.py#line=381>,
> in Contour._draw(self, specie) 380 zcoord = self.zcoord[::-1][:] 381 for
> axis_name in all_axies: --> 382 cont =
> self._draw_subplot(all_axies[axis_name],titles[axis_name], 383
> data[axis_name],zcoord,levels,cmap, 384 set_label[axis_name]) 385
> plt.subplots_adjust(bottom=XAXIS['bottom'], right=0.8, top=0.9) 386 cax =
> plt.axes([0.85, 0.1, 0.03, 0.8]) File
> ~\.conda\envs\pitlakq310\lib\site-packages\pitlakq\postprocessing\depth_time_contour.py:435
> <
http://localhost:8889/lab/tree/pitlakq_work/models/Berkeley_Pit_Project/Python_processing/~/.conda/envs/pitlakq310/lib/site-packages/pitlakq/postprocessing/depth_time_contour.py#line=434>,
> in Contour._draw_subplot(self, axis, title, data, zcoord, levels, cmap,
> set_label) 433 axis.xaxis.set_major_formatter(plt.FixedFormatter([])) 434
> for tick in axis.xaxis.majorTicks: --> 435 tick.label._rotation =
> XAXIS['rotation'] 436 tick.label._fontproperties = FontProperties( 437
> size=XAXIS['font_size']) 438 text = PROJECT['description'] AttributeError:
> 'XTick' object has no attribute 'label'
>
> Screenshot 2024-04-25 162011.png
>
> -- You received this message because you are subscribed to the Google Groups
> "pitlakq-users" group. To unsubscribe from this group and stop receiving
> emails from it, send an email to
pitlakq-user...@googlegroups.com
> <mailto:
pitlakq-user...@googlegroups.com>. To view this
> discussion on the web visit
>
https://groups.google.com/d/msgid/pitlakq-users/533f7c0f-f63a-4267-b819-6f978ba20588n%40googlegroups.com
> <
https://groups.google.com/d/msgid/pitlakq-users/533f7c0f-f63a-4267-b819-6f978ba20588n%40googlegroups.com?utm_medium=email&utm_source=footer>.