Hi Adel,

Thank you for the quick response. When I try *kwant.plotter.map(sys, value,
vmin=0, vmax=2) *I get the following error:

ValueError: Only 2D systems can be plotted this way.


My system is a 3D system. I would be glad if you could help me out in
this regard.


Best regards,

Shivang Agarwal


On Mon, Nov 19, 2018 at 6:57 PM Abbout Adel <abbout.a...@gmail.com> wrote:

> Dear Shivang,
> Just use the options you have in matplotlib.
> You can, for example, write help(kwant.plotter.map) you get:
>
> Help on function map in module kwant.plotter:
>
> map(sys, value, colorbar=True, cmap=None, vmin=None, vmax=None, a=None, 
> method='nearest', oversampling=3, num_lead_cells=0, file=None, show=True, 
> dpi=None, fig_size=None, ax=None, pos_transform=None, background='#e0e0e0')
>     Show interpolated map of a function defined for the sites of a system.
>
>     Create a pixmap representation of a function of the sites of a system by
>     calling `~kwant.plotter.mask_interpolate` and show this pixmap using
>     matplotlib.
>
>     Parameters
>     ----------
>     sys : kwant.system.FiniteSystem or kwant.builder.Builder
>         The system for whose sites `value` is to be plotted.
>     value : function or list
>         Function which takes a site and returns a value if the system is a
>         builder, or a list of function values for each system site of the
>         finalized system.
>     colorbar : bool, optional
>         Whether to show a color bar if numerical data has to be plotted.
>         Defaults to `True`. If `ax` is provided, the colorbar is never 
> plotted.
>     cmap : ``matplotlib`` color map or `None`
>         The color map used for sites and optionally hoppings, if `None`,
>         ``matplotlib`` default is used.
>     vmin : float, optional
>         The lower saturation limit for the colormap; values returned by
>         `value` which are smaller than this will saturate
>     vmax : float, optional
>         The upper saturation limit for the colormap; valued returned by
>         `value` which are larger than this will saturate
>
>
>
> I hope this helps,
>
> Adel
>
>
> On Mon, Nov 19, 2018 at 12:42 PM Shivang Agarwal <
> shivang.agar...@iitgn.ac.in> wrote:
>
>> Dear All,
>>
>> I am using the kwant.plot and kwant.wavefunction functions to plot the
>> wavefunction's sqaured amplitude on the system. For my work, I need to
>> compare such plots on two different systems. It is tough to compare the
>> values as the max and min is not defined on the colorbar. For example, if
>> system 1 has a max value of 0.9 it will be shown as yellow. However, if
>> system 2 has a max value of 2.4 it will also be shown as yellow because the
>> max value gets automatically assigned to the top of the colorbar (inferno
>> in this case).
>>
>> Would it be possible to assign the max of the colorbar to a fixed number,
>> say 5, for all plots. That way the value 5 will be yellow and 2.4 could be
>> orange while 0.9 could be blue - leading to easier comparison between plots
>> of seen side by side.
>>
>> Any help would be greatly appreciated.
>>
>> Thanks and best regards,
>> Shivang Agarwal
>>
>> --
>> *Shivang Agarwal*
>> Senior Undergraduate
>> Coordinator - Academic Discussion Hours
>> Discipline of Electrical Engineering
>> IIT Gandhinagar
>>
>> Contact: +91-9869321451
>>
>
>
> --
> Abbout Adel
>


-- 
*Shivang Agarwal*
Senior Undergraduate
Coordinator - Academic Discussion Hours
Discipline of Electrical Engineering
IIT Gandhinagar

Contact: +91-9869321451

Reply via email to