azogue / psychrochart

A Python 3 library to make psychrometric charts and overlay information on them.
MIT License
100 stars 26 forks source link

could not see any chart at all, any idea why that could be? #1

Closed maajdl closed 6 years ago

maajdl commented 6 years ago

Hello,

Looks like a very nice package. Unfortunately, I was unable to get any picture. I tried mainly in Jupyter, but also in Spyder. In Jupyter, I tried the "Usage example of psychrochart" notebook. I also tried snippets from README.md in various combinations without any success. I also checked that for example chart_default contained data, and I saw the many curves calculated. Clearly only the rendering is not working for me.

Would you have an idea why that could be?

Thanks,

Michel

PS: I checked that matplotlib is working on some simple examples.

maajdl commented 6 years ago

Hello, I just discovered that this snippet below displays the ashrae chart, but not the default. If I remove the three last lines, then the default chart is displayed. I also tried to use the show() method without success. Probably I miss some understanding about matplotlib.

Thanks for your suggestions,

Michel

%matplotlib inline import matplotlib from psychrochart.chart import PsychroChart from psychrochart.util import load_config chart_default = PsychroChart() chart_default.plot() chart_default._fig chart_ashrae_style = PsychroChart('ashrae') chart_ashrae_style.plot() chart_ashrae_style._fig

JamesAWright commented 6 years ago

I would also like to ask about the plots not showing :) Any suggestions?

James

JamesAWright commented 6 years ago

In case anyone is still following this issue, I managed to get the chart to show by modifying the code to accept an axis object defined outside of the scope of the PsychroChart class. I'm not sure exactly what the problem was as the code looked fine, but this is a quick hack to get the chart out...

prathamesh-nachane commented 6 years ago

Could you please guide me as to how you did it? JamesAWright? You can share your files to me as well at prathamesh.nachane@gmail.com

azogue commented 6 years ago

I'm so sorry for ignoring this issue that long (I didn't have notifications from this package, so I didn't 'heard' them...

@pnahcane has contacted me today about that, and, as result, a little change has been done to pass an Axes object to the plotting function. If you're still interested, please try again

The objective of this module was to make the charts in the background (to save them as SVG files), so showing them was somewhat a hack, you're right @JamesAWright

azogue commented 6 years ago

Closing this, as it should be working now like that:

from psychrochart.chart import PsychroChart
import matplotlib.pyplot as plt

PsychroChart().plot(ax=plt.gca())
plt.show()
jeremy-rutman commented 3 years ago

I'm still a bit mysitified about scripting plots - when I script the last example (with overlays) in the .ipynb notebook , taking the last few lines: If I do :

# Add a legend
chart.plot_legend(markerscale=.7, frameon=False, fontsize=10, labelspacing=1.2)
ax.get_figure()

I add

chart.plot(ax=plt.gca())
plt.legend()
plt.show()

and I wind up seeing the plot with legend, but without the constant enthalpy lines that this example draws in the notebook. Since overlays are what I needed this for that's a bummer. On the other hand the notebook version works fine so I can just work fromthere I guess. I would prefer running scripts from pycharm however

prathamesh-nachane commented 3 years ago

Hello,

Thanks for reaching out. Could you please send photos/ snip.

The code is a bit old and will not work in latest ipyton script. It needs to run as a batch file. I can try to help you if you send snip. Thanks.

On Wed, Nov 4, 2020, 1:13 PM jeremy rutman notifications@github.com wrote:

I'm still a bit mysitified when I script the last example in the .ipynb notebook : If I do :

Add a legend

chart.plot_legend(markerscale=.7, frameon=False, fontsize=10, labelspacing=1.2) ax.get_figure() chart.plot(ax=plt.gca()) plt.legend() plt.show()

I wind up seeing the plot with legend, but without the constant enthalpy lines that this example draws.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/azogue/psychrochart/issues/1#issuecomment-721921601, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJLYDHIMN6PI5T2AQ4P4FEDSOGRWVANCNFSM4DWGT6CA .