change visuals of the plot
Goddysen opened this issue · 4 comments
THE CODE ARE LISTED AS FOLLOWS:
fig, ax = plot_extremes(
ts=series,
extremes=extremes,
extremes_method="BM",
extremes_type="high",
block_size="365.2425D",
figsize=(10, 4),
ax={"lines.color":"green","font.size": 12,"axes.linewidth": 0.8 }
)
THE ERROR ARE LISTED:
TypeError: invalid type in <class 'dict'> for the 'ax' argument, must be matplotlib Axes object
what is the right form for the argument "ax" and how to change it
Thanks
@Goddysen this is not a bug, the ax
argument should be used only when you have an existing matplotlib Axes
object onto which you want to draw the plot. Example in EVA
:
pyextremes/src/pyextremes/eva.py
Lines 1409 to 1435 in 662a9bf
For what you want you shouldn't use the ax
argument and instead use the ax
object you create and edit its children. You can do something like this:
fig, ax = plot_extremes(
ts=series,
extremes=extremes,
extremes_method="BM",
extremes_type="high",
block_size="365.2425D",
figsize=(10, 4),
)
for line in ax.get_lines():
line.set_color("green")
I suggest you read this stackoverflow post and matplotlib axes documentation.
I got your point! Thank you very much for your answer!
about the plot_corner() function
HELLOW!
THE CODE USED IN JUPYTER ARE LISTED AS FOLLOWS:
fig_4, ax_4 = plot_corner(
trace=model_1.trace,
trace_map=model_1.trace_map,
burn_in=50,
labels=[r"Shape,
levels=5,
)
ax_4[0][0] #IT DISPLAY xlabel='Shape, ylabel='Scale,
ax_4[1][0] #IT DISPLAY xlabel='Shape, ylabel='Scale, AGAIN
ax_4[2][0] #IT DISPLAY xlabel='Shape,, ylabel='Scale AGAIN
WHAT'S THE ORDER OF THESE PLOT (AXES) IN LIST?
Thanks!Looking forward to your answer
@Goddysen thank you for pointing this out, this is a genuine bug. Was easy to fix. New pyextremes version should appear on PyPI today and conda tomorrow.
Once you get new version (2.2.4) the axes are located left-to-right and top-to-bottom: e.g. left upper corner is [0][0] and right bottom corner is [2][2] or [-1][-1].