Re: [Veusz-discuss] Label offset

2015-03-08 Par sujet Jeremy Sanders

Dear Simon

On 03/06/2015 05:59 PM, Simon Kleinknecht wrote:


Would it make sense to fix the axis label offset to the axis/frame of
the graph? This would solve the issue.


The at edge setting for the axis label may be what you want - set it 
for all the axes. Ideally Veusz should do this automatically for graphs 
in a grid, however.


Jeremy

___
Veusz-discuss mailing list
Veusz-discuss@gna.org
https://mail.gna.org/listinfo/veusz-discuss


[Veusz-discuss] stops on colormap

2015-03-08 Par sujet Yubaraj Malakar
Dear Jeremy,

The colormap in veusz divides the color stops within range [0, 1] equally by
number of entries in given colormap. (correct me if I am wrong here)

I wrote a simple python code that produces a simple colorbarwidget using
pyqtgraph module. This writes a 0custom colormap The widget makes it very
easy to add/delete colors on colormap on the fly. The widget also provides
color stop which can be changed just by sliding. (The color stops doesnot
have any influence on Veusz.)

Is there any way to implement manual color stops instead of default equally
spaced color stops so that one can have better control over color of the
image of 2d dataset?


Here is the code: I run the .py file in veusz python console

#colormap changer for veusz (yubaraj malakar)

from PyQt4 import QtGui
from PyQt4 import QtCore
import pyqtgraph as pg


#Gradient creator widget
gw= pg.GradientWidget() 

#list for name of colormap
item=QtGui.QListWidget()
item.addItem('SpecTcl ColorMap')
item.addItem('RainBow')
w=QtGui.QWidget()

#function for ColorMap change

def selectColorMap():
if item.currentRow() == 0:
sp1=(0,(0,0,0,255))
sp2=(0.2,(0,140,255,255))
sp3=(0.37,(0,181,0,255))
sp4=(0.75,(255,255,0,255))
sp5=(0.98,(255,0,51,255))
sp=[sp1,sp2,sp3,sp4,sp5]
spCmap=dict(ticks=sp,mode='rgb')
gw.restoreState(spCmap)

if item.currentRow() == 1:
rb1=(0,(0,0,255,255))
rb2=(0.25,(0,255,0,255))
rb3=(0.5,(255,255,0,255))
rb4=(0.75,(255,127,0,255))
rb5=(0.98,(255,0,0,255))
rb=[rb1,rb2,rb3,rb4,rb5]
rbCmap=dict(ticks=rb,mode='rgb')
gw.restoreState(rbCmap)


def changeColorMap():
gwmap=gw.saveState()
gmap=gwmap['ticks']
gmap=sorted(gmap)
vmap=range(len(gmap))
#this omits the color stops and takes the rest
for i in range (len(gmap)):
vmap[i]=gmap[i][1]

AddCustom('colormap','0custom',vmap, 'append')

#function assigned to colorMap
gw.sigGradientChangeFinished.connect(changeColorMap)
item.itemClicked.connect(selectColorMap)


## Create a gid layout to manage the widgets size and position
layout = QtGui.QGridLayout()
w.setLayout(layout)

## Add widgets to the layout in their proper positions
layout.addWidget(gw,0,0)
layout.addWidget(item,1,0)
w.show()



___
Veusz-discuss mailing list
Veusz-discuss@gna.org
https://mail.gna.org/listinfo/veusz-discuss