SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Søren N. <sor...@gm...> - 2009年02月27日 09:27:02
Hi,
When I save a plot using the toolbar save function, and I save to a
different directory than the one where my program is, my program can no
longer locate the icons (used in my GUI) that I am using in my .\ressources
directory. So saving the plot changed the working directory of my program?
How do I change it back? Isn't this an error in matplotlib?
Thanks
Soren
From: Michael D. <md...@st...> - 2009年02月27日 13:44:02
Which backend are you using? I don't see any explicit calls to chdir in 
matplotlib that would make this happen. It would certainly be 
unintentional if it is.
Mike
Søren Nielsen wrote:
> Hi,
>
> When I save a plot using the toolbar save function, and I save to a 
> different directory than the one where my program is, my program can 
> no longer locate the icons (used in my GUI) that I am using in my 
> .\ressources directory. So saving the plot changed the working 
> directory of my program?
>
> How do I change it back? Isn't this an error in matplotlib?
>
> Thanks
> Soren
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a 600ドル discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Christopher B. <Chr...@no...> - 2009年02月27日 17:30:34
Michael Droettboom wrote:
> Which backend are you using? I don't see any explicit calls to chdir in 
> matplotlib that would make this happen. It would certainly be 
> unintentional if it is.
I don't know about any other back-ends, but the wx FileDialog has an 
option to change the working dir when the user selects a file I also 
don't know if this flag is set in the MPL code, but it shouldn't be.
> Søren Nielsen wrote:
>> my program can 
>> no longer locate the icons (used in my GUI) that I am using in my 
>> .\ressources directory. So saving the plot changed the working 
>> directory of my program?
>> How do I change it back? Isn't this an error in matplotlib?
I'd say yes, but it's also an error in the design of your code -- as 
you've discovered, the working dir is a tenuous concept -- you should 
set that resources dir in your code start-up and keep it around for when 
you need it.
wxPython has wx.StandardPaths which can be helpful for finding your aps 
data, etc -- I'm sure the other toolkits have something, too.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /