-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow kwarg passing to plotting functions. #379
Comments
All good - you can set the import glob
template_names = glob.glob('templates/template*.ms')
from eqcorrscan.utils.plotting import cumulative_detections
outfig = cumulative_detections(
detections=detections, template_names=template_names,
plot_grouped=True, plot_legend=True, title='Detections 16-01-18 to 22-02-18',
save=False, rate=True, return_figure=True, show=False)
ax = outfig.gca()
ax.set_xlabel('Dates from January 16 2018')
outfig.show() should work for you. I have never known how to update a plot after you have shown it. |
Ok Great. Thanks Calum. On a related note, the histogram color is fixed to darkgrey in the source code. Do you happen to know about a quick and easy way to edit the color of the histogram bins from darkgrey, to say, red? Cheers. |
Ugh, so it is - that needs to be changed. I'm afraid I don't know how you can do that after the fact. I will leave this open to remind me to pass kwargs through to the plots for cumulative-plotting. |
Ok cool. Yeah it's not a big deal, I really appreciate your help and responsiveness. Cheers, |
What do you need help with?
This is probably not an eqcorrscan-specific issue, but rather an issue with my lack of experience with matplotlib. I return a matplotlib figure object, which is attached, and I'm trying to modify the matplotlib figure to change the color and x/y labels. I get the current axes, and modify the axes, but when I try to show the figure again, the figure, 'outfig' does not update. I'm probably missing one small thing in the code, but I just can't pinpoint what it is! The code and outfig is provided below. Thank you for your help!
EDIT: Sorry, I just have to save the figure - re-plotting outfig.show() doesn't automatically update the figure. Apologies for the stupid issue being raised!
Provide an example so that we can reproduce your problem
The text was updated successfully, but these errors were encountered: