Coder Social home page Coder Social logo

change visuals of the plot about pyextremes HOT 4 CLOSED

georgebv avatar georgebv commented on July 18, 2024
change visuals of the plot

from pyextremes.

Comments (4)

georgebv avatar georgebv commented on July 18, 2024

@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:

fig = plt.figure(figsize=figsize, dpi=96)
# Create gridspec
gs = matplotlib.gridspec.GridSpec(
nrows=2,
ncols=2,
wspace=0.3,
hspace=0.3,
width_ratios=[1, 1],
height_ratios=[1, 1],
)
# Create axes
ax_rv = fig.add_subplot(gs[0, 0])
ax_pdf = fig.add_subplot(gs[0, 1])
ax_qq = fig.add_subplot(gs[1, 0])
ax_pp = fig.add_subplot(gs[1, 1])
# Plot return values
self.plot_return_values(
return_period=return_period,
return_period_size=return_period_size,
alpha=alpha,
plotting_position=plotting_position,
ax=ax_rv,
**kwargs,
)

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.

from pyextremes.

Goddysen avatar Goddysen commented on July 18, 2024

I got your point! Thank you very much for your answer!

from pyextremes.

Goddysen avatar Goddysen commented on July 18, 2024

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, $\xi$", r"Location, $\mu$", r"Scale, $\sigma$"],
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?

Q2IU$782 M@C%{SU0S Q8EG

Thanks!Looking forward to your answer

from pyextremes.

georgebv avatar georgebv commented on July 18, 2024

@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].

from pyextremes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.