472,805 Members | 2,130 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

dislin interfaced with tkinter

Hi,

I've downloaded the dislin package for the scientific plotting. And I
have already created the application window with Tkinter (menu,
canvas, status bar..). I want to integrate the Dislin plotting into
the Tkinter application. For ex: show the dislin result on the Tkinter
Canvas. Anyone can help?

thx
Jul 18 '05 #1
5 2065
eesun wrote:
I've downloaded the dislin package for the scientific plotting. And I
have already created the application window with Tkinter (menu,
canvas, status bar..). I want to integrate the Dislin plotting into
the Tkinter application. For ex: show the dislin result on the Tkinter
Canvas. Anyone can help?


I believe that dislin plots trough its own graphical device
that is independent of Tkinter thus cannot be integrated
with it.

You might want to try matplotlib, it has Tk backend

http://matplotlib.sourceforge.net/

the nice folks there might be able to help you out.

Istvan.

Jul 18 '05 #2
On 3 Aug 2004, eesun wrote:
I've downloaded the dislin package for the scientific plotting. And I
have already created the application window with Tkinter (menu,
canvas, status bar..). I want to integrate the Dislin plotting into
the Tkinter application. For ex: show the dislin result on the Tkinter
Canvas. Anyone can help?


I don't know anything about dislin; scanning through its web site, it
looks like a commercial C program. The only two ways I can think of to
integrate something like this into a Tkinter (or any toolkit) application
are:

1) If there's a way to pass dislin a window ID in which to draw (it
doesn't look like it; its openwin() function uses internal IDs), you can
create a Frame widget and pass the value returned by its .winfo_id()
method to the library.

2) If you can find no better way, as a last resort you can have dislin
write its output to an image file, and read the file using the Python
Imaging Library (PIL), which is integrated very well into Tkinter (you can
use its ImageTk class to create an image suitable for a Label, Canvas, or
what-have-you).

If your application isn't dependant on dislin and doesn't need 3D
graphing capabilities, consider switching to matplotlib
(http://matplotlib.sf.net/), which provieds the embedability you want.

Jul 18 '05 #3

"eesun" <ee***@free.fr> wrote in message
news:34**************************@posting.google.c om...
Hi,

I've downloaded the dislin package for the scientific plotting. And I
have already created the application window with Tkinter (menu,
canvas, status bar..). I want to integrate the Dislin plotting into
the Tkinter application. For ex: show the dislin result on the Tkinter
Canvas. Anyone can help?

thx


I haven't worked with Dislin/Tkinter but I have worked with Dislin/wxPython
and what you can do is dump the Dislin output into a string buffer.

A shade plot,

def dis_img(self,zmat,m, n, zlo, zhi):
char = ''
max_bytes = 0
xray = range (n)
yray = range (m)
dislin.metafl ('VIRT')
dislin.setpag ('da4l')
#dislin.setfil (self.globdir)
dislin.disini ()
dislin.pagera ()
dislin.hwfont ()
dislin.ax3len (1400, 1400,1400)
dislin.autres(n, m)
dislin.shdmod ('poly', 'contur')
dislin.graf3 (0, n, 0, n/5, 0, m, 0, m/5, zlo, zhi, zlo, (zhi-zlo)/5)
dislin.crvmat (zmat, n, m, 1, 1)
dislin.title ()
char_buff = dislin.rbfpng(max_bytes)
max_bytes = int(char_buff[1])
char_buff = dislin.rbfpng(max_bytes)
char = char_buff[0]
#char now contains a PNG image of the output. I use Python Imaging
Library
#and open like this
self.Imagetest = Image.open(StringIO.StringIO(char))
dislin.disfin ()

Tom
Jul 18 '05 #4
On Tue, 3 Aug 2004, Tom B. wrote:
I haven't worked with Dislin/Tkinter but I have worked with Dislin/wxPython
and what you can do is dump the Dislin output into a string buffer.

[code]


Building on that, the only change needed to use that with Tkinter would be
to convert the Image object into a PhotoImage object using
ImageTk.PhotoImage:

self.Imagetest = ImageTk.PhotoImage(Image.open(StringIO.StringIO(ch ar)))

Jul 18 '05 #5
eesun wrote:
I've downloaded the dislin package for the scientific plotting. And I
have already created the application window with Tkinter (menu,
canvas, status bar..). I want to integrate the Dislin plotting into
the Tkinter application. For ex: show the dislin result on the Tkinter
Canvas. Anyone can help?


There is a package called disipyl which provides a more object oriented
interface to dislin. It includes interfaces to wxPython and Tkinter. It
hasn't been updated in a couple of years, but dislin hasn't changed much in
that time either.

http://kim.bio.upenn.edu/~pmagwene/disipyl.html
Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gaubitzer Erwin | last post by:
Hi everybody I want to recompile the DISLIN graphics module for Python under Linux, because I think it is one of the best graphics libraries at present. The included module was for version 2.0...
1
by: Karin Lagesen | last post by:
I have a lot of data that I am going to plot and put on a web server. Since there is a lot of it, I was planning to script it all using python. I have looked around and it seems to me that dislin...
2
by: Tom Richardson | last post by:
If anyone has any experience using the graphics package DISLIN with Python, I'd appreciate some help. I am trying to use the function tifmod to change the resolution of a tif graphics file....
6
by: Richard | last post by:
I am going to need to plot some data and formula results from Python. A few years ago I used gnuplot (not from Python) and was wondering which Python plotting module I should use (learn)? I...
1
by: pwhbeck | last post by:
Linux SUSE 10.1 Python 2.5 Dislin 9.1 Download dislin 9.1, change to directory dislin-9.1/python Change make_py to: elif test $1 = lnx ; then CC="gcc -fPIC -c -O" ...
3
by: luis | last post by:
Hello! I have an unespectedn result with dislin titlin dislin.metafl ('WMF') dislin.disini () ..... a="Andrés or Ramón" dislin.titlin (a.encode("Latin-1"), 1)
1
by: adolfo | last post by:
I am at the very beginning of the DISLIN 9.3 Manual: 1.4 Quickplots Some quickplots are added to the DISLIN module which are collections of DISLIN routines for displaying data with one command....
3
by: adolfo | last post by:
*** I thought I posted this subject 45 min ago but it does not show so something went wrong and it does not show up. Excuse me if I repeat myself *** DISLIN 9.3 old manual problems I just...
0
by: Helmut Michels | last post by:
Dear C/C++ programmers, I am pleased to announce version 9.4 of the data plotting software DISLIN. DISLIN is a high-level and easy to use plotting library for displaying data as curves, bar...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.