Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Luke Davis
    @lukelbd
    For some reason "gitter.im/proplot" was taken. Anyway thought this would be useful for more casual discussion & questions
    Luke Davis
    @lukelbd
    I'm thinking of changing the default font from DejaVu Sans to one of the other open-source fonts synced with proplot. Anyone have any opinions? (Right now, default behavior is to try to use Helvetica or Arial if they are installed; I can't sync them due to copyright).
    This will affect the examples in the online documentation becuase the RTD server does not have any fonts installed
    Andrzej Novak
    @andrzejnovak
    There is a very good open lookalike for Helvetica called Tex Gyre Heros, I'm serving it with mplhep
    Sad thing is it doesn't have a complete set of math characters, which is an issue for any sans serif fonts if you want a consistent look. https://github.com/firamath/firamath is the best answer to that if you can accept that it's not quite Helvetica
    Luke Davis
    @lukelbd
    Screen Shot 2020-01-05 at 5.27.53 PM.png
    Luke Davis
    @lukelbd
    Thanks for the links (see above comparison)! Between TeX Gyre Heros and Fira Math I'm inclined to pick the former. Since one of proplot's goals is "aesthetically pleasing figures" I think it's appropriate to choose a more classic-looking font family as the default font, even though the fontset is limited, then advice people to switch to DejaVu Sans or Fira Math if they need fancy mathematical formulas. I'll go into more detail in the Colors and fonts section.
    Luke Davis
    @lukelbd
    It's a tough decision though... could still be convinced. Not sure what percentage of matplotlib users use formulas complicated enough to trigger CM-fallback.
    Andrzej Novak
    @andrzejnovak
    Yeah, I pretty much agree with you. I wish the math fallback font was configurable. Having Tex gyre Heros fallback to fira math is probably the best option given available fonts
    Luke Davis
    @lukelbd

    The new open-source default (used on RTD) is TeX Gyre Heros. The full preference list is mostly copied from the matplotlib defaults, with Helvetica and Arial moved to the front / DejaVu Sans moved to the back (I do the same for 'font.serif' and 'font.monospace'):

    rcParams['font.sans-serif'] = ['Helvetica',
     'Arial',
     'Lucida Grande',
     'Verdana',
     'Geneva',
     'Lucid',
     'Avant Garde',
     'TeX Gyre Heros',
     'DejaVu Sans',
     'Bitstream Vera Sans',
     'Computer Modern Sans Serif',
     'sans-serif']

    Details are in the fonts docs. The show_fonts display makes it very clear which glyphs are unavailable by disabling a new figure-specific fallback_to_cm option / inserting a dummy character.

    I also hide the mathtext logger warnings (mathtext._log.setLevel(logging.ERROR)) when a glyph is unavailable; otherwise we get like 1000 lines of warnings. However permanently hiding these warnings is probably not the best approach..... would prefer to just emit these warnings with warnings.warn rather than a logger, that way show_fonts can temporarily hide them with a filter and users don't get bombarded with duplicate messages. Will add a monkey patch and submit a matplotlib PR.

    Luke Davis
    @lukelbd
    Note I tend to prefer monkey patches just because I can submit a new proplot release that same day, vs. waiting months for the next matplotlib release... but probably the best approach is to do both :) (in fact there are several minimal, self-contained proplot features that could be added to matplotlib, but that's a whole other discussion.... may get into this more next summer). So far proplot has just ~3 patches and they are all fairly conservative; I only do this if it is absolutely necessary.
    hannah
    @story645
    @lukelbd Matplotlib is participating in gsoc this year, would you be interested in submitting a proposal of the type of work you'd be interested in contributing back to mpl?
    Luke Davis
    @lukelbd
    Unfortunately I don't think I can commit to 3 months of 100% coding, as I'm still working on my PhD :). But I'll post to the matplotlib gitter soon and share some thoughts in a "ProPlot and matplotlib" page on my website. After version 1 is released and the refactor PRs are merged, if people are interested, I'd love to turn this into a more community-driven effort that can (1) coexist alongside matplotlib and (2) be partly incoporated into matplotlib in the long term.
    hannah
    @story645
    that sounds cool
    Pratiman
    @pratiman-91
    Hi all, This is Pratiman, I have been using ProPlot quite some time. I would like to contribute to the project. However, I am a beginner in GitHub and do not have a lot of experience in open source projects. It would be great if you can help me with getting started with the contribution to your project. Any suggestions are welcome. Thank you
    Riley Brady
    @bradyrx
    pinging @lukelbd, not sure if you get notifications for this!
    Hi Pratiman! That’s wonderful. I don’t know proplot’s code base too well, but generally for open source you want to look through the issues (https://github.com/lukelbd/proplot/issues) and see if there’s any task that sticks out as something you want to do. You can reply to that issue and say you’re planning on addressing it. Then you want to follow the steps under the “preparing pull requests” guide here: https://proplot.readthedocs.io/en/latest/contributions.html.
    A pull request is your change/addition to the code base, but it doesn’t affect the main code base until it’s reviewed. So it gets open for public review and then people like Luke can give you tips and feedback. Then you keep working back and forth until it’s ready to get merged into the main code base.
    Pratiman
    @pratiman-91
    Thanks a lot for your answers. Maybe I can try it once.
    Jochem Smit
    @Jhsmit
    Hi, is there a way of using the normal matplotlib contour function when I used proplot to make the axes? I get an error about the wrong shape of Z and the shape was correct for the standard beheviour
    (awesome library by the way I've went through some extreme pains in the past to match figure size and subplots with correct aspect ratios i want, arrggh!)
    Jochem Smit
    @Jhsmit
    Ok i figured it out, something was getting messed up because i passed levels as a positional argument :)
    Riley Brady
    @bradyrx
    Glad it worked out!
    Pratiman
    @pratiman-91
    @bradyrx I have been trying to make some contributions. I did make a fix for #234 . Let me know if this is the correct way to do it. Thanks!
    Riley Brady
    @bradyrx
    Hi @pratiman-91 , thanks for the notification! Glad you are getting into contributing. I don’t know proplot’s code base too well, just the API and serve more as an evangelist ;) You’ll want to tag @lukelbd to get his attention or shoot Luke Davis an email (https://www.atmos.colostate.edu/people/directory). I think he’s plenty busy with his graduate work but it looks like a small PR and good fix so I’m sure he could give it a quick look!
    Pratiman
    @pratiman-91
    Thanks. I will do that.
    Till Stensitzki
    @Tillsten
    Hi, first of all proplot is really awesome, it replaces a lot of my own helper functions
    still a question, if I am using ax.format(yloc='right) i loose the spine on the left.
    Adding yspineloc='left' does not fix it
    Jochem Smit
    @Jhsmit
    Hi, I'm trying to make a colorbar without using a mappable, using the 'jet' cmap and values from 0 to 100. I've tried to to this:
    cmap = mpl.cm.get_cmap('jet')
    fig.colorbar(cmap, values=np.linspace(0, 100, 100, endpoint=True), norm_kw={'vmin':0, 'vmax': 100})
    but the color bar this gives me is from 0 to 1. Any suggestions?
    Jochem Smit
    @Jhsmit
    Pratiman
    @pratiman-91
    Hi, it seems like proplot is broken for matplotlib > 3.4. #248 I tried to fix it but could not.